Marijan Milicevic pushed to branch bugfix/HIPPLUG-1327 at cms-community / hippo-plugin-relateddocs
Commits: ad69524a by Marijan Milicevic at 2016-06-28T04:19:47+02:00 HIPPLUG-1327 Related Documents - it is possible to add the same item more than once - don't store duplicate values - - - - - 86932a47 by Marijan Milicevic at 2016-06-28T04:20:10+02:00 HIPPLUG-1327 Related Documents - it is possible to add the same item more than once - update copyright - - - - - 1 changed file: - addon-cms/src/main/java/org/onehippo/forge/relateddocs/RelatedDocCollection.java Changes: ===================================== addon-cms/src/main/java/org/onehippo/forge/relateddocs/RelatedDocCollection.java ===================================== --- a/addon-cms/src/main/java/org/onehippo/forge/relateddocs/RelatedDocCollection.java +++ b/addon-cms/src/main/java/org/onehippo/forge/relateddocs/RelatedDocCollection.java @@ -1,5 +1,5 @@ /* - * Copyright 2009-2015 Hippo B.V. (http://www.onehippo.com) + * Copyright 2009-2016 Hippo B.V. (http://www.onehippo.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -135,6 +135,8 @@ public class RelatedDocCollection implements Cloneable, IDataProvider<RelatedDoc if (exists) { RelatedDoc relatedDoc = related.get(r); relatedDoc.addScore(r.getScore()); + // skip storing the value, if it already exists + return; } else { related.put(r, r); } View it on GitLab: https://code.onehippo.org/cms-community/hippo-plugin-relateddocs/compare/f98c05bb82172ee82b796ec6206c4c4a9b37ea29...86932a470bdf5e78c7a75ec48061ed1921beded4
_______________________________________________ Hippocms-svn mailing list Hippocms-svn@lists.onehippo.org https://lists.onehippo.org/mailman/listinfo/hippocms-svn