statikbe / craft-ctafield

Fieldtype that combines custom links, entries & classes
MIT License
0 stars 1 forks source link

Craft 5 support #11

Open danethomas opened 1 week ago

danethomas commented 1 week ago

Craft 5 now supports a new Link field type https://github.com/craftcms/cms/discussions/9062 so support for this may no longer be required however before we migrate to that I was wondering if you've had a look at just adding Craft 5 to help with upgrading.

I tried to just change the craft/cms requirement but after the upgrade there seems to be a namespace issue:

{"errorMessage":"Unable to find component class 'statikbe\\cta\\fields\\CTAField'.","expectedType":"statikbe\\cta\\fields\\CTAField"

Any help would be appreicated

janhenckens commented 1 week ago

Hey @danethomas, we've internally switched to using Hyper somwhere around Craft 4.7 and will not be porting this plugin to Craft 5.

We do however have a migration to Hyper (since we also have a bunch of sites on this plugin that will eventually need to be upgraded to 5) that's almost ready for release - which you can find here https://github.com/statikbe/craft-ctafield/tree/feature/hyper-migration

danethomas commented 9 hours ago

Excellent news!

I've tried that migration and both completed successfully but when viewing the content for one of the new Hyper fields I'm getting the following error.

Unable to render field - Undefined array key "CTA styles" /**/craft/vendor/statikbe/craft-config-values/src/fields/ConfigValuesFieldField.php:116

From what I can see all the older CTA fields are now Hyper ones but something hasn't gone right for the content migration. We're using Matrix & Neo fields rather than SuperTable. I can see that Matrix fields are supported in the migration, is the issue related to the Neo fields?

danethomas commented 8 hours ago

And we've got a new field

Screenshot 2024-09-18 at 10 58 33 AM
janhenckens commented 2 hours ago

In the "previous" plugin there was a button style option and we tried to add that to the new Hyper field. But I see I assumed that would always be done with https://github.com/statikbe/craft-config-values, which you might not have installed or configured.

Could you have a go at following the docs for that plugin and create a "CTA Styles" option here to see if that works?