diff --git a/app/plugins/CoreEnroller/src/Model/Table/BasicAttributeCollectorsTable.php b/app/plugins/CoreEnroller/src/Model/Table/BasicAttributeCollectorsTable.php index 5ed3d6aa0..1ec67cead 100644 --- a/app/plugins/CoreEnroller/src/Model/Table/BasicAttributeCollectorsTable.php +++ b/app/plugins/CoreEnroller/src/Model/Table/BasicAttributeCollectorsTable.php @@ -45,6 +45,7 @@ class BasicAttributeCollectorsTable extends Table { use \App\Lib\Traits\PrimaryLinkTrait; use \App\Lib\Traits\TableMetaTrait; use \App\Lib\Traits\ValidationTrait; + use \App\Lib\Traits\LayoutTrait; /** * Perform Cake Model initialization. diff --git a/app/plugins/CoreEnroller/templates/element/field.php b/app/plugins/CoreEnroller/templates/element/field.php index 0aa16367d..44ee1ce88 100644 --- a/app/plugins/CoreEnroller/templates/element/field.php +++ b/app/plugins/CoreEnroller/templates/element/field.php @@ -48,7 +48,7 @@ default => '' }; -// If we are re-rendering the Petition override the default value with whatever +// If we are re-rendering the Petition, override the default value with whatever // was previously saved if(!empty($vv_petition_attributes)) { $curEntity = $vv_petition_attributes->firstMatch(['enrollment_attribute_id' => $attr->id]); @@ -97,14 +97,11 @@ // Set the final fieldOptions $formArguments['fieldOptions'] = $options; -// HIDDEN Field -// We print directly, we do not delegate to the element for further processing -if ($attr->hidden) { +print match(true) { + // HIDDEN Field + // We print directly, we do not delegate to the element for further processing // In case this is a hidden field, we need to get only the value - print $this->Form->hidden($formArguments['fieldName'], ['value' => $options['default']]); -} else { - // Print the element - print $this->element('form/listItem', [ - 'arguments' => $formArguments - ]); -} \ No newline at end of file + $attr->hidden =>$this->Form->hidden($formArguments['fieldName'], ['value' => $options['default']]), + // Default use case + default => $this->element('form/listItem', ['arguments' => $formArguments]) +}; diff --git a/app/plugins/CoreEnroller/templates/element/mveas/fieldset-field.php b/app/plugins/CoreEnroller/templates/element/mveas/fieldset-field.php index 754f861aa..95ef0999e 100644 --- a/app/plugins/CoreEnroller/templates/element/mveas/fieldset-field.php +++ b/app/plugins/CoreEnroller/templates/element/mveas/fieldset-field.php @@ -57,7 +57,6 @@