Problem/Motivation

Steps to reproduce

At least on Drupal 11.4@RC unchecked link_display display setting causes following error.

TypeError: Drupal\views\ContextualLinksHelper::addLinks(): Argument #3 ($displayId) must be of type string, null given, called in /app/public/core/modules/views/views.module on line 85 in Drupal\views\ContextualLinksHelper->addLinks() (line 78 of /app/public/core/modules/views/src/ContextualLinksHelper.php).

#0 /app/public/core/modules/views/views.module(85): Drupal\views\ContextualLinksHelper->addLinks(Array, 'view', NULL, NULL)
#1 /app/public/modules/contrib/eva/eva.module(229): views_add_contextual_links(Array, 'view', NULL)
#2 [internal function]: template_preprocess_eva_display_entity_view(Array, 'eva_display_ent...', Array)

Proposed resolution

Add empty check before adding links.

Comments

jviitamaki created an issue. See original summary.

jviitamaki’s picture

Title: Missing unchecked link_display setting causes error » Unchecked link_display setting causes error
jviitamaki’s picture

ahebrank’s picture

Thanks. I think we should probably go ahead and remove the deprecated helper here and replace with the service (see https://www.drupal.org/project/drupal/issues/2571679). Are you able to make that change?

jviitamaki’s picture

I was initially going to fix the deprecation but it breaks backwards compatibility so it would require a major release or version checks in code.

Anyway here's the patch with deprecation fixed.

ahebrank’s picture

Ah, true, didn't realize the service was brand new. OK, will go with the first patch and figure out what to do about the service later.

ahebrank’s picture

Status: Active » 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.

richarddavies’s picture

Now that Drupal 11.4 has been released, can we get a new EVA release with this fix?

ahebrank’s picture

3.1.2 should be available shortly.

Status: Fixed » Closed (fixed)

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