Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi, a bug was introduced with 7.x-2.10 or at least a hole was closed which has invalidated several of my Rules components. The scenario that is no longer valid takes place when I Fetch Entity by Property. The field I am fetching is a multi-value entity reference field. This worked fine in the past but after I did the upgrade the components were invalidated with the following error:
The data type of the configured argument does not match the parameter's value requirement.
Thoughts? How do I go about fetching a field that has multiple values?
Comments
Comment #2
dbdrupal CreditAttribution: dbdrupal commentedComment #3
Matroschker CreditAttribution: 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 a data value. Error: Invalid data value given. Be sure it matches the required data type and format. Value at taxonomy_term(): .
Comment #4
apmsooner CreditAttribution: apmsooner commented@dbdrupal, I'm not seeing an issue like that with 7.x-2.10. A side note, if you working with an entity reference field with multiple values, i'm not sure why you would choose to fetch by property vs fetch by id which is more reliable but either way, you need to add a loop on that particular field since it has multiple values and fetch the entity within the loop. Sounds like you might have had it working previously as a single value field but then changed it to a multi-valued field and now you're dealing with an array of ids vs. a single id. I'm speculating... but it doesn't sound like a problem with the module but rather a change in your site configuration.
@Matroschker - same as above??
Comment #5
dbdrupal CreditAttribution: dbdrupal commentedI think what happened is that when the Rules were released, the code was tightened up which inadvertently caused a failure. My site was static and there were no other changes introduced. I would love to fetch by id if possible, but that is not always possible and certainly was not in this case. I can change to a loop but the problem with things like this is that I now have to go through and find all of the places where I was fetching in this way. For a large site, it isn't always an easy thing to do. I found a small patch that I introduced to fix this issue.
Comment #6
itsmarc CreditAttribution: itsmarc commented@dbdrupal - could you please share your patch for this.
Comment #7
TR CreditAttribution: TR commentedI believe this is a duplicate of #2475097: Action "Fetch entity by property" does not allow to fetch by multi-valued properties, which was recently fixed.