Closed (cannot reproduce)
Project:
Rules
Version:
7.x-2.x-dev
Component:
Rules Core
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
25 Apr 2017 at 12:22 UTC
Updated:
21 Apr 2020 at 08:00 UTC
Jump to comment: Most recent
Comments
Comment #2
GOJR commentedComment #3
GOJR commentedComment #4
GOJR commentedComment #5
matroschker commentedI can confirm this - with 7.x-2.9 it works with our rules, but now after the update to 7.x-2.10 we got this error in the log:
Unable to get variable assigned_products, it is not defined.
Comment #6
GOJR commentedI had to regress to 7.x-2.9 for the moment until this get fixed has i don't see how i can fix it from 7.x-2.10.
Comment #7
activelink commentedThis issue appears to be caused by Views Bulk operations, rather that Rules itself. I can confirm that I had this problem, and I was in the process of setting up some new, manually triggered VBOs, for my site, when I realised that the Workflow module also had a similar problem when working with VBOs: A VBO that uses "Change workflow state of post to a new state" works, but one that uses "Change workflow state of post to next state" fails (it sets the workflow state to the same state that it's already in, and returns an "Unable to get variable variablename, it is not defined. error". It seems that the function "views_bulk_operations_action_load_id_list" in file "views_bulk_operations_views_list.inc" is returning the workflow states out of sequence, and this is causing the problem that we are seeing here in Rules.
I applied the patch from https://www.drupal.org/node/2862858#comment-12001237 and also the one from https://www.drupal.org/node/2853029#comment-11949835 - both patching the VBO module's "views_bulk_operations.rules.inc" and these appear to have eliminated this problem.
Comment #8
mvonfrie commentedThis bug is not only related to VBO. I have a custom rule action with three parameters, two integers and a node which is optional. My constellation is a node with an entity reference to an entity, and the entity can only be edited by the user via Inline Entity Form of the node edit form. Thus when creating a new entity (and a new node as well) the rule reacting on the entity creation fails with this bug. At the time of inserting the entity of course the node doesn't exist and cannot be provided to the rules action. In my situation
RulesState::get($name)is not aware that the parameter is defined as optional and it should returnNULLinstead of throwing the exception.Comment #9
tr commentedCould someone please provide an export of a (simple) rule that demonstrates this problem? What action is this, what data type, how have you configured it, etc - all of these will be answered by the export so we don't have to guess and endlessly try different things to try to reproduce this error.
Comment #10
tr commentedComment #11
dzy commentedI am using rules 7.x-2.12.
after user save comment, i want flag this node as [he has reviewed this node] something like that.
Comment #12
tr commentedPlease simplify this export to include only the things necessary to reproduce the error. For example, the error says: "Unable to evaluate condition flag_flagged_node." so I suspect you will still have that problem if you remove all the actions and remove your second condition. Likewise, can you write this Rule to use one of the built-in content types like article or page so we don't have to guess at what your "comment_node_enroll" content type looks like? Also, please describe how you configured the flag on the content type.
Yes, this requires you to do a little work, but without complete information we will not only have to recreate your content type and fields, but we will have to guess at how you've configured them. If we can't reproduce the error that may simply mean we just guessed wrong.
So please simplify the problem first before you export the Rule.
Comment #13
dzy commentedI tried as you suggested, but couldn't reproduce the problem using the article type. I guess this may be related to my custom permission.
I used the hook_comment_insert() and node_load() function. Maybe somewhere the return value did not pass comment successfully. I'll try again another day.
Comment #14
tr commentedComment #15
wutu commentedAfter update to 7.x-2.12 I have same error.
Rules: