- Issue created by @drclaw
- Status changed to Postponed
9 months ago 11:29pm 27 February 2024 - 🇧🇷Brazil carolpettirossi Campinas - SP
Thanks @drclaw! You patch worked for me and saving me some time debugging and trying to figure out the issue.
Apologies in advance for posting a patch that is only needed if you have another core patch applied. I'm hoping it will help someone else facing the same issue and maybe can be considered if and when the core patch is accepted 🙏
If anyone, like me, has been using ✨ Add reusable option to inline block creation Needs review for reusable Layout Builder blocks, you'll probably notice the following error when trying to add a content block:
Call to a member function getSection() on null in Drupal\layout_builder\Form\ConfigureBlockFormBase->getCurrentSection()
This is because the patch in question adds a first step to the form to allow the user to choose an Inline vs Reusable block. This change delays setting the section storage and component until step two, but Layout Builder Block's form alter doesn't know about it so it errors out when trying to run `$form_object->getCurrentComponent()`.
The attached patch simply checks that we're on step 2 of the "Add Block" form before running the form alter code.
Note: This patch is only needed if you are using ✨ Add reusable option to inline block creation Needs review . Do not apply this patch if you don't have that core patch applied or the styles won't be applied!
Postponed
1.1
Code
Thanks @drclaw! You patch worked for me and saving me some time debugging and trying to figure out the issue.