Details
-
Bug
-
Resolution: Fixed
-
High
-
None
-
4.2.x-dev, 4.1.5, 3.3.22
Description
Note: the reproducer Command is for v4, but I've seen it happen on v3 as well.
When a Content Type is created through the API in the background the Admin interface can fail to load with an error:
Notice: Undefined index: ct_62b42a3dcbf14
Steps to reproduce:
- Download the attached Command and place it in src/Command
- Open the browser and login as admin
- Go to Content -> Content Structure
- Run: php bin/console test:ct (and keep it running in the background)
- Refresh the Page in the browser
Expected:
Page loads without issues, with new Content Types visible
Actual:
Page fails to load with a PHP notice:
[2022-06-23T08:54:22.263617+00:00] request.CRITICAL: Uncaught PHP Exception ErrorException: "Notice: Undefined index: ct_62b42a3dcbf14" at /Users/mareknocon/Desktop/Sites/v3_2/vendor/symfony/form/ChoiceList/Factory/DefaultChoiceListFactory.php line 256 {"exception":"[object] (ErrorException(code: 0): Notice: Undefined index: ct_62b42a3dcbf14 at /Users/mareknocon/Desktop/Sites/v3_2/vendor/symfony/form/ChoiceList/Factory/DefaultChoiceListFactory.php:256)"} [] [2022-06-23T09:05:03.287239+00:00] request.CRITICAL: Uncaught PHP Exception Twig\Error\RuntimeError: "An exception has been thrown during the rendering of a template ("Notice: Undefined index: ct_62b42cbea8426")." at /Users/mareknocon/Desktop/Sites/v3_2/vendor/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/location_view.html.twig line 31 {"exception":"[object] (Twig\\Error\\RuntimeError(code: 0): An exception has been thrown during the rendering of a template (\"Notice: Undefined index: ct_62b42cbea8426\"). at /Users/mareknocon/Desktop/Sites/v3_2/vendor/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/location_view.html.twig:31)\n[previous exception] [object] (ErrorException(code: 0): Notice: Undefined index: ct_62b42cbea8426 at /Users/mareknocon/Desktop/Sites/v3_2/vendor/symfony/form/ChoiceList/Factory/DefaultChoiceListFactory.php:256)"} []
Example failure from CI:
https://github.com/ibexa/commerce/runs/6974510605?check_suite_focus=true
│ [2022-06-20T22:14:31.783635+00:00] request.CRITICAL: Uncaught PHP Exception ErrorException: "Notice: Undefined index: ezkeyword" at /var/www/vendor/symfony/form/ChoiceList/Factory/DefaultChoiceListFactory.php line 256 {"exception":"[object] (ErrorException(code: 0): Notice: Undefined index: ezkeyword at /var/www/vendor/symfony/form/ChoiceList/Factory/DefaultChoiceListFactory.php:256)"} []