[Bug 38948] New: Modal error on some pages: Can't access property "backdrop"
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38948 Bug ID: 38948 Summary: Modal error on some pages: Can't access property "backdrop" Change sponsored?: --- Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: Templates Assignee: oleonard@myacpl.org Reporter: oleonard@myacpl.org QA Contact: testopia@bugs.koha-community.org Depends on: 35402 I know I've seen this in more than one place, but I've just confirmed that it appears in the console on the item add/edit page: Uncaught TypeError: can't access property "backdrop", this._config is undefined _initializeBackDrop http://127.0.0.1:8081/intranet-tmpl/lib/bootstrap/bootstrap.bundle.min_24.12... On http://127.0.0.1:8081/intranet-tmpl/lib/bootstrap/bootstrap.bundle.min_24.12... <anonymous> http://127.0.0.1:8081/intranet-tmpl/prog/js/cookieconsent_24.1200003.js:20 <anonymous> http://127.0.0.1:8081/intranet-tmpl/prog/js/cookieconsent_24.1200003.js:197 bootstrap.bundle.min_24.1200003.js:6:52582 I think it's new since the Bootstrap 5 upgrade. Some web searches turn up information like "The problem is that the Modal has not been loaded into the DOM at this stage and therefore is undefined when the getElementById action is performed. The solution was to wait until the DOM is loaded." This would make sense considering the add/edit item page is one of those pages where the JS is loaded at the top of the page rather than the bottom. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35402 [Bug 35402] Update the OPAC and staff interface to Bootstrap 5 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38948 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@gmail.com --- Comment #1 from Jonathan Druart <jonathan.druart@gmail.com> --- Using Firefox, I am seeing: Loading failed for the <script> with source “http://localhost:8081/intranet-tmpl/prog/js/cookieconsent_24.1200008.js”. Trying to recreate the problem I've only turned on CookieConsent and hit http://localhost:8081/cgi-bin/koha/cataloguing/additem.pl?biblionumber=1 Not sure if it's the same problem we are seeing? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38948 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38948 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff Patch complexity|--- |Trivial patch Comma delimited| |Athens County Public list of Sponsors| |Libraries Sponsorship status|--- |Sponsored -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38948 --- Comment #2 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 206074 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206074&action=edit Bug 38948: Modal error on some pages: Can't access property "backdrop" This patch adds some checks to cookieconsent.js to avoid errors in the console: If we try to access 'document.getElementById("cookieConsentModal")' when the element doesn't exist there will be an error: 'Uncaught TypeError: can't access property "backdrop", this._config is undefined' The error can be seen in the browser console on the Circulation home page and the Tools home page when the CookieConsent preference is enabled. To test apply the patch and clear your browser cache if necessary. - Enable the CoookieConsent system preference. - Go to the Circulation home page. There should be no error in the console. - Clear your browser's local storage to forget your consent. - Go to the staff client home page. The cookie consent message should appear. Sponsored-by: Athens County Public Libraries -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38948 Laura Escamilla <Laura.escamilla@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38948 Laura Escamilla <Laura.escamilla@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #206074|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38948 --- Comment #3 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- Created attachment 206278 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206278&action=edit Bug 38948: Modal error on some pages: Can't access property "backdrop" This patch adds some checks to cookieconsent.js to avoid errors in the console: If we try to access 'document.getElementById("cookieConsentModal")' when the element doesn't exist there will be an error: 'Uncaught TypeError: can't access property "backdrop", this._config is undefined' The error can be seen in the browser console on the Circulation home page and the Tools home page when the CookieConsent preference is enabled. To test apply the patch and clear your browser cache if necessary. - Enable the CoookieConsent system preference. - Go to the Circulation home page. There should be no error in the console. - Clear your browser's local storage to forget your consent. - Go to the staff client home page. The cookie consent message should appear. Sponsored-by: Athens County Public Libraries Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org