Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dropdown field optgroup bug #5014

Closed
valeryvkrukov opened this issue Sep 28, 2019 · 4 comments
Closed

Dropdown field optgroup bug #5014

valeryvkrukov opened this issue Sep 28, 2019 · 4 comments

Comments

@valeryvkrukov
Copy link

valeryvkrukov commented Sep 28, 2019

Description

After installing updates have an error when save dropdown field with optgroups.
It looks like just simple typo in craftcms/cms/src/fields/BaseOptionsField.php at line 121

if (array_key_exists('optgrou', $option)) {

Stack trace:

yii\base\ErrorException: Undefined index: label in /home/valery/PhpstormProjects/site-clone-1/vendor/craftcms/cms/src/fields/BaseOptionsField.php:125
Stack trace:
#0 /home/valery/PhpstormProjects/site-clone-1/vendor/yiisoft/yii2/validators/InlineValidator.php(72): craft\fields\Dropdown->validateOptions()
#1 /home/valery/PhpstormProjects/site-clone-1/vendor/yiisoft/yii2/validators/InlineValidator.php(72): ::call_user_func:{/home/valery/PhpstormProjects/site-clone-1/vendor/yiisoft/yii2/validators/InlineValidator.php:72}()
#2 /home/valery/PhpstormProjects/site-clone-1/vendor/yiisoft/yii2/validators/Validator.php(257): yii\validators\InlineValidator->validateAttribute()
#3 /home/valery/PhpstormProjects/site-clone-1/vendor/yiisoft/yii2/base/Model.php(367): yii\validators\InlineValidator->validateAttributes()
#4 /home/valery/PhpstormProjects/site-clone-1/vendor/craftcms/cms/src/services/Fields.php(767): craft\fields\Dropdown->validate()
#5 /home/valery/PhpstormProjects/site-clone-1/vendor/craftcms/cms/src/controllers/FieldsController.php(275): craft\services\Fields->saveField()
#6 /home/valery/PhpstormProjects/site-clone-1/vendor/yiisoft/yii2/base/InlineAction.php(57): craft\controllers\FieldsController->actionSaveField()
#7 /home/valery/PhpstormProjects/site-clone-1/vendor/yiisoft/yii2/base/InlineAction.php(57): ::call_user_func_array:{/home/valery/PhpstormProjects/site-clone-1/vendor/yiisoft/yii2/base/InlineAction.php:57}()
#8 /home/valery/PhpstormProjects/site-clone-1/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams()
#9 /home/valery/PhpstormProjects/site-clone-1/vendor/craftcms/cms/src/web/Controller.php(187): craft\controllers\FieldsController->runAction()
#10 /home/valery/PhpstormProjects/site-clone-1/vendor/yiisoft/yii2/base/Module.php(528): craft\controllers\FieldsController->runAction()
#11 /home/valery/PhpstormProjects/site-clone-1/vendor/craftcms/cms/src/web/Application.php(299): craft\web\Application->runAction()
#12 /home/valery/PhpstormProjects/site-clone-1/vendor/craftcms/cms/src/web/Application.php(566): craft\web\Application->runAction()
#13 /home/valery/PhpstormProjects/site-clone-1/vendor/craftcms/cms/src/web/Application.php(278): craft\web\Application->_processActionRequest()
#14 /home/valery/PhpstormProjects/site-clone-1/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest()
#15 /home/valery/PhpstormProjects/site-clone-1/web/index.php(21): craft\web\Application->run()
#16 {main}

Steps to reproduce

  1. save field with dropdown type with optgroups after updating

Additional info

  • Craft version: 3.3.6
  • PHP version: 7.3
@SwiseWeb
Copy link

SwiseWeb commented Oct 2, 2019

Confirming that I'm also experiencing this issue

@brandonkelly
Copy link
Member

Fixed for the next release, thanks for reporting!

@LouisCuvelier
Copy link

LouisCuvelier commented Jan 28, 2020

Hi @brandonkelly,
This error came back with Craft 3.4

@brandonkelly
Copy link
Member

@LouisCuvelier I’m not able to reproduce given the above steps, and the bugfix added in 011d78e still exists in 3.4. Can you please come up with some steps to reproduce and post as a new issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants