Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
When add new brick to entity and forget to save brick before saving entity we get this error:
ErrorException: Undefined index: entities
#32 modules/contrib/bricks/modules/bricks_inline/src/Plugin/Field/FieldWidget/BricksTreeInlineWidget.php(40): handleError
#31 modules/contrib/bricks/modules/bricks_inline/src/Plugin/Field/FieldWidget/BricksTreeInlineWidget.php(40): massageFormValues
#30 modules/contrib/inline_entity_form/src/Plugin/Field/FieldWidget/InlineEntityFormComplex.php(576): extractFormValues
#29 core/lib/Drupal/Core/Entity/Entity/EntityFormDisplay.php(222): extractFormValues
#28 core/lib/Drupal/Core/Entity/ContentEntityForm.php(307): copyFormValuesToEntity
#27 core/lib/Drupal/Core/Entity/EntityForm.php(291): buildEntity
#26 core/lib/Drupal/Core/Entity/ContentEntityForm.php(147): buildEntity
#25 core/lib/Drupal/Core/Entity/EntityForm.php(276): submitForm
#24 core/lib/Drupal/Core/Entity/ContentEntityForm.php(137): submitForm
#23 [Anonymous function](0): call_user_func_array
#22 core/lib/Drupal/Core/Form/FormSubmitter.php(111): executeSubmitHandlers
#21 core/lib/Drupal/Core/Form/FormSubmitter.php(51): doSubmitForm
#20 core/lib/Drupal/Core/Form/FormBuilder.php(585): processForm
#19 core/lib/Drupal/Core/Form/FormBuilder.php(314): buildForm
#18 core/lib/Drupal/Core/Entity/EntityFormBuilder.php(48): getForm
#17 core/modules/node/src/Controller/NodeController.php(113): add
#16 [Anonymous function](0): call_user_func_array
Steps to reproduce:
- Install bricks and eck modules
- Create a brick field with reference to created eck entity "Brick".
- Go to node creation
- Click "Add new brick"
- Fill required fields and don't click "Create brick"
- Click "Save and publish"
Expected: Warning message or clean save.
Actual: ErrorException
Here the image of case:
https://www.dropbox.com/s/5t2nnxlrztqofo1/%D0%A1%D0%BA%D1%80%D0%B8%D0%BD...
Comment | File | Size | Author |
---|---|---|---|
#2 | bricks-undefined-entities-2883295-2.patch | 1.15 KB | mitsuroseba |
Comments
Comment #2
mitsuroseba CreditAttribution: mitsuroseba at FFW for FFW commentedPatch.
Comment #3
anydigital CreditAttribution: anydigital as a volunteer and at Highweb commentedThanks for reporting, Valerii!
Can you please give a bit more info to reproduce the exact issue? I see a different log when trying this in my setup.
What is a "Banner", a node field, or something different?
Comment #4
mitsuroseba CreditAttribution: mitsuroseba at FFW for FFW commentedUpdated, description.
Banner is bricky field with reference to eck entity "slider" with bundle "slider_wrapper".
Comment #5
anydigital CreditAttribution: anydigital as a volunteer and at Highweb commentedI the same case I have the following:
Why do you get ErrorException instead simple Notice?
Anyway we will merge the patch, but that's interesting. What is your PHP version?
Comment #6
anydigital CreditAttribution: anydigital as a volunteer and at Highweb commentedAha! http://php.net/manual/en/language.errors.php7.php
I have to upgrade PHP locally to prevent such issues in future.
Comment #8
anydigital CreditAttribution: anydigital as a volunteer and commentedMerged, available in 8.x-1.x-dev release!
Comment #9
anydigital CreditAttribution: anydigital as a volunteer and at Highweb commented