Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The problem is this line:
$('form table:has(th.select-all)', context).once('table-select', Drupal.tableSelect);
When the table is updated with #ajax, context is form and therefore, it doesn't find the table anymore.
Removing the form part fixes this.
Comment | File | Size | Author |
---|---|---|---|
fix_tableselect_with_ajax.patch | 411 bytes | Berdir | |
Comments
Comment #1
BerdirOh, this is btw. another bug discovered by Privatemsg: #1021328: Using AJAX Actions breaks sorting of messages :)
Comment #2
rfaysubscribe
Comment #3
sunThanks!
To clarify:
When adding #ajax on a table or an element in a table, then the
context
that the AJAX framework creates is theform
DOM element itself. Therefore, the selectorcannot match the table, because
form == context
, soform
cannot be found within context.Comment #4
BenK CreditAttribution: BenK commentedSince I was involved in reporting the original Privatemsg issue, I thought I'd chime in. The patch totally solves the problem for me. So I agree this is RTBC.
--Ben
Comment #5
dawehnerComment #6
Dries CreditAttribution: Dries commentedCommitted to 8.x and 7.x. Thanks.
Comment #7
bfroehle CreditAttribution: bfroehle commentedUntagging since it's been committed to 7.x