From 62ce5e04c1810ec5c4856b4efa5087911ed3e6a7 Mon Sep 17 00:00:00 2001 From: Ben Croker <57572400+bencroker@users.noreply.github.com> Date: Thu, 2 May 2024 20:01:18 -0600 Subject: [PATCH 1/4] Update FactoryFields.twig --- stubs/compiled_classes/FactoryFields.twig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/stubs/compiled_classes/FactoryFields.twig b/stubs/compiled_classes/FactoryFields.twig index 65036f6..0fefeab 100644 --- a/stubs/compiled_classes/FactoryFields.twig +++ b/stubs/compiled_classes/FactoryFields.twig @@ -3,10 +3,11 @@ namespace markhuot\craftpest\storage; /** + {% set type = '' %} {% for field in fields %} - {% if attribute(field, 'valueType') is defined %} + {% if craft.app.version < 5 %} {% set type = field.valueType() %} -{% elseif attribute(field, 'phpType') is defined %} +{% elseif craft.app.version > 5 %} {% set type = field.phpType() %} {% else %} {% set type = 'mixed' %} From 65c06128ba93400855bb8c84820cfd11004c03af Mon Sep 17 00:00:00 2001 From: Ben Croker <57572400+bencroker@users.noreply.github.com> Date: Thu, 2 May 2024 20:08:25 -0600 Subject: [PATCH 2/4] Update FactoryFields.twig --- stubs/compiled_classes/FactoryFields.twig | 1 - 1 file changed, 1 deletion(-) diff --git a/stubs/compiled_classes/FactoryFields.twig b/stubs/compiled_classes/FactoryFields.twig index 0fefeab..3a53300 100644 --- a/stubs/compiled_classes/FactoryFields.twig +++ b/stubs/compiled_classes/FactoryFields.twig @@ -3,7 +3,6 @@ namespace markhuot\craftpest\storage; /** - {% set type = '' %} {% for field in fields %} {% if craft.app.version < 5 %} {% set type = field.valueType() %} From 4f96b5ad6a3201182b7dc7aeaf266bf96eabbeb6 Mon Sep 17 00:00:00 2001 From: Ben Croker <57572400+bencroker@users.noreply.github.com> Date: Thu, 2 May 2024 20:14:25 -0600 Subject: [PATCH 3/4] Update FactoryFields.twig --- stubs/compiled_classes/FactoryFields.twig | 1 + 1 file changed, 1 insertion(+) diff --git a/stubs/compiled_classes/FactoryFields.twig b/stubs/compiled_classes/FactoryFields.twig index 3a53300..0fefeab 100644 --- a/stubs/compiled_classes/FactoryFields.twig +++ b/stubs/compiled_classes/FactoryFields.twig @@ -3,6 +3,7 @@ namespace markhuot\craftpest\storage; /** + {% set type = '' %} {% for field in fields %} {% if craft.app.version < 5 %} {% set type = field.valueType() %} From 96d1261886029051d9851f3d25fc2132f252e102 Mon Sep 17 00:00:00 2001 From: Ben Croker <57572400+bencroker@users.noreply.github.com> Date: Thu, 2 May 2024 20:16:55 -0600 Subject: [PATCH 4/4] Update FactoryFields.twig --- stubs/compiled_classes/FactoryFields.twig | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/stubs/compiled_classes/FactoryFields.twig b/stubs/compiled_classes/FactoryFields.twig index 0fefeab..8cec8ab 100644 --- a/stubs/compiled_classes/FactoryFields.twig +++ b/stubs/compiled_classes/FactoryFields.twig @@ -3,14 +3,12 @@ namespace markhuot\craftpest\storage; /** - {% set type = '' %} + {% set type = 'mixed' %} {% for field in fields %} {% if craft.app.version < 5 %} {% set type = field.valueType() %} {% elseif craft.app.version > 5 %} {% set type = field.phpType() %} -{% else %} -{% set type = 'mixed' %} {% endif %} * @method $this {{ field.handle }}({{ field.factoryTypeHint|default('mixed $value') }}): {{ type }} Sets the {{ field.name }} custom field {% endfor %}