Uploaded image for project: 'Numbered Content Application'
  1. Numbered Content Application
  2. NCAPP-65

Prevent a browser console error when exporting to pdf

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 1.8
    • 1.0
    • Headings
    • None
    • Unknown
    • N/A
    • N/A

    Description

      A JavaScript exception isĀ  logged during export to pdf: document.getElementById(...) is null thrown by:

      const numberedHeadingsConfig = JSON.parse(document.getElementById('numbered-headings-config').textContent);
      

      The configuration element is injected using the org.xwiki.platform.template.header.after UIX that is not executed when exporting to PDF because the XWiki header bar (logo, search, user avatar, drawer) is not included in PDF export. The numbered headings application could use instead the org.xwiki.platform.html.head UIX which is executed when exporting to PDF. Now, if the configuration not mandatory then the code should be bulletproofed to prevent such an error.

      Attachments

        Activity

          People

            mleduc Manuel Leduc
            mleduc Manuel Leduc
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: