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
CommentFileSizeAuthor
#3 rules-557906.patch1.58 KBklausi

Comments

gpk’s picture

Same happens on hitting node Save.

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

fago’s picture

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.

klausi’s picture

Status: Active » Needs review
StatusFileSize
new1.58 KB

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

fago’s picture

Status: Needs review » Reviewed & tested by the community

Yep, that looks fine!

klausi’s picture

Status: Reviewed & tested by the community » Fixed

and committed.

Status: Fixed » Closed (fixed)

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

Rosamunda’s picture

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

gpk’s picture

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.

Rosamunda’s picture

Thanks!

nodecode’s picture

Status: Closed (fixed) » Needs review

I upgraded to the latest 6.x dev version (2009-Dec-11) as per the advice in this thread to take care of the caching issue.

Now when i disable a form element, there's no error, but it completely erases the contents of the disabled field after i click 'Save'. There was the caching issue with the 6.x-1.1 version but this is a much worse problem.

Can anybody else replicate this? I can provide more details if needed.

Status: Needs review » Needs work

The last submitted patch, rules-557906.patch, failed testing.

klausi’s picture

Status: Needs work » Closed (fixed)

@nodecode: yep, I can confirm that, but this is a separate issue: #733558: Remove Action "Disable form element" because it erases field values