presseddigital / colorit

A slick color picker fieldtype plugin for the Craft CMS control panel
Other
21 stars 8 forks source link

Undefined variable: isHandleUnique #29

Closed chadcrowell closed 1 month ago

chadcrowell commented 3 years ago

Craft 3.5.14 Colorit 1.0.9.3

I had a preset in place and working on a bunch of fields within a matrix. Not sure what happened but now the preset is gone from the settings and the fields are all broken.

1. in /var/www/gcx-craft.vhx.cloud/vendor/presseddigital/colorit/src/fields/ColoritField.phpat line 123
114115116117118119120121122123124125126127128129130131132            if(!$_paletteColor->validate() || !$isHandleUnique)
            {
                $this->paletteColors[$i] = [
                    'label' => [
                        'value' => $_paletteColor->label ?? '',
                        'hasErrors' => $_paletteColor->hasErrors('label') ?? '',
                    ],
                    'handle' => [
                        'value' => $_paletteColor->handle ?? '',
                        'hasErrors' => !$isHandleUnique ? true : $_paletteColor->hasErrors('handle') ?? '',
                    ],
                    'color' => [
                        'value' => $_paletteColor->color ?? '',
                        'hasErrors' => $_paletteColor->hasErrors('color') ?? '',
                    ],
                ];
                foreach ($_paletteColor->getErrors() as $error)
                {
                    $this->addError('paletteColors', Craft::t('colorit', 'Row {row} {error}', [
2. in /var/www/gcx-craft.vhx.cloud/vendor/craftcms/cms/src/web/ErrorHandler.php at line 76– yii\base\ErrorHandler::handleError(8, 'Undefined variable: isHandleUniq...', '/var/www/gcx-craft.vhx.cloud/ven...', 123)
samhibberd commented 1 month ago

Fixed in 4.0.1 & 5.0.0