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

[5.x]: undefined array key "prevalidate" #15486

Closed
funkysoul opened this issue Aug 6, 2024 · 4 comments
Closed

[5.x]: undefined array key "prevalidate" #15486

funkysoul opened this issue Aug 6, 2024 · 4 comments
Labels

Comments

@funkysoul
Copy link

funkysoul commented Aug 6, 2024

What happened?

Description

just tried to add an adress field to an entry type, which works fine, but after saving and re-opening the entry, it fails with the error mentioned in the subject.

Steps to reproduce

  1. Have an entry type with an adress field on it.
  2. add an adress to the entry
  3. save and close
  4. go back to entry and you should get the error

Expected behavior

no error ;-)

Actual behavior

Like the subject already says its missing an array key.

Log below:

web.ERROR] [yii\base\ErrorException:2] yii\base\ErrorException: Undefined array key "prevalidate" in /var/www/html/vendor/craftcms/cms/src/elements/NestedElementManager.php:432
Stack trace:
#0 /var/www/html/vendor/craftcms/cms/src/web/ErrorHandler.php(79): yii\base\ErrorHandler->handleError()
#1 /var/www/html/vendor/craftcms/cms/src/elements/NestedElementManager.php(432): craft\web\ErrorHandler->handleError()
#2 /var/www/html/vendor/craftcms/cms/src/elements/NestedElementManager.php(627): craft\elements\NestedElementManager->craft\elements\{closure}()
#3 /var/www/html/vendor/craftcms/cms/src/web/View.php(1739): craft\elements\NestedElementManager->craft\elements\{closure}()
#4 /var/www/html/vendor/craftcms/cms/src/elements/NestedElementManager.php(579): craft\web\View->namespaceInputs()
#5 /var/www/html/vendor/craftcms/cms/src/elements/NestedElementManager.php(368): craft\elements\NestedElementManager->createView()
#6 /var/www/html/vendor/craftcms/cms/src/fields/Addresses.php(656): craft\elements\NestedElementManager->getCardsHtml()
#7 /var/www/html/vendor/craftcms/cms/src/fields/Addresses.php(626): craft\fields\Addresses->inputHtmlInternal()
#8 /var/www/html/vendor/craftcms/cms/src/base/Field.php(638): craft\fields\Addresses->inputHtml()
#9 /var/www/html/vendor/craftcms/cms/src/fieldlayoutelements/CustomField.php(373): craft\base\Field->getInputHtml()
#10 /var/www/html/vendor/craftcms/cms/src/fieldlayoutelements/BaseField.php(349): craft\fieldlayoutelements\CustomField->inputHtml()
#11 /var/www/html/vendor/craftcms/cms/src/fieldlayoutelements/CustomField.php(324): craft\fieldlayoutelements\BaseField->formHtml()
#12 /var/www/html/vendor/craftcms/cms/src/web/View.php(1739): craft\fieldlayoutelements\CustomField->craft\fieldlayoutelements\{closure}()
#13 /var/www/html/vendor/craftcms/cms/src/fieldlayoutelements/CustomField.php(323): craft\web\View->namespaceInputs()
#14 /var/www/html/vendor/craftcms/cms/src/models/FieldLayout.php(858): craft\fieldlayoutelements\CustomField->formHtml()
#15 /var/www/html/vendor/craftcms/cms/src/web/View.php(1733): craft\models\FieldLayout->craft\models\{closure}()
#16 /var/www/html/vendor/craftcms/cms/src/models/FieldLayout.php(857): craft\web\View->namespaceInputs()
#17 /var/www/html/vendor/craftcms/cms/src/controllers/ElementsController.php(922): craft\models\FieldLayout->createForm()
#18 /var/www/html/vendor/craftcms/cms/src/controllers/ElementsController.php(400): craft\controllers\ElementsController->_prepareEditor()
#19 [internal function]: craft\controllers\ElementsController->craft\controllers\{closure}()
#20 /var/www/html/vendor/craftcms/cms/src/web/CpScreenResponseFormatter.php(125): call_user_func()
#21 /var/www/html/vendor/craftcms/cms/src/web/CpScreenResponseFormatter.php(50): craft\web\CpScreenResponseFormatter->_formatTemplate()
#22 /var/www/html/vendor/yiisoft/yii2/web/Response.php(1109): craft\web\CpScreenResponseFormatter->format()
#23 /var/www/html/vendor/craftcms/cms/src/web/Response.php(338): yii\web\Response->prepare()
#24 /var/www/html/vendor/yiisoft/yii2/web/Response.php(340): craft\web\Response->prepare()
#25 /var/www/html/vendor/yiisoft/yii2/base/Application.php(390): yii\web\Response->send()
#26 /var/www/html/web/index.php(12): yii\base\Application->run()
#27 {main} {"memory":2948056,"exception":"[object] (yii\\base\\ErrorException(code: 2): Undefined array key \"prevalidate\" at /var/www/html/vendor/craftcms/cms/src/elements/NestedElementManager.php:432)"} 
2024-08-06 20:58:13 [web.INFO] [application] Request context:

Craft CMS version

5.3.0 Pro (trial)

PHP version

8.3

Operating system and version

OSX 14.5

Database type and version

mysql 8

Image driver and version

No response

Installed plugins and versions

no plugins yet installed

@funkysoul funkysoul added the bug label Aug 6, 2024
@funkysoul
Copy link
Author

should have done a search first : #15485

@brandonkelly
Copy link
Member

Yep, fixed in 5.3.0.1.

@funkysoul
Copy link
Author

funkysoul commented Aug 6, 2024

Just updated to 5.3.0.2, the error is still there.
Screenshot 2024-08-06 at 23 13 36

UPDATE:
Ah interesting it only happens when the View Mode of the Field is set to "As an element Index"..

@brandonkelly
Copy link
Member

Doh, thanks, just tagged 5.3.0.3 with a fix for that.

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

No branches or pull requests

2 participants