Some form elements are not available to rules_forms

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

This is because the form elements are added to the form by modules which execute hook_form_alter() after rules_forms does. For example, the pathauto "automatic alias" checkbox and the OG access "public" checkbox. Both these modules have a weight of 1. Manually increasing the weight of rules_forms to 1 in the {system} table does the trick for these specific form elements.

#1

klausi - August 29, 2009 - 00:16

Setting the module weight could be done easily in an install file ... the question is: what would be a good and sane value? We want to be the last called hook_form_alter(), so what should we set the weight to? 1, 10, 100 or 1000? Suggestions?

#2

klausi - September 1, 2009 - 22:41
Status:active» needs review

Patch: this one adds an installation file and sets the module weight to 20 (same weight rules.module is set to).

AttachmentSize
rules-557892.patch 653 bytes

#3

gpk - September 2, 2009 - 08:50

Seems reasonable. On a site I have with 70 active modules there are a few with weight 1, then CCK fieldgroup with weight 9, Views and Token with weight 10, Rules with weight 20 and Devel with weight 88.

Thanks!

#4

nodestroy - September 2, 2009 - 20:16
Status:needs review» reviewed & tested by the community

looks fine

#5

klausi - September 3, 2009 - 11:26
Status:reviewed & tested by the community» fixed

and committed.

#6

fago - September 10, 2009 - 11:10
Status:fixed» needs work

Have you also added an _update() for existing installations? Else they won't ever get the new weight.

 
 

Drupal is a registered trademark of Dries Buytaert.