Error when using permissions with section library module

Created on 20 May 2024, 11 months ago

Problem/Motivation

When applying permissions for section operations like using Layout Builder Advanced Permissions β†’ module, there is an error appears that the $param variable not defined.

Warning: Undefined variable $params in Drupal\section_library\SectionLibraryRender::preRender() (line 120 of modules/contrib/section_library/src/SectionLibraryRender.php).

Steps to reproduce

  1. Install and enable the Layout Builder Advanced Permissions module and its submodule Layout Builder Advanced Permissions Global.
  2. Masquerade as a "user" that doesn't have permission to add or configure a section.
  3. Open any layout builder page, and check the error.

Proposed resolution

We need to set route parameters without using any existing route parameters ($param variable), so we can use the current URL route to get these values instead.

'section_storage_type' => $params['section_storage_type'],
'section_storage' => $params['section_storage'],
'delta' => $params['delta'],
πŸ› Bug report
Status

Active

Version

1.1

Component

Code

Created by

πŸ‡―πŸ‡΄Jordan n.ghunaim Amman - Jordan

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024