- Issue created by @megachriz
- Issue was unassigned.
- Status changed to Needs review
over 1 year ago 9:22am 25 April 2023 - last update
over 1 year ago 701 pass - 🇫🇷France andypost
+++ b/src/Feeds/Processor/EntityProcessorBase.php @@ -1322,7 +1324,7 @@ abstract class EntityProcessorBase extends ProcessorBase implements EntityProces - unset($entity_target->{$target_name}); + $target->clearTarget($feed, $entity_target, $target_name); +++ b/src/Plugin/Type/Target/TargetBase.php @@ -57,6 +59,13 @@ abstract class TargetBase extends PluginBase implements TargetInterface, PluginF + public function clearTarget(FeedInterface $feed, EntityInterface $entity, string $target) { + unset($entity->{$target});
Any reason to pass a feed object if it's unused?
- 🇳🇱Netherlands megachriz
Yes, it is for consistency with other methods in
\Drupal\feeds\Plugin\Type\Target\TargetInterface
, most notablysetTarget()
andisEmpty()
:/** * Sets the values on an object. * * @param \Drupal\feeds\FeedInterface $feed * The feed object. * @param \Drupal\Core\Entity\EntityInterface $entity * The target object. * @param string $target * The name of the target to set. * @param array $values * A list of values to set on the target. */ public function setTarget(FeedInterface $feed, EntityInterface $entity, $target, array $values); /** * Returns if the value for the target is empty. * * @param \Drupal\feeds\FeedInterface $feed * The feed object. * @param \Drupal\Core\Entity\EntityInterface $entity * The target object. * @param string $target * The name of the target to set. * * @return bool * True if the value on the entity is empty. False otherwise. */ public function isEmpty(FeedInterface $feed, EntityInterface $entity, $target);
- Status changed to RTBC
over 1 year ago 6:53pm 27 April 2023 -
MegaChriz →
committed e0ad4a42 on 8.x-3.x
Issue #3356227 by MegaChriz, andypost: Moved clearing the target (aka...
-
MegaChriz →
committed e0ad4a42 on 8.x-3.x
- Status changed to Fixed
over 1 year ago 7:00pm 27 April 2023 Automatically closed - issue fixed for 2 weeks with no activity.