- Issue created by @yobottehg
The issue is related to the fix from issue 3354873 π Direct URL to media file entity does not work because relative URL does not pass URL path validation Fixed
The media entity download should return a "Url" object instead of a "GeneratedUrl" object that does not have the toString method.
I see if i can make a patch.
- π¨π¦Canada deviantintegral
We're running into this as well, and the module was compatible with Linkit 6.0.0. However, 6.0.1. introduced a compatibility break in https://www.drupal.org/project/linkit/issues/3354873 π Direct URL to media file entity does not work because relative URL does not pass URL path validation Fixed and changed
\Drupal\linkit\SubstitutionInterface::getUrl
's return type.I think this should probably be fixed in Linkit, since it would break other modules or custom code implementing that interface.
Here is a quick patch that fixes the issue on my site.
Waiting the decision from linkit maintainers.- πΊπΈUnited States mark_fullmer Tucson
Waiting the decision from linkit maintainers.
Thanks, folks. I'm working on changes in Linkit which will check the @return type on the implementing code and return either \Drupal\Core\Url or \Drupal\Core\GeneratedUrl to match, along with a deprecation notice for GeneratedUrl.
With that code in place in the next releases of Linkit, media_entity_download can proceed with 6.x compatibility, and should move toward expecting a Drupal\Core\Url as permits.
- πΊπΈUnited States mark_fullmer Tucson
I've provided a patch for Linkit on π Direct URL to media file entity does not work because relative URL does not pass URL path validation Fixed that I've successfully tested with the current version of Media Entity Download.
- Status changed to Postponed: needs info
about 1 year ago 11:58am 19 October 2023 - π¬π·Greece giorgosk Chios, Greece π¬π·
Seems that this might be obsolete after the latest releases of linkit 6.0.x and 6.1.x
https://www.drupal.org/project/linkit/issues/3354873 π Direct URL to media file entity does not work because relative URL does not pass URL path validation Fixed - Status changed to Needs work
about 1 year ago 8:50pm 19 October 2023 - π¨πSwitzerland berdir Switzerland
Linkit has a BC layer now, but it still makes sense to use the new API eventually, that does mean we need to require a version of linkit that supports that new API though.
- πͺπΈSpain penyaskito Seville π, Spain πͺπΈ, UTC+2 πͺπΊ
We are using ckeditor4+linkit 6.1.2 and media_entity_download 2.2.0 and we are facing an issue with a duplicated inline (media/2/download?inline?inline) when viewing the edited content. I reproduced this too with ckeditor5, so it's not a ckeditor issue.
The BC code that was added to linkit does:
$element->setAttribute('href', $url->getGeneratedUrl() . $query . $anchor);
but the generated url already includes
?inline
.If I use #4, then the problem changes to having
?inline=
(see equals sign).I think we should do #4, but still we will need to figure out a follow-up on linkit. Then it would run:
$parsed_query = []; parse_str($href_url['query'], $parsed_query); if (!empty($parsed_query)) { $url->setOption('query', $parsed_query); }
And that generates
['inline' => '']
instead of['inline' => NULL]
. - Status changed to Needs review
about 1 year ago 1:24am 8 November 2023 - last update
about 1 year ago 3 pass - πͺπΈSpain penyaskito Seville π, Spain πͺπΈ, UTC+2 πͺπΊ
Created π If a suggestion has a NULL in query string, LinkitFilter replaces with an empty string Needs review for fixing that on linkit side. Reviews appreciated.
I'm marking this as NR too as #4 works for me. - last update
10 months ago 2 fail - last update
10 months ago 2 fail - First commit to issue fork.
- Status changed to Needs work
7 months ago 8:48pm 23 April 2024 - π¨πSwitzerland berdir Switzerland
Still needs work per #8, dependency version information needs to be updated to require a linkit version that supports this API.
- π¨πSwitzerland berdir Switzerland
It would be really neat to add a linkit integration test as well, we can posibly copy paste something from linkit as a starting point, that would help catch integration issues early and also help with the current phpstan issue about the unknown class when we add a require-dev for linkit.
- π¨πSwitzerland berdir Switzerland
Right now only linkit 7.x with the removed BC layer is D11 compatible, so raising priority, as without this, this will fail with linkit 7.x/D11.
- πͺπ¨Ecuador LeonelEnriquez98
I rerolled the patch #4 β¨ Compatibility with Linkit 6 Needs work to be compatible with version
8.x-2.3
- π¨πSwitzerland berdir Switzerland
Patches are discouraged, update the merge request instead. Did rebase that now and added the requested conflict definition to composer.json.
- Status changed to Needs review
4 months ago 8:33am 8 July 2024 - π¨πSwitzerland berdir Switzerland
Tested in our projects, works well. Created π Linkit integration tests Active . Merged.
- Status changed to Fixed
3 months ago 8:11am 11 August 2024 -
berdir β
committed 9865bbe5 on 8.x-2.x
Issue #3391565 by fabianfiorotto, berdir, olivier.br, LeonelEnriquezP,...
-
berdir β
committed 9865bbe5 on 8.x-2.x
Automatically closed - issue fixed for 2 weeks with no activity.