Missing configuration causes JS issues

Bug #1896607 reported by Stephen Finucane
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
openstackdocstheme
Fix Released
Low
Stephen Finucane

Bug Description

There's a number of configuration options required to enable certain functionality, such as 'openstack_bug_project' and 'openstack_pdf_link', which enable a bug reporting link and PDF download link, respectively. If these are undefined, we see errors in our console such as the following:

  Uncaught ReferenceError: bugProject is not defined
    <anonymous> http://localhost:8000/search.html?q=usage:395

Changed in openstack-doc-tools:
status: New → Confirmed
importance: Undecided → Low
tags: added: openstackdocstheme
summary: - Missing configuration causes failure to build, JS issues
+ Missing configuration causes JS issues
Changed in openstack-doc-tools:
assignee: nobody → Stephen Finucane (stephenfinucane)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstackdocstheme (master)

Reviewed: https://review.opendev.org/753285
Committed: https://git.openstack.org/cgit/openstack/openstackdocstheme/commit/?id=8e6b9c524460edf1c3127fb1861acd13b17455c3
Submitter: Zuul
Branch: master

commit 8e6b9c524460edf1c3127fb1861acd13b17455c3
Author: Stephen Finucane <email address hidden>
Date: Tue Sep 22 11:32:23 2020 +0100

    js: Don't attempt to set bug, PDF links without configuration

    Generating both the bug link and PDF download link requires some
    configuration in 'conf.py': specifically, the 'openstack_bug_project'
    and 'openstack_pdf_link' config options must be set. If these are not
    present, the template doesn't include the relevant tags, which means
    attempts to look these up via 'getElementById' will return 'null',
    causing ugly tracebacks like so in the console.

      Uncaught ReferenceError: bugProject is not defined
        <anonymous> http://localhost:8000/search.html?q=usage:395

    Simply surround these blocks with the same conditionals as the template,
    avoiding the issue entirely.

    Change-Id: I08ef0fc6c7ebd2c0e7ba89bc42cc92176fec8ab8
    Signed-off-by: Stephen Finucane <email address hidden>
    Closes-Bug: #1896607

Changed in openstack-doc-tools:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.