Skip to content
Snippets Groups Projects

Undefined array key map_false fixed

1 unresolved thread
1 file
+ 2
2
Compare changes
  • Side-by-side
  • Inline
@@ -44,11 +44,11 @@ class ConvertBoolean extends ProcessPluginBase {
@@ -44,11 +44,11 @@ class ConvertBoolean extends ProcessPluginBase {
*/
*/
public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
$map_false = ['false', 'FALSE', 'null', 'NULL', '0'];
$map_false = ['false', 'FALSE', 'null', 'NULL', '0'];
$map_false_from_config = (!empty($this->configuration['map_false'] && is_array($this->configuration['map_false']))) ? $this->configuration['map_false'] : [];
$map_false_from_config = (isset($this->configuration['map_false']) && !empty($this->configuration['map_false'] && is_array($this->configuration['map_false']))) ? $this->configuration['map_false'] : [];
    • I don't think we need the !empty() on this since we are passing an empty array if it is. It would read better if it was just (isset($this->configuration['map_false']) && is_array($this->configuration['map_false']))

      Same for $map_true_from_config..

Please register or sign in to reply
$map_false = array_merge($map_false, $map_false_from_config);
$map_false = array_merge($map_false, $map_false_from_config);
$map_true = ['true', 'TRUE', '1'];
$map_true = ['true', 'TRUE', '1'];
$map_true_from_config = (!empty($this->configuration['map_true'] && is_array($this->configuration['map_true']))) ? $this->configuration['map_true'] : [];
$map_true_from_config = (isset($this->configuration['map_true']) && !empty($this->configuration['map_true'] && is_array($this->configuration['map_true']))) ? $this->configuration['map_true'] : [];
$map_true = array_merge($map_true, $map_true_from_config);
$map_true = array_merge($map_true, $map_true_from_config);
if (is_string($value)) {
if (is_string($value)) {
Loading