After installing and activating rules forms support these errors rise on modules list page and in a workflow rule config page:
Notice: Trying to get property of non-object in user_access() (line 774 of /data/drupal/data/test/modules/user/user.module).
Notice: Trying to get property of non-object in user_access() (line 786 of /data/drupal/data/test/modules/user/user.module).
Notice: Trying to get property of non-object in user_access() (line 787 of /data/drupal/data/test/modules/user/user.module).
Notice: Trying to get property of non-object in user_access() (line 793 of /data/drupal/data/test/modules/user/user.module).
Notice: Trying to get property of non-object in user_access() (line 796 of /data/drupal/data/test/modules/user/user.module).
No events nor actions for forms is appearing in rules options.
Tried to find what is a bug and found that function user_access receives as an argument $account this string: "administer rules forms". As an argument $string - "administer rules". Cant figure what does that mean :(
Drupal 7.2
Rules 7.x-2.0-beta2
Rules Forms 7.x-1.0-beta1 to 7.x-1.0-beta4
Comments
Comment #1
thekevinday commentedSubscribe.
I can confirm this problem.
Comment #2
seren10pity commentedSubscribe.
Same problem occurs when I add an action to a new rule.
Comment #3
jordojuice commentedHmm... This is very urgent. I'm checking it out right now.
Comment #4
jordojuice commentedI was able to reproduce this and found the source. Fixed and committed to HEAD, along with another minor bug fix. Please try it out and reopen this issue if the errors have not gone away! I am creating another release for this bug fix so it will be in beta5.
Comment #5
jordojuice commented> No events nor actions for forms is appearing in rules options.
Please verify this too! I have been able to test this port fairly extensively with access to all events, conditions, and actions. Im not sure if you used the original Rulee Forme Support that shipped eith Rules 1, but be sure to enable a form to get access to it's events as well. Either way, maybe I should provide a link to the Rules Forms configuration on installation to ensure that administrators enable event activation messages on forms.
Comment #6
deaDleSs balLoon commentedYes! I installed beta 5. It now shows a tab where i can enable form events (it wasn't there, i turned back beta 4 to verify it). You're right i didn't use rules 1.0 and rules forms earlier. So now i enabled events on add article form.
I tested an event "form is being built".
I can set a condition "form element has value". I tested on a body[und][0][value] (like devel module shows me) and it doesn't work. On a title element it's ok.
Tried to add an action:
Create a new form element - ok
Insert HTML prefix/suffix code - ok
Load a form element - doesn't give any error. element_fetched is available as a choice in a data selector. To be honest i can't figure what this action does :( i have a new variable to use now? or i need to load|create each element before i can do something with it?
Set element access attributes
Set element text attributes - are not ok
If i add an element id as it is shown in the form, eg title, it rises this error:
The integrity check failed with the following error message: "action text: Missing configuration for parameter element."
The only choices in a dropdown are element_created or element_fetched. If select one of them, no errors on rule save but then i see these errors on a form load:
Warning: Invalid argument supplied for foreach() in rules_forms_action_set_access() (line 126 of /data/drupal/data/test/sites/all/modules/rules_forms/rules_forms.eval.inc).
Warning: Invalid argument supplied for foreach() in rules_forms_action_set_text() (line 111 of /data/drupal/data/test/sites/all/modules/rules_forms/rules_forms.eval.inc).
And actions are not done.
Set the redirect target of the form - no errors, but seems to not redirecting, or i miss something again.
Set the default value of a form element - adds these two errors:
Notice: Undefined index: #parents in rules_forms_action_set_error() (line 75 of /data/drupal/data/test/sites/all/modules/rules_forms/rules_forms.eval.inc).
Warning: implode() [function.implode]: Invalid arguments passed in rules_forms_action_set_error() (line 75 of /data/drupal/data/test/sites/all/modules/rules_forms/rules_forms.eval.inc).
Need to say that all above actions was added one by one and then i checked what's happening.
Hope this will help you in some way.
Comment #7
jordojuice commentedNo this is great information! I appreciate it a lot. I'm going to check these things out and get back to you.
I'm addressing each issue right now and have a long list of minor fixes. I'd be interested in your results once it is released! This help will move us closer to a stable release and I'll gladly credit you with this work on the project page and in commits.
Comment #8
jordojuice commentedIndeed, I believe that you couldn't see the Rules Forms administrative area before the update. The menu items were where that bug was. Anyways, this is a thorough review of the items you tested. I'm testing them for myself.
Redirect:
Redirect is working perfectly for me. It works on validate and submit actions, but may not be able to be set when the form is being built. I'm interested in where this didn't work for you and what caused it, because this will need to be looked into more. What form was it on and what event?
As for getting errors like "action default: Missing configuration for parameter element." this is probably because Rules Forms Support was changed to require the user to load a form element before accessing it with the data selector. This is the error I get when trying to enter an element ID rather than using the data selector to select a loaded or created element. This means that the element ID that appears on enabled forms should only be used to load a form element, and thereafter the data selector should be used to select element_created or element_fetched. I will be adding a form alter function in the future to change the selector type for certain actions to prevent the entry of an element ID in the selector as I realize this can be confusing.
I've gone through many of your issues and resolved several of them.
Element weight:
Worked properly for me.
Load element:
Worked properly from me. I loaded the element and set the weight, referring to it with the data selector.
Create a form element:
Successful. I created a textfield with a custom name and custom text. Now to try to alter that text, which was one of the bugs you found.
Set text attributes of a form element:
Selecting the new form element I created, I got the error you mentioned! This was a problem with a function return value. Thanks a ton for locating this. Each of the 'foreach' errors should be fixed now and will be released in the next beta version.
Set element access attributes:
Got several errors. This was an inaccurate variable name that I missed changing. This is fixed and will be committed to HEAD.
Each of these issues I mentioned were fixed and committed, but I'm continuing to go through the list. I'll be releasing another version once they're fixed, though, so I look forward to seeing the results. I'll let you know when that happens. At the moment, though, this has been huge progress and I appreciate it.
It looks like I just missed the set default value action? Or is there something else?
Comment #9
jordojuice commentedAlright, address the set default value issue. Indeed, I got errors. It was calling the wrong function. Also retested the set error action. This works properly as well. I'm committing these changes with updated documentation and creating a new release. I look forward to any more feedback you have! Thanks a ton.
Comment #10
deaDleSs balLoon commentedBeta6 looks working perfect! Thank you for your excellent debugging speed! And for your module which is very useful.
Will test more.
Comment #11
jordojuice commentedThat is wonderful : ) thanks for the help. It seems awefully stable to me now as well.