Details

    • Difficulty:
      Unknown
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      Description

      Steps to reproduce (using http://www.xwiki.org/xwiki/bin/view/FAQ/How+do+I+add+a+favicon+for+my+wiki) :

      • attach a new favicon named "icons.xwiki.favicon.ico" on the skin XWiki.DefaultSkin
      • refresh the homepage of the wiki
        Expected result:
      • the URL should be updated to (results from 6.2.4):
        <link href="/xwiki/bin/skin/XWiki/DefaultSkin/icons.xwiki.favicon.ico" rel="shortcut icon">
        
      • the favicon is displayed on the browser tab

      Actual result:

      • the favicon is not displayed on the browser tab
      • the URL is still the default one:
        <link href="/xwiki/resources/icons/xwiki/favicon.ico" rel="shortcut icon">
        

        Issue Links

          Activity

          Hide
          Vincent Massol added a comment -

          ok so I've tried to trace the problem and I think the regression has been introduced by XWIKI-11460 (in 6.4M1). Before the commits for that issue (see https://github.com/xwiki/xwiki-platform/commit/1c7a0243d2cca01e4c6dab632ed76af4b5191281#diff-35c058d68f029d8ba82f75c3404dc7d8L1791) we were doing:

          // Look for an attachment
          String shortName = StringUtils.replaceChars(filename, '/', '.');
          XWikiAttachment attachment = doc.getAttachment(shortName);
          if (attachment != null) {
              return doc.getAttachmentURL(shortName, "skin", context);
          }
          

          And after the commits we're now doing (see https://github.com/xwiki/xwiki-platform/blob/ea02d8619f104f7d4d876196c5106fd1fc70484e/xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/internal/skin/WikiSkinUtils.java#L152-L152):

          XWikiAttachment attachment = skinDocument.getAttachment(resource);
           if (attachment != null) {
              AttachmentReference reference = attachment.getReference();
              return new AttachmentWikiResource(getPath(reference), skin, reference, attachment.getAuthorReference(), this.xcontextProvider);
          }
          

          FTR for the favicon, in htmlheader.vm we have:

              <link rel="shortcut icon" href="$xwiki.getSkinFile('icons/xwiki/favicon.ico')" />
          

          So I propose to add back the missing line to replace the "/" into "." which would allow the attachment to be found.

          This is quite an important regression since it means it's no longer possible to override resources located in subdirectories.

          Show
          Vincent Massol added a comment - ok so I've tried to trace the problem and I think the regression has been introduced by XWIKI-11460 (in 6.4M1). Before the commits for that issue (see https://github.com/xwiki/xwiki-platform/commit/1c7a0243d2cca01e4c6dab632ed76af4b5191281#diff-35c058d68f029d8ba82f75c3404dc7d8L1791 ) we were doing: // Look for an attachment String shortName = StringUtils.replaceChars(filename, '/', '.'); XWikiAttachment attachment = doc.getAttachment(shortName); if (attachment != null ) { return doc.getAttachmentURL(shortName, "skin" , context); } And after the commits we're now doing (see https://github.com/xwiki/xwiki-platform/blob/ea02d8619f104f7d4d876196c5106fd1fc70484e/xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/internal/skin/WikiSkinUtils.java#L152-L152): XWikiAttachment attachment = skinDocument.getAttachment(resource); if (attachment != null ) { AttachmentReference reference = attachment.getReference(); return new AttachmentWikiResource(getPath(reference), skin, reference, attachment.getAuthorReference(), this .xcontextProvider); } FTR for the favicon, in htmlheader.vm we have: <link rel= "shortcut icon" href= "$xwiki.getSkinFile('icons/xwiki/favicon.ico')" /> So I propose to add back the missing line to replace the "/" into "." which would allow the attachment to be found. This is quite an important regression since it means it's no longer possible to override resources located in subdirectories.
          Hide
          Vincent Massol added a comment -

          Note that if need be, it's easy to patch on existing instances since it's a one-liner.

          Show
          Vincent Massol added a comment - Note that if need be, it's easy to patch on existing instances since it's a one-liner.

            People

            • Assignee:
              Vincent Massol
              Reporter:
              Elena-Oana Tabaranu
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Date of First Response: