Reviewed & tested by the community
Project:
Chaos Tool Suite (ctools)
Version:
4.1.x-dev
Component:
CTools Views
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
14 Jan 2025 at 22:11 UTC
Updated:
7 Apr 2026 at 20:53 UTC
Jump to comment: Most recent
Comments
Comment #3
apkwilson commentedI pushed a commit with just tests, but the pipeline didn't finish running them (it would have failed) before the commit fixing the tested behavior went up and canceled the pipeline.
Comment #4
benstallings commentedI ran this past Claude Code, which said,
The bug: When a Views exposed filter has a custom identifier (different from the filter's machine name/ID), the ctools_views block configuration form was using the filter ID ($id) to access form elements instead of the configured identifier. This means if someone set their taxonomy filter's identifier to something other than the default, the block config form would break — it'd look for form elements under the wrong key.
The fix (2 commits):
1. 8db730ce — Test update: Changes the test view config so the taxonomy exposed filter uses tags_filter_alternate_identifier instead of field_ctools_views_tags_target_id as its identifier, and updates the functional test assertions to use this non-default identifier. This properly reproduces the bug scenario.
2. ecdc6652 — Code fix in Block.php:
- Moves the $identifier = $handler->options['expose']['identifier'] assignment to where it's actually needed (inside the else block at line 297, after buildExposedForm())
- Replaces three instances of $id with $identifier when accessing form elements (lines 300, 303, 311)
- Removes the now-unnecessary earlier assignment at line 284
Assessment: Clean, correct fix.
- The root cause is clear: $id is the filter's internal ID while $identifier is what the user configured for the exposed form — these can differ.
- The test change is smart — by making the test view use a non-default identifier, it catches exactly this class of bug going forward.
- The $identifier variable is moved to a tighter scope where it's actually used, which is a minor improvement.
- The fix is minimal and focused — only touches the affected lines.
One nit: The typo "thir" on line 310 (// thir defaults manually.) predates this branch, so not a concern here.
Verdict: This looks good to merge. The bug is real, the fix is correct and minimal, and the test coverage properly validates the scenario.