You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you use the Dashboard's "Manage taxonomies" block, the dropbutton JS library is loaded even if that block is not rendered. This can happen if the user has no privileges to administer/edit/etc taxonomy terms or vocabularies. While loading the JS dropbutton library when there are no dropbuttons on the page may seem harmless, it actually creates problems with code introduced in #6180, which has a bug I'll report separately.
Steps To Reproduce
To reproduce this, we'll force an error that happens because of the combination of this bug, and another introduced by #6180. I will report that second bug in a separate issue.
To reproduce the behavior:
Be sure you have vanilla, clean install of Backdrop 1.26.1
Create an Editor user
Remove all taxonomy privileges from the Editor role
Log in as Editor, head to the Dashboard, and inspect the browser dev console
You should see jQuery.Deferred exception: Cannot read properties of undefined (reading 'split') TypeError: Cannot read properties of undefined (reading 'split')
The admin bar stops working, since JS crashed
Actual behavior
The dropbutton JS library is still loaded, despite the fact that the Manage taxonomies block is not rendered. The second bug I mentioned above is triggered. Because JS crashes, the admin bar stops working.
Expected behavior
Backdrop should not load unnecessary libraries - in this case, since the Manage taxonomies block is not rendered, the dropbutton library should not be loaded.
Additional information
Backdrop CMS version: 1.26.1
PHP version: 8.1
Browser(s) and their versions: Chrome, latest. Firefox, lates.
The text was updated successfully, but these errors were encountered:
Description of the bug
When you use the Dashboard's "Manage taxonomies" block, the dropbutton JS library is loaded even if that block is not rendered. This can happen if the user has no privileges to administer/edit/etc taxonomy terms or vocabularies. While loading the JS dropbutton library when there are no dropbuttons on the page may seem harmless, it actually creates problems with code introduced in #6180, which has a bug I'll report separately.
Steps To Reproduce
To reproduce this, we'll force an error that happens because of the combination of this bug, and another introduced by #6180. I will report that second bug in a separate issue.
To reproduce the behavior:
jQuery.Deferred exception: Cannot read properties of undefined (reading 'split') TypeError: Cannot read properties of undefined (reading 'split')
Actual behavior
The dropbutton JS library is still loaded, despite the fact that the Manage taxonomies block is not rendered. The second bug I mentioned above is triggered. Because JS crashes, the admin bar stops working.
Expected behavior
Backdrop should not load unnecessary libraries - in this case, since the Manage taxonomies block is not rendered, the dropbutton library should not be loaded.
Additional information
The text was updated successfully, but these errors were encountered: