Loading src/Plugin/FieldInheritance/FieldInheritancePluginBase.php +14 −11 Original line number Diff line number Diff line Loading @@ -221,21 +221,24 @@ abstract class FieldInheritancePluginBase extends PluginBase implements FieldInh /** * Retrieve inherited data. * * @return string * @return array * The inherited data. */ protected function inheritData() { $source_entity = $this->getSourceEntity(); if ($source_entity === FALSE) { if ($source_entity === FALSE || $source_entity->{$this->getSourceField()}->isEmpty() ) { return []; } return $source_entity->{$this->getSourceField()}->getValue() ?? ''; return $source_entity->{$this->getSourceField()}->getValue(); } /** * Retrieve prepended data. * * @return string * @return array * The prepended data. */ protected function prependData() { Loading @@ -247,10 +250,10 @@ abstract class FieldInheritancePluginBase extends PluginBase implements FieldInh return $values; } if (!empty($destination_entity->{$this->getDestinationField()}->getValue())) { if (!$destination_entity->{$this->getDestinationField()}->isEmpty()) { $values = array_merge($values, $destination_entity->{$this->getDestinationField()}->getValue()); } if (!empty($source_entity->{$this->getSourceField()}->getValue())) { if (!$source_entity->{$this->getSourceField()}->isEmpty()) { $values = array_merge($values, $source_entity->{$this->getSourceField()}->getValue()); } return $values; Loading @@ -271,10 +274,10 @@ abstract class FieldInheritancePluginBase extends PluginBase implements FieldInh return $values; } if (!empty($source_entity->{$this->getSourceField()}->getValue())) { if (!$source_entity->{$this->getSourceField()}->isEmpty()) { $values = array_merge($values, $source_entity->{$this->getSourceField()}->getValue()); } if (!empty($destination_entity->{$this->getDestinationField()}->getValue())) { if (!$destination_entity->{$this->getDestinationField()}->isEmpty()) { $values = array_merge($values, $destination_entity->{$this->getDestinationField()}->getValue()); } return $values; Loading @@ -283,7 +286,7 @@ abstract class FieldInheritancePluginBase extends PluginBase implements FieldInh /** * Retrieve fallback data. * * @return string * @return array * The fallback data. */ protected function fallbackData() { Loading @@ -295,10 +298,10 @@ abstract class FieldInheritancePluginBase extends PluginBase implements FieldInh return $values; } if (!empty($destination_entity->{$this->getDestinationField()}->getValue())) { if (!$destination_entity->{$this->getDestinationField()}->isEmpty()) { $values = $destination_entity->{$this->getDestinationField()}->getValue(); } elseif (!empty($source_entity->{$this->getSourceField()}->getValue())) { elseif (!$source_entity->{$this->getSourceField()}->isEmpty()) { $values = $source_entity->{$this->getSourceField()}->getValue(); } return $values; Loading Loading
src/Plugin/FieldInheritance/FieldInheritancePluginBase.php +14 −11 Original line number Diff line number Diff line Loading @@ -221,21 +221,24 @@ abstract class FieldInheritancePluginBase extends PluginBase implements FieldInh /** * Retrieve inherited data. * * @return string * @return array * The inherited data. */ protected function inheritData() { $source_entity = $this->getSourceEntity(); if ($source_entity === FALSE) { if ($source_entity === FALSE || $source_entity->{$this->getSourceField()}->isEmpty() ) { return []; } return $source_entity->{$this->getSourceField()}->getValue() ?? ''; return $source_entity->{$this->getSourceField()}->getValue(); } /** * Retrieve prepended data. * * @return string * @return array * The prepended data. */ protected function prependData() { Loading @@ -247,10 +250,10 @@ abstract class FieldInheritancePluginBase extends PluginBase implements FieldInh return $values; } if (!empty($destination_entity->{$this->getDestinationField()}->getValue())) { if (!$destination_entity->{$this->getDestinationField()}->isEmpty()) { $values = array_merge($values, $destination_entity->{$this->getDestinationField()}->getValue()); } if (!empty($source_entity->{$this->getSourceField()}->getValue())) { if (!$source_entity->{$this->getSourceField()}->isEmpty()) { $values = array_merge($values, $source_entity->{$this->getSourceField()}->getValue()); } return $values; Loading @@ -271,10 +274,10 @@ abstract class FieldInheritancePluginBase extends PluginBase implements FieldInh return $values; } if (!empty($source_entity->{$this->getSourceField()}->getValue())) { if (!$source_entity->{$this->getSourceField()}->isEmpty()) { $values = array_merge($values, $source_entity->{$this->getSourceField()}->getValue()); } if (!empty($destination_entity->{$this->getDestinationField()}->getValue())) { if (!$destination_entity->{$this->getDestinationField()}->isEmpty()) { $values = array_merge($values, $destination_entity->{$this->getDestinationField()}->getValue()); } return $values; Loading @@ -283,7 +286,7 @@ abstract class FieldInheritancePluginBase extends PluginBase implements FieldInh /** * Retrieve fallback data. * * @return string * @return array * The fallback data. */ protected function fallbackData() { Loading @@ -295,10 +298,10 @@ abstract class FieldInheritancePluginBase extends PluginBase implements FieldInh return $values; } if (!empty($destination_entity->{$this->getDestinationField()}->getValue())) { if (!$destination_entity->{$this->getDestinationField()}->isEmpty()) { $values = $destination_entity->{$this->getDestinationField()}->getValue(); } elseif (!empty($source_entity->{$this->getSourceField()}->getValue())) { elseif (!$source_entity->{$this->getSourceField()}->isEmpty()) { $values = $source_entity->{$this->getSourceField()}->getValue(); } return $values; Loading