URL for related tags relevant for group XY

Issue #36 resolved
Lena Hettinger created an issue

While viewing items relevant for a group, it is not possible to show items in that group that are tagged with a related tag (see sidebar). The URL is created falsely: it should be /relevantfor/group/GROUP_NAME/RELATED_TAG instead of relevantfor/group/RELATED_TAG

Comments (19)

  1. Viktor Hemsen

    the ${requPath} value contains the needed information 'relevantfor/group/GROUPNAME' but the problem here is the function 'getLowerPath()' [Functions.java] being called in related.tagx when the single-tag-url is constructed.

    /**
         * Cuts the last segment of the url string until last slash. TODO: If the
         * path contains more than three slashes, then the cut is after the third
         * slash. (Previous to adding this restrictions, tags that included a slash
         * could not be handled on /user/USER/TAG; remove as soon as the bug in
         * urlrewrite lib is fixed
         * 
         * @param uriString
         *            the url
         * @return last segment of the url string until last slash
         */
        public static String getLowerPath(final String uriString) {....}
    

    an if-case to check the requPath and esacpe the call in related.tagx? any thoughts?

  2. Daniel Zoller

    I find your solution too dirty because if someone tags a post with relevantfor the wrong url is used. You should introduce an optional attribute to the tagx file and only set it in the relavantfor.jspx.

    Can you also check in the new Bootstrap layout if the same error appears? Thanks

  3. Viktor Hemsen

    Alright, thanks for the heads up.. i added an attribute to the tagx and noticed that the same problem appeared for the multiple tags, that's why i check for the '/' - count and just add the tag with '+' would you look at the merge again please?

    i haven't checked for the new layout yet but it most probably will be there too. i will answer here then

  4. Daniel Zoller

    some remarks:

    • change the attribute relevantfor to boolean
    • set only the attribute to true if no other tags are requested (this should fix the links on /relevantfor/group/GROUP_NAME/TAG)
      • please check on this page the '+' - Link
    • disable the + sign only when no other tags are requested i.e. on /relevantfor/group/GROUP_NAME

    The fix must be applied to the new layout as well.

  5. Viktor Hemsen

    remarks have been implemented to the old and new layout. only the 'set only the attribute to true if no other tags are requested.. ' remark was done within the related.tagx file because of the 'getLowerPath()' function [cuts url after the third slash]

  6. Log in to comment