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.
While working with the beta2 version today, we noticed that there was a conflict with the AJAX filter form submit in the Views module.
I noticed that you wrote that :
The 6.x-1.x release adds configurations that can overcome such conflicts by excluding forms or buttons from the script.
Is this a feature that can be added to the full 7.x-2.x release?
Thanks!
Comment | File | Size | Author |
---|---|---|---|
#7 | hide_submit-1899240-7.diff | 760 bytes | vincentdemers |
#6 | hide_submit-exclude-classes-1899240-6-D7.patch | 1.22 KB | vladan.me |
Comments
Comment #1
gregglesThe README.txt and hide_submit.api.php describe how you can achieve this with a little bit of code. I think a sub-module that provides this feature would be great if you want to work on it. I purposefully don't plan to add this feature to the base 7.x-2.x module.
If you look at the size of the codebase you see:
6.x-1.x: 729 lines of code across php, js, css - 22% comments.
7.x-1.x: (with bugs that need to be fixed -i.e. may grow.) 730 lines of code - 21% comments
7.x-2.x: 150 lines of code - 34% comments.
The 7.x-2.x branch is alterable in code but purposefully doesn't have a ton of features in the interface. First, I think most people don't need those features and they are just confusing in the admin area. Second, it's easier to maintain a module if it does fewer things.
So...please take a read in the api and let me know if you have any questions as you write the code by re-opening the issue. If you can write a sub-module to do this that is generalized and you want to contribute as a tarball that would be great - please re-open this issue and change it back to a feature request.
Comment #3
mstef CreditAttribution: mstef commentedCorrect me if I'm wrong please, but I only see 1 hook: hook_hide_submit_alter(). Yes that allows us to disable it on a given page, but how about for a given form (like this issue says)? I don't see that being possible with this hook. Is there something I'm missing?
Comment #4
gregglesYeah, I think you're right that it's possible to disable/enable it for a specific path but it's not possible to disable/enable for a specific form.
That seems like a very reasonable idea so I'm updating the title and metadata of this issue to reflect that. I don't personally need it so I won't be working on it, but I'd be happy to review a patch.
Comment #5
gregglesThis was much more difficult to accomplish before #1941592: Get rid of hook_init to improve performance but it should now be more straightforward to pass along the form_id to the settings and update the javascript to be more specific to certain form-id values.
Comment #6
vladan.me CreditAttribution: vladan.me as a volunteer commentedI'm just wondering if this is the right approach? It seems to solve my very specific usage, but likely is not a general solution to this issue.
Comment #7
vincentdemers CreditAttribution: vincentdemers as a volunteer commentedThe previous patch did not work for me.
This new patch allows to set a class on the $form element to disable hide_submit entirely in the form API.
Ex