From 389a8c9b64ec995306f329ab79bd27a1a26ae0a9 Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Wed, 1 Jun 2022 10:02:12 +0100 Subject: [PATCH] Apply suggestions from code review 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 b70c216..fe44125 100644 --- a/dgi_fixity.module +++ b/dgi_fixity.module @@ -243,7 +243,6 @@ function dgi_fixity_help($route_name, RouteMatchInterface $route_match) { function dgi_fixity_field_widget_third_party_settings_form(WidgetInterface $plugin, FieldDefinitionInterface $field_definition, $form_mode, $form, FormStateInterface $form_state) { $element = []; if ($plugin instanceof FileWidget) { - $field_name = $field_definition->getName(); $element['validate'] = [ '#type' => 'checkbox', '#title' => \t('Show Validate Upload Elements'), @@ -257,7 +256,7 @@ function dgi_fixity_field_widget_third_party_settings_form(WidgetInterface $plug '#default_value' => $plugin->getThirdPartySetting('dgi_fixity', 'validate_require', FALSE), '#states' => [ 'visible' => [ - ":input[name=\"fields[${field_name}][settings_edit_form][third_party_settings][dgi_fixity][validate]\"]" => ['checked' => TRUE], + ":input[name=\"fields[{$field_definition->getName()}][settings_edit_form][third_party_settings][dgi_fixity][validate]\"]" => ['checked' => TRUE], ], ], ];