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.
Reviewed: https:/ /review. opendev. org/753285 /git.openstack. org/cgit/ openstack/ openstackdocsth eme/commit/ ?id=8e6b9c52446 0edf1c3127fb186 1acd13b17455c3
Committed: https:/
Submitter: Zuul
Branch: master
commit 8e6b9c524460edf 1c3127fb1861acd 13b17455c3
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 bug_project' pdf_link' config options must be set. If these are not
configuration in 'conf.py': specifically, the 'openstack_
and 'openstack_
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 localhost: 8000/search. html?q= usage:395
<anonymous> http://
Simply surround these blocks with the same conditionals as the template,
avoiding the issue entirely.
Change-Id: I08ef0fc6c7ebd2 c0e7ba89bc42cc9 2176fec8ab8
Signed-off-by: Stephen Finucane <email address hidden>
Closes-Bug: #1896607