Browse Source

Update dgi_fixity.module

Co-authored-by: Adam <adam-vessey@users.noreply.github.com>
pull/3/head
Nigel Banks 3 years ago committed by GitHub
parent
commit
65b73dfcb8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      dgi_fixity.module

3
dgi_fixity.module

@ -309,8 +309,7 @@ function _dgi_fixity_file_widget_process(&$element, FormStateInterface $form_sta
$file = reset($element['#files']) ?? NULL; $file = reset($element['#files']) ?? NULL;
$element['algorithms']['#access'] = (bool) $element['#value']['fids']; $element['algorithms']['#access'] = (bool) $element['#value']['fids'];
foreach (Element::children($element['algorithms']) as $column) { foreach (Element::children($element['algorithms']) as $column) {
$default_value = $element['#value']['algorithms'][$column] ?? NULL; $default_value = $element['#value']['algorithms'][$column] ?? $file->{$column}->value ?? NULL;
$default_value = $default_value ?? (isset($file->{$column}) ? $file->{$column}->value : NULL);
$element['algorithms'][$column]['#default_value'] = $default_value; $element['algorithms'][$column]['#default_value'] = $default_value;
} }
return $element; return $element;

Loading…
Cancel
Save