Errors when using with modules that alter a section's contextual menu

Created on 16 January 2020, over 5 years ago
Updated 14 July 2025, about 9 hours ago

I'm trying to use this module in conjunction with the Layout Builder Modal module, but I'm getting the following error when trying to load a node's layout page: "Argument 1 passed to Drupal\Component\Utility\UrlHelper::buildQuery() must be of the type array, null given, called in /var/www/web/core/modules/contextual/contextual.module on line 180". I believe it's happening because this module (lb_ux) is moving the contextual links to a different position in the render array when it's building the administrative section, and then the layout_builder_modal module is trying to alter the non-existent contextual links at it's prior location.

I'm not sure what the best approach to resolving this would be, but one I've come up with is to move the code currently in LayoutBuilderUX::buildAdministrativeSection() to a preprocess function, and then altering the weight of this preprocess function so that it runs last. This way, other modules can still adjust contextual links.

πŸ› Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States rromore

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024