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
Comment #2
jviitamaki commentedComment #3
jviitamaki commentedComment #4
ahebrank commentedThanks. 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?
Comment #5
jviitamaki commentedI 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.
Comment #6
ahebrank commentedAh, 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.
Comment #7
ahebrank commentedComment #9
richarddavies commentedNow that Drupal 11.4 has been released, can we get a new EVA release with this fix?
Comment #10
ahebrank commented3.1.2 should be available shortly.