Pager, tablesort links in a form corrupt when reloaded via AJAX (e.g., via exposed filter))

Created on 7 June 2011, over 13 years ago
Updated 24 January 2025, 12 days ago

Problem/Motivation

I have a form in which some select elements are ajax elements that trigger a full reload of the form. When I look at the reloaded form, all the links on the form, e.g., for the pager and tablesort as well, are rewritten so they point to system/ajax, which breaks functionality.

Steps to reproduce

1. Create a form which contains both:
- a selection box [EDIT 'Exposed filter'? ] which is ajaxified and which will reload the entire form on change. (the callback function just returns the form)
- a table which uses tablesort and/or pager. (tablesort will allways create links, so that might be the easiest)
2. Load the page with the form and look at the links produced for tablesort, they are correct
3. Use the selection box to let the form dynamically be reloaded, the links point to the path system/ajax, which is incorrect.

Proposed resolution

This issue is because in tablesort.inc the links in the table are created based on the q parameter. This is in basis a good assumption, however, in this specific case it throws errors.
And honestly, i have no idea of a decent workaround, except maybe by allowing an option to be passed to tablesort to give the path.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Active

Version

11.0 🔥

Component

ajax system

Created by

🇧🇪Belgium daften

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024