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.
This is really a weird bug. It has 3 conditions and 1 event.
Conditions:
1) Search module is enabled
2) Poll module is enabled
3) Title must be missing or at most one choice must be entered on Create Poll form. (form must be invalidated)
Event:
1) Preview the poll
One invalidated form will be displayed right aligned in the header region and the other one will be displayed in the content area.
I looked into the codes of search.module and poll.module but couldn't find the reason.
My server configuration is:
IIS on WinXP, PHP 5, MySQL 5
Comment | File | Size | Author |
---|---|---|---|
#4 | 84111_form.inc_r1.150 | 790 bytes | AjK |
Comments
Comment #1
TheoRichel CreditAttribution: TheoRichel commentedI have the same problem on an Apache server, PHP 4, Mysql 3.2x
Comment #2
AjK CreditAttribution: AjK commentedWhacky bug this one.
If you also enable the search field in the theme header you get even more spectacular results! (3 poll forms, one "blows away" the header section)
It seems that when the search module is filling content areas it's getting back from the forms API the poll.modules error form instead. Investigating now
Comment #3
AjK CreditAttribution: AjK commentedMore info....
Actually, when a poll form submission fails at the required Question field being empty, any call to drupal_get_form() will return the poll's error form.
I can reproduce this by creating a block. Use the PHP input filter, create some like the following:
Then enable the block somewhere on your site. The contents of $temp, when examined, is the poll's complete error form.
So this error isn't unique to the search.module, it'll happen to anything that calls drupal_get_form() when the poll form has failed validation. It shows up most on search.module just because it attempts to render a form in a block or in a theme's header which is common on alot of sites.
Comment #4
AjK CreditAttribution: AjK commentedThanks to Eaton's help on IRC we have a patch. Raising this to critical as #multistep forms are broken in HEAD
Comment #5
AjK CreditAttribution: AjK commentedCould do with a better name for this issue now we know what it is
Comment #6
AjK CreditAttribution: AjK commentedComment #7
eaton CreditAttribution: eaton commentedTested this on my box. The problem is easy to reproduce and easy to spot in the code when you know what you're looking for. Simple fix and absolutely essential.
Comment #8
drummCommitted to HEAD.
Comment #9
(not verified) CreditAttribution: commented