Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-24540

Viewfile macro can't find attachment if the page title contain character after colon (:)

      NOTE: This bug report is for Confluence Server. Using Confluence Cloud? See the corresponding bug report.

      Summary of The Bug

      When page title have any character after a colon( : )

      Office Connector:test
      

      office connector can't find the office files attached to the page. If colon is the last character on the page title, attached office files searchable by view office macro.

      This bug also affects the multimedia macros (adding audio / video files).

      How to reproduce the bug

      1. Create a page (example: 'Office connector:')
      2. Attached office file into the page
      3. Try to view it using view office plugin
      4. Change the page title to contain any character after colon (example: 'Office connector:test')
      5. Try to view it using view office plugin
      6. Attached files can't be seen on "File Name" fields
        When viewed with Developer Tools, the attachmentsearch.action GET request returned HTTP 404 error code.

      Workarounds

      Option 1 - Rename the page to remove the ':'

      Option 2 - Use the insert markup feature:

      1. From the editor toolbar, expand the '+' menu.
      2. Choose 'Markup'.
      3. Insert the following markup (change accordingly):
        {viewfile:name_of_the_attachments.ext}
        
      1. Save

      Work performed

      • Changes are backwards-compatible in the plugin, committed in https://bitbucket.org/atlassian/officeconnector issue/CONF-24540 . 2 backwards-compatibility issues were raised: CONFDEV-10156 and CONFDEV-10157.
      • Changes in confluence-core are still on issue/CONF-24540, and awaiting implementation of a few review comments before being committed.

        1. attached.png
          attached.png
          12 kB
        2. broke.png
          broke.png
          56 kB
        3. Officepage.png
          Officepage.png
          15 kB
        4. screenshot-1.png
          screenshot-1.png
          19 kB
        5. test.png
          test.png
          15 kB
        6. Works.png
          Works.png
          57 kB

            [CONFSERVER-24540] Viewfile macro can't find attachment if the page title contain character after colon (:)

            Daniel Tan added a comment -

            Another 3 months then is 13th Anniversary of this issue reported!  

            What a outstanding achievement!  🥳  🥳  🥳  🥳 

            Daniel Tan added a comment - Another 3 months then is 13th Anniversary of this issue reported!   What a outstanding achievement!  🥳  🥳  🥳  🥳 

            Still appears in 7.18.3

            Ulrich Hinze added a comment - Still appears in 7.18.3

            Volker added a comment -

            More than 7 years and no fix?! Just stumbled over this bug this morning. Took me some time to find out why the file was not found. Please fix this bug asap.

            Volker added a comment - More than 7 years and no fix?! Just stumbled over this bug this morning. Took me some time to find out why the file was not found. Please fix this bug asap.

            And one more thing to add:

            Bugs are not equal to bugs. They are different.
            And this bug is evil and ridicolous:

            • Evil, because the reason for the misbehaviour is really hard to find, so will always cause every victim to loose a lot of time
            • Ridiculous, because it is really a poor design to use internally the fragile name instead of the ID, which has always a reliable pattern

            So please rank higher and fix. There are no excuses for leaving this kind of issues open.

            confluence@ecogood.org added a comment - And one more thing to add: Bugs are not equal to bugs. They are different. And this bug is evil and ridicolous: Evil, because the reason for the misbehaviour is really hard to find, so will always cause every victim to loose a lot of time Ridiculous, because it is really a poor design to use internally the fragile name instead of the ID , which has always a reliable pattern So please rank higher and fix. There are no excuses for leaving this kind of issues open.

            This issue produces 2 more problems, besides the viewfile-macro-thing:

            • the linking to a page fails, if it contains an anchor
            • when a user makes changes on a page, but does not save/publish them, they are temporary saved. When he later goes in edit-mode again, he is offered to use these changes.
              But when another user in the meantime changes the page name with special characters (so that the URL changes from title to ID), then the first user can get an erorr message, and the whole content is gone.

            And see https://getsupport.atlassian.com/servicedesk/customer/portal/14/CSP-220512: only my case bound a lot of ressources (also in your support team). This time is better used for fixing!

            So, dear Atlassian, please fix issue after now 6 years

            confluence@ecogood.org added a comment - This issue produces 2 more problems, besides the viewfile-macro-thing: the linking to a page fails, if it contains an anchor when a user makes changes on a page, but does not save/publish them, they are temporary saved. When he later goes in edit-mode again, he is offered to use these changes. But when another user in the meantime changes the page name with special characters (so that the URL changes from title to ID), then the first user can get an erorr message, and the whole content is gone. And see https://getsupport.atlassian.com/servicedesk/customer/portal/14/CSP-220512: only my case bound a lot of ressources (also in your support team). This time is better used for fixing! So, dear Atlassian , please fix issue after now 6 years

            The above workaround is appreciated.  I see the priority was also moved to "High"... does this suggest the workaround, or even better a fix, will be rolled into release?  

            Cheers

            Malcolm Cook added a comment - The above workaround is appreciated.  I see the priority was also moved to "High"... does this suggest the workaround, or even better a fix, will be rolled into release?   Cheers

            Tobias Twardon added a comment - - edited

            Hi Fellow-Users,

            we have now added the following "fix" to the confluence Custom-HTML-Section:

            <script>
            $( document ).ajaxComplete(function() {
              var elem=$('#macro-param-page');
              if (elem.val()===undefined)
                return;
              if (elem.val().indexOf(":")>0){
                $('#macro-param-page').val("");
                $('#macro-param-page').change();
              }
            });
            </script>

            It will auto-apply a workaround, by removing the page-title from the parameterized attachment search.
            This way the search will be issued for the current page.
            So this will cover 95% of the cases where the issue is happening.

            The only thing not possibly is embedding an attachment from another page in the space, when this has a colon in it...
            But this will be negligible.

            Best regards,
            Tobias

            Tobias Twardon added a comment - - edited Hi Fellow-Users, we have now added the following "fix" to the confluence Custom-HTML-Section: <script> $( document ).ajaxComplete(function() { var elem=$( '#macro-param-page' ); if (elem.val()===undefined) return ; if (elem.val().indexOf( ":" )>0){ $( '#macro-param-page' ).val(""); $( '#macro-param-page' ).change(); } }); </script> It will auto-apply a workaround, by removing the page-title from the parameterized attachment search. This way the search will be issued for the current page. So this will cover 95% of the cases where the issue is happening. The only thing not possibly is embedding an attachment from another page in the space, when this has a colon in it... But this will be negligible. Best regards, Tobias

            "25% - affects a minority of users or feature is not regularly used" is hubris - where are the poll results - I'd like to see this fixed - not fixing it raises serious concerns that treatment of no alphnumeric characters in page titles will potentially similarly cause problems.  Get your character escape logic right and fix this!

            Malcolm Cook added a comment - "25% - affects a minority of users or feature is not regularly used" is hubris - where are the poll results - I'd like to see this fixed - not fixing it raises serious concerns that treatment of no alphnumeric characters in page titles will potentially similarly cause problems.  Get your character escape logic right and fix this!

            Team Atlassian:

            Please kindly reply how your response to user concerns during the the past five years relates to your core values listed below, particularly the middle one.

            • Open Company, No Bullshit
            • Build with Heart and Balance
            • Don’t F@#$ the Customer
            • Play, As a Team
            • Be the Change You Seek

            Bottom Line:  Your users are paying for a working product and your corrective action, yet none is received in this case.  Seems like a not too efficient business model.

            Jeff Peters added a comment - Team Atlassian: Please kindly reply how your response to user concerns during the the past five years relates to your core values listed below, particularly the middle one. Open Company, No Bullshit Build with Heart and Balance Don’t F@#$ the Customer Play, As a Team Be the Change You Seek Bottom Line :  Your users are paying for a working product and your corrective action, yet none is received in this case.  Seems like a not too efficient business model.

            I would also love to see this bug fixed. However, I'm actually surprised they haven't simply closed this issue as "Won't Fix" given that they plan to remove the view-file macro in a future version: https://jira.atlassian.com/browse/CONF-39829

            Gareth White added a comment - I would also love to see this bug fixed. However, I'm actually surprised they haven't simply closed this issue as "Won't Fix" given that they plan to remove the view-file macro in a future version:  https://jira.atlassian.com/browse/CONF-39829

              Unassigned Unassigned
              scahyadiputra Septa Cahyadiputra (Inactive)
              Affected customers:
              103 This affects my team
              Watchers:
              102 Start watching this issue

                Created:
                Updated: