branch develop updated (ffd0656 -> 6b55547)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository bow. See http://git.chorem.org/bow.git from ffd0656 fixes #963: Rendre la recherche par tag insensible à la casse new 6b55547 this commit fixes bug when we use alias to go to site, it don't increment count The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit 6b555479d47a8cf073368897271ba6f90d8c85e7 Author: Benjamin POUSSIN <poussin@codelutin.com> Date: Sat Aug 1 00:13:19 2015 +0200 this commit fixes bug when we use alias to go to site, it don't increment count Summary of changes: .../java/org/chorem/bow/action/AliasAction.java | 32 +++++++++++++++++----- 1 file changed, 25 insertions(+), 7 deletions(-) -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository bow. See http://git.chorem.org/bow.git commit 6b555479d47a8cf073368897271ba6f90d8c85e7 Author: Benjamin POUSSIN <poussin@codelutin.com> Date: Sat Aug 1 00:13:19 2015 +0200 this commit fixes bug when we use alias to go to site, it don't increment count --- .../java/org/chorem/bow/action/AliasAction.java | 32 +++++++++++++++++----- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/bow-ui/src/main/java/org/chorem/bow/action/AliasAction.java b/bow-ui/src/main/java/org/chorem/bow/action/AliasAction.java index fef0d45..5272cff 100644 --- a/bow-ui/src/main/java/org/chorem/bow/action/AliasAction.java +++ b/bow-ui/src/main/java/org/chorem/bow/action/AliasAction.java @@ -23,6 +23,7 @@ package org.chorem.bow.action; import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.chorem.bow.BookmarkUtils; import org.chorem.bow.BowBookmark; import org.chorem.bow.BowProxy; import org.chorem.bow.BowUser; @@ -81,24 +82,41 @@ public class AliasAction extends BowBaseAction { // with this hack, we can't count bookmark access via public alias WikittyQuery criteria = new WikittyQueryMaker() .select(BowBookmark.ELEMENT_FIELD_BOWBOOKMARK_LINK).where().or() - .ideq(alias) .eq(BowBookmark.FQ_FIELD_BOWBOOKMARK_PUBLICALIAS, alias) .end(); String link = proxy.findByQuery(criteria); if (link == null) { - // not id or public alias, looking for private if user is logged + // not public alias, looking for id or private if user is logged BowUser user = getBowSession().getUser(); if (user != null) { criteria = new WikittyQueryMaker().and() + .exteq(BowBookmark.EXT_BOWBOOKMARK) .eq(BowBookmark.FQ_FIELD_WIKITTYAUTHORISATION_OWNER, user.getWikittyId()) - .eq(BowBookmark.FQ_FIELD_BOWBOOKMARK_PRIVATEALIAS, alias) + .or() + .ideq(alias) + .eq(BowBookmark.FQ_FIELD_BOWBOOKMARK_PRIVATEALIAS, alias) .end(); BowBookmark bookmark = proxy.findByQuery(BowBookmark.class, criteria); - link = bookmark.getLink(); - int clicks = bookmark.getClick() + 1; - bookmark.setClick(clicks); - proxy.store(bookmark); + + if (bookmark == null) { + // not found in private alias of user, search into shared group + WikittyQueryMaker query = new WikittyQueryMaker().and(); + BookmarkUtils.addEqUser(query, user.getWikittyId()); + criteria = query.exteq(BowBookmark.EXT_BOWBOOKMARK) + .or() + .ideq(alias) + .eq(BowBookmark.FQ_FIELD_BOWBOOKMARK_PRIVATEALIAS, alias) + .end(); + bookmark = proxy.findByQuery(BowBookmark.class, criteria); + } + + if (bookmark != null) { + link = bookmark.getLink(); + int clicks = bookmark.getClick() + 1; + bookmark.setClick(clicks); + proxy.store(bookmark); + } } } if (link != null) { -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm