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

Pages can't be "included" if they contain symbols on their titles

      Summary:

      As you can see in my example, the include macro won't work with page names that includes special characters like the slash / symbol

      https://wiki.childno.de/x/IABe

      Steps to Reproduce:

      1. Create page with slash in title
      2. Create a second page. Add include macro to this page

      Workaround:

      Removing the slash from the title of the page will solve the problem for any new pages, but you'll still have old pages which had the broken include macro in your instance. You can delete these pages via the following:

      You'll need to find out what the contentid of the page is, via this query:

      select contentid from content where title = 'TITLE_OF_PAGE_YOU_WANT_TO_DELETE' and prevver is null;
      

      You can then paste the following link into your browser:

      <confluence_base_url>/pages/removepage.action?pageId=THE_CONTENTID_FROM_DB_QUERY

      If you need to recover the contents of the page, you'll need to remove the include macro from the page. Prior to doing any update or delete on your database please make sure to backup both the filesystem and database. Having done so, run:

      update bodycontent set body = regexp_replace(body, '<ac:macro ac:name="include"><ac:default-parameter>.*/.*</ac:default-parameter></ac:macro>', '')  where contentid = (select contentid from content where title = 'YOUR_PAGE_TITLE' and prevver is null);
      

      This will find any include macro with a slash in the the included page's title and remove it from your page.

      Note: This was written for a Postgres database. If you are using something else, you may need to tweak the query.

            [CONFSERVER-24785] Pages can't be "included" if they contain symbols on their titles

            Stefan Baader added a comment - - edited

            We just updated to CONF 6.9.1 and it seems that this problem is still occurring when a page ""template__some page" is included and that page is renamed for some reasons (f.e. because in MediaWiki this is common) into "template:some page" or "template: some page".

            At that moment the including page looks still OK. But once you edit the including page and save it you will get an error "Unable to render {include}" on the page.

            I opened a new issue for the support.

            Stefan Baader added a comment - - edited We just updated to CONF 6.9.1 and it seems that this problem is still occurring when a page ""template__some page" is included and that page is renamed for some reasons (f.e. because in MediaWiki this is common) into "template:some page" or "template: some page". At that moment the including page looks still OK. But once you edit the including page and save it you will get an error "Unable to render {include}" on the page. I opened a new issue for the support.

            That's good concern konqi . I would keep the save page as what it is now. I have raised the ticket https://jira.atlassian.com/browse/CONF-35738 to correct the include page macro when including the page has title contains macro syntax.

            Thank you
            Vu

            Vu Truong Vo (Inactive) added a comment - That's good concern konqi . I would keep the save page as what it is now. I have raised the ticket https://jira.atlassian.com/browse/CONF-35738 to correct the include page macro when including the page has title contains macro syntax. Thank you Vu

            childnode added a comment - - edited

            @vvo yeah ... ok but why then are you able to save pages with this?!
            https://wiki.childno.de/x/WQCPAQ

            So please: Either deny page names with {} OR make include working for these chars too.
            But if you deny this for new pages, also take notice for migration tasks!

            childnode added a comment - - edited @ vvo yeah ... ok but why then are you able to save pages with this?! https://wiki.childno.de/x/WQCPAQ So please: Either deny page names with {} OR make include working for these chars too. But if you deny this for new pages, also take notice for migration tasks!

            Vu Truong Vo (Inactive) added a comment - - edited

            Thanks your comment konqi,

            we have the constraint about the page title should not contains

            {}

            because it is macro syntax . the transform engine will try to render the macro if it see

            {}

            . Also regarding to your log Confluence said it cannot find the macro which mean Confluence try to find the macro name "{}" in registered macro list .

            Hope above explanation that make sense.

            Thank you and best regards,
            Vu

            Vu Truong Vo (Inactive) added a comment - - edited Thanks your comment konqi , we have the constraint about the page title should not contains {} because it is macro syntax . the transform engine will try to render the macro if it see {} . Also regarding to your log Confluence said it cannot find the macro which mean Confluence try to find the macro name "{}" in registered macro list . Hope above explanation that make sense. Thank you and best regards, Vu

            childnode added a comment -

            @jee.misc did you test it on 5.5?
            vvo marked it as fixed because they dogfooded this problem and obviously fixed it then

            basically for me it's fixed. Even migration seems not to be a problem in normal case

            • Umlauts
            • typical special chars

            for testing I created a page with title

            !"§$%&/()=?,;.:-_öäüÖÄÜ#'+*<>¡“¶¢[]|{}≠¿'¬”#£fi^\˜·¯˙˚˛÷—’›˘‹◊ÇÙ‡≥ÅÍ™ÏÌÓıˆflŒÆ∏ØÛÁˇ˝¸‰„»
            

            thank you very much @vvo but can you please tell which are the constraints for Page titles? if there are no more (any UTF-8 char?!) why is the string above valid for creating pages but will result backend error when trying to include?

            2014-11-26 06:40:59,976 ERROR [http-1990-2] [ContainerBase.[Catalina].[localhost].[/confluence]] log Unhandled exception occurre
            d whilst decorating page
             -- referer: http://localhost:1990/confluence/pages/editpage.action?pageId=98334 | url: /confluence/plugins/servlet/confluence/p
            laceholder/macro | userName: admin
            java.lang.NullPointerException
                    at com.atlassian.confluence.renderer.UserMacroLibrary.getMacro(UserMacroLibrary.java:121)
                    at com.atlassian.confluence.renderer.UserMacroLibrary.hasMacro(UserMacroLibrary.java:116)
                    at com.atlassian.confluence.macro.browser.UserMacroMetadataProvider.getByMacroName(UserMacroMetadataProvider.java:54)
                    at com.atlassian.confluence.macro.browser.UserMacroMetadataProvider.getByMacroNameAndId(UserMacroMetadataProvider.java:67)
                    at com.atlassian.confluence.macro.browser.DefaultMacroMetadataManager.getMacroMetadataByNameAndId(DefaultMacroMetadataManager.java:56)
                    at com.atlassian.confluence.macro.browser.DefaultMacroMetadataManager.getMacroMetadataByName(DefaultMacroMetadataManager.java:48)
                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                    at java.lang.reflect.Method.invoke(Method.java:597)
                    at com.atlassian.plugin.osgi.hostcomponents.impl.DefaultComponentRegistrar$ContextClassLoaderSettingInvocationHandler.invoke(DefaultComponentRegistrar.java:129)
                    at com.sun.proxy.$Proxy350.getMacroMetadataByName(Unknown Source)
                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                    at java.lang.reflect.Method.invoke(Method.java:597)
                    at com.atlassian.plugin.osgi.bridge.external.HostComponentFactoryBean$DynamicServiceInvocationHandler.invoke(HostComponentFactoryBean.java:154)
                    at com.sun.proxy.$Proxy350.getMacroMetadataByName(Unknown Source)
                    at com.atlassian.confluence.tinymceplugin.placeholder.MacroPlaceholderServlet.doGet(MacroPlaceholderServlet.java:89)
                    at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
                    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
                    at com.atlassian.plugin.servlet.DelegatingPluginServlet.service(DelegatingPluginServlet.java:42)
                    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
            

            childnode added a comment - @ jee.misc did you test it on 5.5? vvo marked it as fixed because they dogfooded this problem and obviously fixed it then basically for me it's fixed. Even migration seems not to be a problem in normal case Umlauts typical special chars for testing I created a page with title !"§$%&/()=?,;.:-_öäüÖÄÜ# '+*<>¡“¶¢[]|{}≠¿' ¬”#£fi^\˜·¯˙˚˛÷—’›˘‹◊ÇÙ‡≥ÅÍ™ÏÌÓıˆflŒÆ∏ØÛÁˇ˝¸‰„» thank you very much @ vvo but can you please tell which are the constraints for Page titles? if there are no more (any UTF-8 char?!) why is the string above valid for creating pages but will result backend error when trying to include? 2014-11-26 06:40:59,976 ERROR [http-1990-2] [ContainerBase.[Catalina].[localhost].[/confluence]] log Unhandled exception occurre d whilst decorating page -- referer: http://localhost:1990/confluence/pages/editpage.action?pageId=98334 | url: /confluence/plugins/servlet/confluence/p laceholder/macro | userName: admin java.lang.NullPointerException at com.atlassian.confluence.renderer.UserMacroLibrary.getMacro(UserMacroLibrary.java:121) at com.atlassian.confluence.renderer.UserMacroLibrary.hasMacro(UserMacroLibrary.java:116) at com.atlassian.confluence.macro.browser.UserMacroMetadataProvider.getByMacroName(UserMacroMetadataProvider.java:54) at com.atlassian.confluence.macro.browser.UserMacroMetadataProvider.getByMacroNameAndId(UserMacroMetadataProvider.java:67) at com.atlassian.confluence.macro.browser.DefaultMacroMetadataManager.getMacroMetadataByNameAndId(DefaultMacroMetadataManager.java:56) at com.atlassian.confluence.macro.browser.DefaultMacroMetadataManager.getMacroMetadataByName(DefaultMacroMetadataManager.java:48) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.atlassian.plugin.osgi.hostcomponents.impl.DefaultComponentRegistrar$ContextClassLoaderSettingInvocationHandler.invoke(DefaultComponentRegistrar.java:129) at com.sun.proxy.$Proxy350.getMacroMetadataByName(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.atlassian.plugin.osgi.bridge.external.HostComponentFactoryBean$DynamicServiceInvocationHandler.invoke(HostComponentFactoryBean.java:154) at com.sun.proxy.$Proxy350.getMacroMetadataByName(Unknown Source) at com.atlassian.confluence.tinymceplugin.placeholder.MacroPlaceholderServlet.doGet(MacroPlaceholderServlet.java:89) at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at com.atlassian.plugin.servlet.DelegatingPluginServlet.service(DelegatingPluginServlet.java:42) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

            Hi jee.misc

            Thanks your feedbacks . Could you help show us your steps to reach this issue Pages can't be "included" if they contain symbols on their titles that would help us a lot.

            Thank you and best regards,
            Vu

            Vu Truong Vo (Inactive) added a comment - Hi jee.misc Thanks your feedbacks . Could you help show us your steps to reach this issue Pages can't be "included" if they contain symbols on their titles that would help us a lot. Thank you and best regards, Vu

            This is not resolved and the workaround is unacceptable.

            Jee Christiansen added a comment - This is not resolved and the workaround is unacceptable.

            childnode added a comment - - edited

            i totally agree with karie.kelly@phytel.com.
            if it's a problem to fix, please provide a plugin that allows administrators to disable the relaxed page naming again / prior updating.
            Now that there are lot of 3.5 users out of support, they possibly want to disable this in migration.

            childnode added a comment - - edited i totally agree with karie.kelly@phytel.com . if it's a problem to fix, please provide a plugin that allows administrators to disable the relaxed page naming again / prior updating. Now that there are lot of 3.5 users out of support, they possibly want to disable this in migration.

            Why is a critical issue that has been opened for over a year not considered a priority to be resolved?
            This issue makes titling pages that mean something (e.g. not run on words or fragments) nearly impossible.
            We have pages that you have a subject and then category. It makes no sense not to be able to put a : or - between the two to indicate the specific subject and then not be able to reuse that content using the include macro.

            If anything, give us the ability to include based on the link to the page instead of the page title as a workaround. But, in my opinion, if an issue is identified as critical, there should be a SLA of just a few months to resolve - not years!
            When is this planned to be fixed?

            Karie Kelly added a comment - Why is a critical issue that has been opened for over a year not considered a priority to be resolved? This issue makes titling pages that mean something (e.g. not run on words or fragments) nearly impossible. We have pages that you have a subject and then category. It makes no sense not to be able to put a : or - between the two to indicate the specific subject and then not be able to reuse that content using the include macro. If anything, give us the ability to include based on the link to the page instead of the page title as a workaround. But, in my opinion, if an issue is identified as critical, there should be a SLA of just a few months to resolve - not years! When is this planned to be fixed?

            brian.philpott FUG indicates that fixing this issue so it works for all macros that take confluence-content links as parameters requires a change to the API for macros - a new feature.
            konqi You're right that this broke when we relaxed the restrictions on page titles. It was an unforeseen consequence, and one that it took us a disappointingly long time to notice - if we'd noticed during development of 4.1, we may well have had the required feature in place for macros to use. As it stands, we're well on the way to providing that feature in an upcoming confluence release.

            Richard Atkins added a comment - brian.philpott FUG indicates that fixing this issue so it works for all macros that take confluence-content links as parameters requires a change to the API for macros - a new feature. konqi You're right that this broke when we relaxed the restrictions on page titles. It was an unforeseen consequence, and one that it took us a disappointingly long time to notice - if we'd noticed during development of 4.1, we may well have had the required feature in place for macros to use. As it stands, we're well on the way to providing that feature in an upcoming confluence release.

              vvo Vu Truong Vo (Inactive)
              c34ad611bdfc childnode
              Affected customers:
              27 This affects my team
              Watchers:
              41 Start watching this issue

                Created:
                Updated:
                Resolved: