From 65b73dfcb8e01b2d0d8305629bfa4b6b2ae6fd71 Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Wed, 1 Jun 2022 10:30:08 +0100 Subject: [PATCH] Update dgi_fixity.module Co-authored-by: Adam --- dgi_fixity.module | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dgi_fixity.module b/dgi_fixity.module index fe44125..620c904 100644 --- a/dgi_fixity.module +++ b/dgi_fixity.module @@ -309,8 +309,7 @@ function _dgi_fixity_file_widget_process(&$element, FormStateInterface $form_sta $file = reset($element['#files']) ?? NULL; $element['algorithms']['#access'] = (bool) $element['#value']['fids']; foreach (Element::children($element['algorithms']) as $column) { - $default_value = $element['#value']['algorithms'][$column] ?? NULL; - $default_value = $default_value ?? (isset($file->{$column}) ? $file->{$column}->value : NULL); + $default_value = $element['#value']['algorithms'][$column] ?? $file->{$column}->value ?? NULL; $element['algorithms'][$column]['#default_value'] = $default_value; } return $element;