I have three rules all meant to create/upadate/delete a taxonomy term using the node title as the term's value. The actual taxonomy term is NOT in the node form. I have the create one working, but both the update and delete rules fail with the following error:
Warning: array_values() [function.array-values]: The argument should be an array in rules_action_entity_query() (line 97 of /Users/kibots/Sites/drupal7/sites/all/modules/rules/modules/data.eval.in
Rules log shows:
0 ms Reacting on event After updating existing content.
8.167 ms Evaluating rule Update Project Taxonomy from Node Title (cloned).
8.872 ms The condition node_is_of_type evaluated to TRUE
8.892 ms AND evaluated to TRUE.
10.029 ms Evaluating the action entity_query.
14.532 ms Added the provided variable entity_fetched of type list
16.663 ms The variable or parameter entity_fetched is empty.
16.684 ms Unable to execute action drupal_message.
16.758 ms Finished reacting on event After updating existing con
I am guessing the log shows it fails because of the "The variable or parameter entity_fetch" empty bit. I cannot figure out if this an error triggered from my end, but after doing some test I suspect is an evaluation problem with the Fetch Entity.
The Fetch Entity by property is simple:
Entity Type: Taxonomy Term
Property: Name
Value (data selector): node:title
I have tried to do the same thing by setting a simple text variable, moving the node:title into it, then trying to use the resulting variable as the Value of the Fetch entity property afterwards with the same results. I also tried testing this by inputing the property value manually (the actual name of the term):
Entity Type: Taxonomy Term
Property: Name
Value (direct input): Example Project #1
And I still get the same results.
Bug or dev error?
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | entity_query.patch | 21.33 KB | fago |
Comments
Comment #1
dasjohaving the same problem here:
my rule with an entity query for a taxonomy_vocabulary by machine name
leads to
Warning: array_values() [function.array-values]: The argument should be an array in rules_action_entity_query() (line 97 of .../modules/rules/modules/data.eval.indebugging into the stated function
yields
so, it seems the entity_property query doesn't return the expected vocabulary and rules_action_entity_query can't deal with empty results
Comment #2
dasjodebugging into the function, reveals that entity_property_query fails, as it is missing the query callback method for the given property.
#1093918: Improve entity property query support fixes the problem for me
Comment #3
fagoYep, apart from fixing that we need fix the Rules action to check which properties support querying. Probably best we should only add those properties in the options list.
Comment #4
fagoComment #5
fagouhm, sry the patch in #4 doesn't belong in this issue
Comment #7
3rdLOF commentedSo I did the patch in #2 an that did not fix it, as I presume fago implies in the follow up message. Should I preserve this patches and wait for a patch for this module or should I reverse it?
Comment #8
dasjokannary: the best way would be, if you could test fago's patch in #1093918: Improve entity property query support in order to mark it "reviewed and tested by the community"
Comment #9
3rdLOF commentedI did and it did not solve the problem.
Comment #10
3rdLOF commentedCORRECTION: Looks like it did fix the problem as far as the error reported above.
Comment #11
mrfelton commentedI'm having trouble fetching an entity by a property. I have two nodes, each with a number field, both values set to the same number. On saving one node, I'm trying to use rules to look up the other node by fetching it by the number property, and using the value from the first node as the selector value. The log shows that the entity was loaded, or at least, it says that it added a variable called drupal_project_maintainer_entity_fetched for it, but that variable doesn't seem to be available for use later on (I tried printing it as a message), neither does any entity seem to have actually been loaded.
One of the earlier comments in this threads hints at it not being possible to query entities on all fields. Is fetching an entity by looking up the value stored in a number field supported?
Comment #12
vasikei can cofirm this issue for a Product reference (Drupal Commerce) property.
Comment #13
rupertj commented@vasike - I've had this issue on commerce product reference fields too, and I think I've found a fix. Issue here: https://drupal.org/node/1306106
Comment #14
vasikefor me it seems that are some conflicts with the Meta tags module. if i disable the metatags then it seems it works
Comment #15
dasjoi'm marking this as fixed. #1093918: Improve entity property query support has landed and i have created a follow up for handling bundle-specific properties #2058037: Support all entity properties in the entity query action.