Problem/Motivation

When installing this module on a Drupal 11.2.x version, the website crashes when using the "Add block" link.
#3507651: Error on "Add block" link already fixed Drupal 11 support, but there was a change for 11.2.x. Drupal 11.2.x is now using a construct and expects the calls to the class to have parameters => https://git.drupalcode.org/project/drupal/-/blob/11.2.x/core/modules/nav...

Steps to reproduce

  • Install Drupal 11.2.x
  • Go to /admin/config/user-interface/navigation-block
  • Click "Add block" in sidebar
  • Error is triggered in navigation_extra_plugin_filter_block__layout_builder_alter on $navigation_hooks = new \Drupal\navigation\Hook\NavigationHooks(); where the class expects parameters in Drupal 11.2.x

Proposed resolution

Expand the DeprecationHelper to support Drupal 11.1 and provide the default with parameters.

Remaining tasks

Provide and review MR

User interface changes

N/A

API changes

N/A

Data model changes

N/A

CommentFileSizeAuthor
#6 error-on-drupal-11.3.3-without-patch.png83.12 KBdtfabio
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

steven.d created an issue. See original summary.

tim-diels’s picture

Assigned: Unassigned » tim-diels

tim-diels’s picture

Assigned: tim-diels » Unassigned
Status: Active » Needs review

Added first draft of code. But feels not ok to have a BC check inside a BC check. Never done this before so don't know if thats the correct way to do it.

Pipelines fail not directly of my code changes, the issues were there before.

dtfabio’s picture

Assigned: Unassigned » dtfabio
dtfabio’s picture

Assigned: dtfabio » Unassigned
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new83.12 KB

Hi Tim,

I tested the code change on three different Drupal instances and it worked on all three.

Drupal core versions: 10.3.14, 10.6.3 and 11.3.3
PHP versions: 8.3.30 (10.3) and 8.4.18 for the newer core versions.
Database version: MariaDB 11.8.6

Without the patch, I get the following error on core version 11.3.3:

Error when trying to add a block on Drupal version 11.3.3

After adding the patch, the error disappeared and it is now possible to add a block.

So I think this ticket can be moved to RTBC.

Greetings,

Fabio

  • tim-diels committed 4da85541 on 1.0.x
    fix: #3563935 Error on "Add block" link in Drupal 11.2.x
    
    By: steven.d...
tim-diels’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.