MediaDownload::getUrl is incompatible with the Linkit 6.0.2 Substitution Interface

Created on 8 December 2023, 7 months ago
Updated 13 June 2024, 15 days ago

Problem/Motivation

Attempting to create a new linkit media matcher and attempting to edit an existing linkit media matcher throws the following error:

Fatal error : Declaration of Drupal\media_entity_download\Plugin\Linkit\Substitution\MediaDownload::getUrl(Drupal\Core\Entity\EntityInterface $entity) must be compatible with Drupal\linkit\SubstitutionInterface::getUrl(Drupal\Core\Entity\EntityInterface $entity, $extra = null) in /var/www/docroot/modules/contrib/media_entity_download/src/Plugin/Linkit/Substitution/MediaDownload.php on line 71

Steps to reproduce

Drupal: 9.5.11
Linkit: 6.0.2
Media Entity Download: 8.x-2.2

Attempt to edit an existing linkit media matcher or create a new linkit media matcher with the above versions of core, linkit and media entity download.

Proposed resolution

The getUrl method from the src/Plugin/Linkit/Substitution/MediaDownload.php class is not compatible with the Substitution Interface provided by linkit 6.0.2. We need to update the function call to match what the interface expects.

I am attempting to write a patch now.

πŸ› Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada JayDarnell Guelph, Ontario

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

Merge Requests

Comments & Activities

Production build 0.69.0 2024