Skip to content

Commit

Permalink
Only show warning to admins.
Browse files Browse the repository at this point in the history
  • Loading branch information
kepol committed Jan 31, 2025
1 parent 4cbd423 commit 6ac1d7b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion quant.module
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ function quant_preprocess_views_view(array &$variables) {
function quant_node_view(array &$build, EntityInterface $node, EntityViewDisplayInterface $display, $view_mode) {

// If there are any webforms in layout_builder, add warning for admins.
if ($node->hasField('layout_builder__layout') && !$node->get('layout_builder__layout')->isEmpty()) {
if ($node->hasField('layout_builder__layout') && !$node->get('layout_builder__layout')->isEmpty() && \Drupal::currentUser()->hasRole('administrator')) {
$sections = $node->get('layout_builder__layout')->getSections();

foreach ($sections as $section) {
Expand Down

0 comments on commit 6ac1d7b

Please sign in to comment.