i'm not sure if this is an entity or rules issue but it's the same address anyway:
attempting to solve #1313468: I can't access my custom product options from rules (see notes there) i made a property that returns a list of "commerce_option"s (see patch).
all fine.
when in rules i access something like lineitem:options:0 i get an unwrapped(!) commerce_option :-( so no going further in rules.
what is wrong? also a comment in the original issue about the data model will be appreciated.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 0001-lineitem-options-property-first-shot.patch | 1.75 KB | geek-merlin |
| #1 | 0001-lineitem-options-property-first-shot.patch | 1.73 KB | geek-merlin |
Comments
Comment #1
geek-merlinComment #2
fagoA commerce-options is an entity type, right? Then your could should work just fine. Best, try using the property via the metadata wrappers without rules and see whether it works.
Comment #3
geek-merlinthat's what i thought too. wrapper seems to work just fine, rules data not:
(please note that i renamed my property to keep good namespacing rules, see new patch)
test the wrappers in my devel/php:
gives as expected:
BUT...
this rule:
spits out 2* an unwrapped...
so it seems that rules data loses the wrapper when accessing lists.
Comment #4
fagook, looks like the problem must be in Rules then. Could you check whether your entity type correctly appears in the rules data info? E.g. call dpm(rules_get_cache()); and check whether
appears and is marked as wrap => TRUE in 'data info'.
Comment #5
fagook, looks like the problem must be in Rules then. Could you check whether your entity type correctly appears in the rules data info? E.g. call dpm(rules_get_cache()); and check whether
appears and is marked as wrap => TRUE in 'data info'.
Comment #6
geek-merlinyep,
$rules_cache[data_info][list][wrap] == TRUE
same for list<commerce_option>
Comment #7
geek-merlinoops, found something...
Comment #8
geek-merlinhmm, thought i misdeclared something, but no, list<commerce_option> is just the right thing.
(must think ybout the naming of my property :-)
Comment #9
geek-merlinbump, ignore my noise and see #6
Comment #10
mitchell commentedtagging
Comment #11
tr commentedIs this still a problem in the current 7.x-2.x version of Rules, and can the problem be reproduced without a full commerce setup?
Comment #12
tr commentedNo further information provided, and 7.x-1.x-dev is not supported any more for a long time now.
If this can be reproduced in the current version of Rules please open a new issue with details of how to reproduce the problem. And preferably using only core Drupal/core Rules and not a full commerce setup.