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.

Comments

sdrycroft’s picture

StatusFileSize
new1.33 KB

Apologies, the original patch wasn't quite right.

rjerome’s picture

Just out of curiosity, which other module triggered this error?

sdrycroft’s picture

StatusFileSize
new1.42 KB

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).

rjerome’s picture

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.

rjerome’s picture

Status: Active » Fixed

I've committed the fix for this in the -dev version.

Ron.

sdrycroft’s picture

Thanks Ron.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

sdrycroft’s picture

Status: Closed (fixed) » Active
StatusFileSize
new922 bytes

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.

rjerome’s picture

Good point, I'll include that in future releases.

liam morland’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

This version is no longer maintained. If this issue is still relevant to the Drupal 7 version, please re-open and provide details.