Posted by sdrycroft on May 11, 2009 at 12:36pm
| Project: | Bibliography Module |
| Version: | 6.x-1.4 |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
Using $form_state['storage'] to store the biblio_type ID results in a "White screen" error with other modules that are expecting $form_state to be an array. The supplied patch fixes this.
| Attachment | Size |
|---|---|
| biblio.module.patch | 1.31 KB |
Comments
#1
Apologies, the original patch wasn't quite right.
#2
Just out of curiosity, which other module triggered this error?
#3
Previous patch resulted in the user being returned to the node edit form once a new biblio node was submitted. The included patch should fix this issue.
EDIT: It was the BATax module (one I wrote myself).
#4
Hi Simon,
Perhaps a cleaner approach, and what I'll probably do, is create a $form_state['storage']['biblio'] array, with elements called "type", "paste" and "doi".
It's certainly not obvious from the documentation (what little there is) that $form_state['storage'] must be an array, but I guess it's not surprising.
Ron.
#5
I've committed the fix for this in the -dev version.
Ron.
#6
Thanks Ron.
#7
Automatically closed -- issue fixed for 2 weeks with no activity.
#8
Sorry Ron, I'll have to reopen this issue - I guess I didn't properly follow up on this when I first opened it.
I'm afraid the unsetting of all $form_state['storage'] values on line 1454 is breaking any other module that relies on the $form_state['storage'] array during their submit function. You should only unset values that you have (or could have) set.
The included patch fixes this.
[EDIT]
And yes, what you say in #4 is almost definitely a good idea.
#9
Good point, I'll include that in future releases.