"Disable form element" rule causes PHP fatal error on node preview

gpk - August 24, 2009 - 12:39
Project:Rules
Version:6.x-1.x-dev
Component:Forms Support
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

Activate rules_forms on a node form, add an action to disable a form element, then create/edit a node of the relevant type and hit Preview:

Fatal error: Call to undefined function rules_forms_element_action_after_build() in /home/username/public_html/drupal-folder/includes/form.inc on line 925

#1

gpk - August 24, 2009 - 12:43

Same happens on hitting node Save.

Am using 6.x-1.x-dev of 2009-Aug-20.

#2

fago - August 25, 2009 - 16:17

Oh, looks like a caching issue. Once there are #ahah elements in the form it gets cached, so in the main after_build stuff has to be included before moving on.

#3

klausi - September 1, 2009 - 20:06
Status:active» needs review

And here comes a patch:
I added a further after build handler that lives in the module file and does the necessary including.

AttachmentSize
rules-557906.patch 1.58 KB

#4

fago - September 1, 2009 - 20:08
Status:needs review» reviewed & tested by the community

Yep, that looks fine!

#5

klausi - September 1, 2009 - 20:35
Status:reviewed & tested by the community» fixed

and committed.

#6

System Message - September 15, 2009 - 20:40
Status:fixed» closed

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

#7

Rosamunda - October 15, 2009 - 04:16

I´m sorry, I need to use this feature on a live site. Is it safe to use the dev version?
Because that error appeared to me too.

Sorry for thie naive question :)

Rosamunda

#8

gpk - October 15, 2009 - 07:30

Probably... there don't seem to have been that many "drastic" commits since 6.x-1.1 (http://drupal.org/project/cvs/190124) that will have potentially broken stuff so you should be OK. Try it on a test site first.

Or apply the patch at #3 to your existing version pending the next release.

#9

Rosamunda - October 15, 2009 - 11:44

Thanks!

 
 

Drupal is a registered trademark of Dries Buytaert.