User tests: Successful: Unsuccessful:
Pull Request for Issue #45770 (part of the series described in #48738).
With the Nonce option of the System - HTTP Headers plugin enabled, browsers ignore 'unsafe-inline' and block inline event handlers. This PR removes the ones left in toolbar and workflow buttons on core administrator screens. It follows #48737 (list views) and the pattern of #45910 and #48523. Each change uses a hook that core already has where possible:
layouts/joomla/button/transition-button.php): #39730 added the js-grid-button-transition-action and js-grid-item-transition-action handlers to list-view, but the layout never used them. It now does, with data-item-id and data-item-task, and loads list-view itself like action-button.php.articles.runTransition task and listCheck, like the Publish items next to them. Each one has a data-transition-id. admin-items-workflow-buttons.js copies that id into transition_id before joomla-toolbar-button submits the form, using a capture-phase listener.reference and target tasks, which the existing Joomla.submitbutton override of sidebyside.js handles. The Clear button is handled in sidebyside.js.debug.js binds to Joomla.debugIndexing().com_users.two-factor-edit, binds so that it clicks the form's own save button, as two-factor-focus.js already does on the captive page. The WebAuthn handler on that button still runs.For b/c:
layouts/joomla/toolbar/basic.php and standard.php still render onclick for extensions that pass one. Only the core callers changed.transition-button.php or cancelselect.php keeps working as before, still with its inline handler.The next PRs in #48738 cover the administrator modals and the component views.
This PR changes JavaScript (com_workflow, com_associations, com_finder, com_users), so use the prebuilt package or run npm ci after applying it.
script-src, Value 'self', Client Both. Save.With the CSP enabled, none of these buttons does anything. The stage button does not open the transition select, Run Transition does not run, New and Cancel stay on the page, Index sends no request, Save & Close does not submit, and Save Reference and Clear do nothing. The browser console reports a Content Security Policy violation for each inline event handler.
With the CSP enabled:
2. The transition select opens, and choosing Unpublish runs the transition ("New state saved.").
3. The selected article is archived.
4. New opens Select a Module Type. Cancel goes back to the modules list.
5. The indexer output shows the result for that item.
6. The form is submitted. With a wrong code, the page reloads with "You did not enter a valid verification code".
7. Save Reference saves the reference item, and Clear removes the association.
None of these report a Content Security Policy violation. The header "Check All Items" checkbox still reports one until #48737 is merged.
With the CSP disabled, everything works as before.
Please select:
Documentation link for guide.joomla.org:
No documentation changes for guide.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
| Status | New | ⇒ | Pending |
| Category | ⇒ | Administration com_associations com_content com_finder com_modules com_users Layout JavaScript NPM Change |