- π¦πΊAustralia fenstrat Australia
This makes sense as an addition.
However rather than looking into the $form for the admin_label we should be able to load the block with something like
$block = $form_state->getFormObject()->getEntity()
and then use$block->getPlugin()->getPluginDefinition()['admin_label']
instead. Would be nice to add a quick test for this as well. - πΊπΈUnited States karlshea Minneapolis πΊπΈ
$form_state->getFormObject()
is an instance of Drupal\layout_builder\Form\AddBlockForm. There is nogetEntity()
available there, and the$block
instance variable is protected so we can't get at it from this class. - Status changed to Needs review
4 months ago 8:01pm 22 August 2024