Skip to content
Snippets Groups Projects

Issue #3445038 by Grevil: Fix schema error: variable type is integer but applied schema class is Drupal\Core\TypedData\Plugin\DataType\BooleanData

Merged Issue #3445038 by Grevil: Fix schema error: variable type is integer but applied schema class is Drupal\Core\TypedData\Plugin\DataType\BooleanData
All threads resolved!
All threads resolved!
+ 20
0
<?php
/**
* @file
* Install file for the Entity Reference Display module.
*/
/**
* Updates the "negate" field settings option from integer to boolean.
*/
function entity_reference_display_update_8001() {
$referenceDisplayFields = \Drupal::entityTypeManager()->getStorage('field_config')->loadByProperties(['field_type' => 'entity_reference_display']);
foreach ($referenceDisplayFields as $field) {
/** @var \Drupal\field\Entity\FieldConfig $field */
$negateValue = $field->getSetting('negate');
$field->setSetting('negate', !empty($negateValue));
$field->save();
}
}
Loading