User tests: Successful: Unsuccessful:
Pull Request resolves #46788.
When a frontend user with article edit permissions opens a modal picker (+Article, Menu, or Module) from the article editor and navigates to a different pagination page, the modal fails with:
"The most recent request was denied because it had an invalid security token. Please refresh the page and try again."
Root cause: The modal templates (com_content, com_menus, com_modules) all guard every request with Session::checkToken('get') when loaded from the frontend. Pagination links are plain <a href> GET requests that bypass form submission, so the CSRF token present in the initial modal URL is never carried forward to subsequent pagination requests.
Fix: In the display() method of each affected view's HtmlView.php, when rendering the modal layout from the frontend (isClient('site')), the CSRF token is added to the pagination object's additional URL params via setAdditionalUrlParam(). This causes the token to be appended to all pagination links (first, previous, numbered pages, next, last) through the existing Pagination::_buildDataObject() mechanism, with no changes required to the Pagination class itself.
Files changed:
administrator/components/com_content/src/View/Articles/HtmlView.phpadministrator/components/com_menus/src/View/Items/HtmlView.phpadministrator/components/com_modules/src/View/Modules/HtmlView.phpadministrator/components/com_contact/src/View/Contacts/HtmlView.php5 (default is 20)Create a test user:
publisher user, Password: write something you will rememberpublisherCreate test data:
publisher user"The most recent request was denied because it had an invalid security token. Please refresh the page and try again."
"The most recent request was denied because it had an invalid security token. Please refresh the page and try again."
The modal goes blank and displays the error:
"The most recent request was denied because it had an invalid security token. Please refresh the page and try again."
The modal correctly loads the next page of items with no error.
Please select:
| Status | New | ⇒ | Pending |
| Category | ⇒ | Administration com_contact com_content com_menus com_modules |