Fix an Error when using Layout Builder permissions with the Section Library module

Created on 20 May 2024, 6 months ago
Updated 26 May 2024, 6 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. Login with user which has no permissions 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

Needs review

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