craftpulse / craft-colour-swatches

Let clients choose from a predefined set of colours.
MIT License
34 stars 23 forks source link

New errors logging after upgrading to 4.4.0 #124

Closed gateszies closed 5 months ago

gateszies commented 5 months ago

I recently updated Colour Swatches from 4.3.0 to 4.4.0 and am getting some odd error messages. When I navigate to an entry that uses a Color Swatch field in Craft, I'm presented with the following error message and am unable to edit the entry:

Screen Shot 2024-04-12 at 10 30 28 AM

I'm also unable to add colors directly in the plugin settings. When going to save, I get the error message Couldn't save plugin settings. See screen recording below.

https://github.com/craftpulse/craft-colour-swatches/assets/66807975/99dc56e2-2bc2-45fd-9119-51a1c6bda448

The only other item that was changed was upgrading from Craft 4.5.6.1 to Craft 4.8.7. Let me know if any additional information is helpful. Thanks!

d2g45 commented 5 months ago

We also ran into the Undefined array key 0 error and for us, it was because we didn't have the default color first. I'm pretty sure array_filter preserves keys so our solution at the moment is to move the default color to be the first in the list.

michtio commented 5 months ago

Thank you for the information @d2g45 and @gateszies

We will resolve the issues as soon as possible and tag a release somewhere tomorrow!

cookie10codes commented 5 months ago

hi @gateszies,

Did you set the color field with the CMS or the config colour-swatches.php? If it's through the colour-swatches.php, can you share it with me please?

cookie10codes commented 5 months ago

@gateszies I've just released 4.5.2, can you update the composer package and see if it's fixed for you? if not, please reopen the issue

gateszies commented 5 months ago

@cookie10codes I appreciate the quick reply! That fix cleared up the array error above 🎉

I'm still seeing Couldn't save plugin settings when adding values directly in the plugin settings, but the array error was my main issue.

cookie10codes commented 5 months ago

I've added a new issues onto our stack @gateszies

maxfenton commented 5 months ago

@cookie10codes Noting that the Craft store still lists 4.4.0 as the latest version of the plugin, but packagist and composer update are able to get ^4.5.0

gracehcoote commented 2 months ago

Also getting the error "Couldn't save plugin settings", which I discovered after adding about 20 colours, so that was fun! I'm on version 5.0.2 of the plugin, running on Craft 5.2.8.

brianrivet-tilt commented 1 month ago

I am now getting the Undefined Array Key 0 error when I try to save entries with the color swatch field in them. I'm running Craft 5.3.6 and Colour Swatches v5.0.2