Skip to content
Snippets Groups Projects
Commit b4798042 authored by Joshua Sedler's avatar Joshua Sedler :cartwheel_tone2:
Browse files

Update field storage schema through "updateFieldStorageDefinition")

parent 884ec874
No related branches found
No related tags found
2 merge requests!8282Issue #2230909: Simple decimals fail to pass validation,!579Issue #2230909: Simple decimals fail to pass validation
...@@ -42,7 +42,8 @@ function field_update_10001() { ...@@ -42,7 +42,8 @@ function field_update_10001() {
if ($precisionValue !== $newPrecisionValue || $scaleValue !== $newScaleValue) { if ($precisionValue !== $newPrecisionValue || $scaleValue !== $newScaleValue) {
$decimalFieldStorageEntity->setSetting('precision', $newPrecisionValue); $decimalFieldStorageEntity->setSetting('precision', $newPrecisionValue);
$decimalFieldStorageEntity->setSetting('scale', $newScaleValue); $decimalFieldStorageEntity->setSetting('scale', $newScaleValue);
$decimalFieldStorageEntity->save(); // Update the field storage definition:
\Drupal::service('entity.definition_update_manager')->updateFieldStorageDefinition($decimalFieldStorageEntity);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment