- Issue created by @codechefmarc
- πΊπ¦Ukraine Panchuk Volyn, Lutsk
@codechefmarc thanks for your contribution.
I need to fix autotests first, but your MR will be reviewed and merged asap. - πΊπ¦Ukraine Panchuk Volyn, Lutsk
Quick update: I've rebased the MR with 2.0.x to re-run fixed tests. As expected no problem with this minor update, however, I would like to check if that possible to rewrite the piece of code using a better approach.
In case of failure, I will merge this MR as it is.
- Assigned to Panchuk
- Status changed to Needs work
4 months ago 4:33am 5 May 2025 - πΊπ¦Ukraine Panchuk Volyn, Lutsk
Related issue from core: https://www.drupal.org/project/drupal/issues/3522629 β¨ Provide access to protected properties in ConfigureSectionForm through getter methods Active
- Status changed to RTBC
about 1 month ago 2:15pm 17 July 2025 - π©πͺGermany Hydra
The patch looks ok to me. I would have used #access property on the render array to make this a bit more cleaner to read but thats just by gusto:
$form['layout_settings']['layout_builder_lock_info'] = [ '#markup' => '<p>' . t('Locks can be configured when the section has been added.') . '</p>', '#weight' => 100, '#access' => \Drupal::currentUser()->hasPermission('manage lock settings on sections'), ];
Maybe form decorator approach would make this even cleaner https://www.drupal.org/project/form_decorator β but this would be out of scope of this issue for sure.