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 creeps in when the Chaos Tools auto submit functionality is enabled
Here is how to replicate:
-- Uncomment ctools_add_js('auto-submit') and '#attributes' => array('style' => 'display: none', 'class' => array('widget-preview-button', 'ctools-use-ajax', 'ctools-auto-submit-click')) in panopoly_magic.module
-- Attempt to add a "Featured Demo Item" from Panopoly Demo
-- Try to use the autocomplete to change the "Featured Demo Item"
Comment | File | Size | Author |
---|---|---|---|
#17 | ctools-1708438-17.patch | 376 bytes | MustangGB |
#6 | 1708438-blur-event.patch | 807 bytes | beeradb |
#5 | 1708438-blur-event.patch | 765 bytes | beeradb |
#3 | 1708438-autosubmit-autocomplete.patch | 1.18 KB | beeradb |
Comments
Comment #1
populist CreditAttribution: populist commentedComment #2
beeradb CreditAttribution: beeradb commentedThis is caused by the auto submit binding to textfields on keypress events rather than change events. There are a couple ways we can fix this.
Comment #3
beeradb CreditAttribution: beeradb commentedThe attached patch looks to resolve this for me. The jquery selectors are a bit funky, but I didn't see a better way to implement it. This should allow auto-submit functionality to work with autocomplete fields.
Comment #4
merlinofchaos CreditAttribution: merlinofchaos commentedThis is the same problem as reported here #1694988: Fix auto-submit for enhanced text text fields but with a different widget in the way.
This fix will work, sort of, but it's a poor band-aid for the real problem, which is that any text field that also has other javascript attached to it is going to have issues with the auto submit. I'm going to mark this one as a duplicate and crosspost.
Comment #5
beeradb CreditAttribution: beeradb commentedThe last patch failed to work on webkit browsers. Moving the event to a blur instead of a change works on webkit. Here's a new patch that should work for firefox / chrome / safar auto complete fields until the larger issue is resolved. IE has not been tested.
Comment #6
beeradb CreditAttribution: beeradb commentedRe-roll against latest 7x-1.x-dev
Comment #7
vasikedefinitely not a duplicate of #1694988: Fix auto-submit for enhanced text text fields.
the issue is still there for text with autocomplete filters.
i tested the last patch (#6) and it seems it does its job.
tested with autocomplete text filter for term reference fields and also for Views Autocomplete Filters.
So re-open for review.
Comment #8
Kristen PolI tested patch in #6 but am getting an error when using the autocomplete now:
Comment #9
k_ankur CreditAttribution: k_ankur commented#6 worked for me. Thanks beeradb.
Comment #11
jphelan CreditAttribution: jphelan commented#6 works for me as well.
Comment #12
DamienMcKennaComment #13
MustangGB CreditAttribution: MustangGB commentedCurrently what happens is typing in the textbox triggers autosubmit, but clicking an option offered by the autocomplete list doesn't trigger it.
After appling the patch typing in the textbox doesn't trigger autosubmit, but clicking an option does.
This resolves one issue, but introduces several others, namely that it will only work with complete names/titles/whatever, partial completes (i.e. operator contains) no longer work, and also that removing any text in the textbox won't trigger the submit until the textbox loses focus. I think both of these are inconsistent with how a user or developer familiar with the Drupal ecosystem would reasonably expect it to work.
Removing the
.filter()
and using only the.blur()
event resolves these.Comment #14
MustangGB CreditAttribution: MustangGB commentedComment #15
DamienMcKennaMoving this to the v7.x-1.10 release plan.
Comment #16
iampumaLatest patch #6 works fine, thanks!
Comment #17
MustangGB CreditAttribution: MustangGB commentedAnd a patch as per comments in #13.
Comment #18
DamienMcKennaThis didn't get added to 7.x-1.10.
Comment #19
Chris Matthews CreditAttribution: Chris Matthews as a volunteer commentedThe 3 year old patch in #17 that addressed the issues presented in #13 applied cleanly to the latest ctools 7.x-1.x-dev, but still needs to be reviewed and tested.
Comment #20
joelpittetClosing for triage but if this is an issue still, please LMK and we can un-close it and dig deeper.
Comment #21
MustangGB CreditAttribution: MustangGB commentedStill an issue since I checked.
Comment #22
joelpittet@MustangGB, thanks for checking! Are you doing the Panopoly Demo or some other way to reproduce?