Problem/Motivation
With Feeds now officially supporting field translation using Entity translation, mapping targets provided by contrib modules should be adjusted to follow this change.
For fields that can be multilingual, Feeds added a mapping option "language" which is passed to all target callbacks. To support Feeds 7.x-2.0-beta2 and later, this option should be respected.
Proposed resolution
Follow the instructions in the change record: use $mapping['language'] at places where LANGUAGE_NONE or und is used.
Remaining tasks
Apply the proposed resolution.
User interface changes
When the field is configured as multilingual, on the target configuration an option will become available to configure the language. This module is expected to respect that option.
API changes
None.
Data model changes
None.
Comments
Comment #2
joelpittetThanks for all the bits @MegaChriz. I put a couple of other fixes and the
$mappingwas already used but not passed in a parameter.Comment #3
joelpittet@MegaChriz What do you think, does this fix it for you?
Comment #4
megachriz@joelpittet
Quick glance over I think it is mostly okay. I do notice that the made changes make Entityreference incompatible with Feeds versions older than 7.x-2.0-beta1 (the
$valuesparameter is always an array since that version, but before that it was not enforced), but I don't think that is a problem. Feeds 7.x-2.0-beta1 was released more than two years ago.This the D8 style of documenting classes, not sure if this should be done as well for D7.
Now we are at it, perhaps the parameters of
entityreference_feeds_set_target()don't have to be documented at all as it is implementing a callback. The parameters are already documented inmy_module_set_target()in feeds.api.php.With typehinting the $value parameter to be an array, the following code lines become redundant and should be removed:
Note that
$valueparameter should then be renamed to$valuesas well (note the 's' at the end).Comment #5
joelpittetNot that ambitious;) But I tried to address your other points.
Thanks for the review @MegaChriz!
Comment #6
vbard commented#5 works with latest dev, thank you!
Comment #7
joelpittetBump
Comment #8
joelpittetBumping again because I saw a new release and this didn't get in with it. (we'll continue to apply the patch)
Comment #9
joseph.olstadTriggered tests for PHP 8.0, 8.1, 8.2
Comment #11
joseph.olstadFixed in 7.x-1.x-dev
Comment #12
joseph.olstadhttps://www.drupal.org/project/entityreference/releases/7.x-1.7
Comment #13
joelpittetThanks @joseph.olstad!
Comment #15
joseph.olstadplease try the latest release
https://www.drupal.org/project/entityreference/releases/7.x-1.9