Refine the process value filtering so that it gets values from the row

Created on 6 August 2024, 3 months ago
Updated 21 August 2024, 3 months ago

Problem/Motivation

Currently it does a double filtering, in the following code

elseif (is_object($value)) {
  $fieldValue = property_exists($value, $key) ? $value->$key : NULL;

it first validates that $value is an object and then checks that the property $key exists in $value, opening the door that a value of the row (such as "@row_value") is an object but then does not validate the property and defines it as NULL instead of the value of the row.

Steps to reproduce

  1. Create a migration and create a dummy field named, for example, dummy_field with a default value.
  2. Create a migration field with migrate_child_entity_generate and assign the field "@dummy_field" to some value of the entity.
  3. The entity is created without the value of dummy_field.

Proposed resolution

Perform all filtering at the top level, leaving the possibility to assign the final fallback to $row->get($key), which can assign NULL to $fieldValue in case of failure.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇪🇸Spain enchufe Spain

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024