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.

Comments

klausi’s picture

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?

klausi’s picture

Status: Active » Needs review
StatusFileSize
new653 bytes

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

gpk’s picture

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!

nodestroy’s picture

Status: Needs review » Reviewed & tested by the community

looks fine

klausi’s picture

Status: Reviewed & tested by the community » Fixed

and committed.

fago’s picture

Status: Fixed » Needs work

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

fago’s picture

Status: Needs work » Closed (fixed)

If not, it doesn't matter any more ;)

gpk’s picture

Status: Closed (fixed) » Needs work

Umm I think the _update() still needs fixing, or am I missing something here???

YK85’s picture

subscribing

gpk’s picture

Status: Needs work » Needs review
StatusFileSize
new473 bytes

Here's a patch which provides an update routine to set the weight to 20.

Status: Needs review » Needs work

The last submitted patch, rules_forms_weight.patch, failed testing.

gpk’s picture

Status: Needs work » Needs review
StatusFileSize
new485 bytes

Ah, looks like patch maybe needs to be run from the root folder of the rules project?

klausi’s picture

Status: Needs review » Fixed

Committed to CVS, thanks.

Status: Fixed » Closed (fixed)

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

gpk’s picture

Thanks klausi!

manObject’s picture

Title: Some form elements are not available to rules_forms » The presence or absence of text in a form element is inaccessible for Rules true/false testing purposes
Version: 6.x-1.x-dev » 6.x-1.4
Category: bug » support

I have discovered an anomaly in version 6.x-1.4 that was not present in previous versions. This is that an empty CCK text field entity (such as a signature field's text entity) no longer equates to FALSE for user content. It is as if the form element's enclosing HTML is included in the has-content test, instead of just the value of the text entity it contains. Therefore the Rules test "Does the field contain text?" always equates to TRUE, even if there is no content text whatsoever in the entity. This is regardless of whether the Rule is constructed around "Content is to be saved" or "After saving new content" or "After existing content has been updated". Especially where the test is being carried out on a submitted form's variables, why should enclosing HTML be involved?
Is there some way of getting Rules/CCK to look within such form elements to the actual variable that is passed on form submission?
The patch (posted by gpk) to increase the weight of the 'rules_forms' field in the 'system' table of the database to 20 had already been applied and did not fix the problem.