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.
Updated: Comment #N
Problem/Motivation
When placing two signup forms, e.g. a rendered entity reference field and a block, only the first form can be submitted as they have the same form id.
Proposed resolution
Implement hook_forms() to have dynamic form ID's.
Remaining tasks
User interface changes
API changes
Comment | File | Size | Author |
---|---|---|---|
#5 | salsa_entity_use_hook_forms_to-2193829-4.diff | 2.36 KB | LukyLuke_ch |
#1 | salsa-signup-page-forms-2193829-1.patch | 1.31 KB | Berdir |
Comments
Comment #1
BerdirAnd here is an untested patch.
Comment #2
BerdirComment #3
miro_dietikerFunctionality wise fully fine. But please add a comment why this hook_forms was required. I know it almost is be self-explaining. And please answer the question if there are other form types that have the same problem.
Salsa offers the possibility to show forms through a block. This combination could result on virtually all salsa forms to have multiple instances on the same page due to accidental confiuration. Although not really recommended, things should not break in this case.
And since it was such a funny bug, i guess we should add a specific test?
Comment #4
LukyLuke_ch CreditAttribution: LukyLuke_ch commentedThere is also a small change needed in the salsa_signup_page_mollom_form_info() (salsa_signup_page.module) hook:
Additionally, to populate and being able to configure the pages differently, this can be also added in salsa_signup_page_mollom_form_list() (salsa_signup_page.module)
Comment #5
LukyLuke_ch CreditAttribution: LukyLuke_ch commentedHere a complete patch for the above.
See also https://drupal.org/comment/8479019#comment-8479019 for the appropriate mollom patch which is needed here to make this properly working with mollom.
Comment #6
miro_dietikerAs long as this is not in at Mollom, we would kill existing sites using mollom (required reconfiguration).
Let's wait till this is in - and then commit.
For now this remains a patch for the specific project that hits this case.