From ea09aa48928330836e1b9492f09f17c23140988c Mon Sep 17 00:00:00 2001 From: Kevin Meijer Date: Fri, 16 Jun 2023 11:51:35 +0200 Subject: [PATCH] Changed field type data --- src/Fieldtypes/Postcodeservice.php | 11 +++++++++-- src/Tags/PostcodeserviceTag.php | 4 ++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/Fieldtypes/Postcodeservice.php b/src/Fieldtypes/Postcodeservice.php index 633cb9e..ebe5a24 100644 --- a/src/Fieldtypes/Postcodeservice.php +++ b/src/Fieldtypes/Postcodeservice.php @@ -20,8 +20,15 @@ class Postcodeservice extends Text protected function configFieldItems(): array { $config = parent::configFieldItems(); - $config['input_type']['default'] = $this->postcodeserviceDefaultFieldType; - $config['input_type']['options'] = $this->postcodeserviceFieldTypes; + + $config['postcodeservice_type'] = [ + 'display' => __('Field type'), + 'instructions' => __('Select the Postcodeservice field type'), + 'type' => 'select', + 'default' => $this->postcodeserviceDefaultFieldType, + 'width' => 50, + 'options' => $this->postcodeserviceFieldTypes + ]; return $config; } diff --git a/src/Tags/PostcodeserviceTag.php b/src/Tags/PostcodeserviceTag.php index 79c0945..b496337 100644 --- a/src/Tags/PostcodeserviceTag.php +++ b/src/Tags/PostcodeserviceTag.php @@ -32,11 +32,11 @@ public function getPostcodeserviceFields(array $form): array } foreach ($form['fields'] as $field) { - if (!isset($field['input_type']) || !isset($field['handle']) || ($field['type'] ?? '') !== 'postcodeservice') { + if (!isset($field['input_type']) || !isset($field['handle']) || ($field['type'] ?? '') !== 'postcodeservice' || !isset($field['postcodeservice_type'])) { continue; } - $postcodeserviceFields[$field['input_type']] = $field['handle']; + $postcodeserviceFields[$field['postcodeservice_type']] = $field['handle']; } return $postcodeserviceFields;