Closed (fixed)
Project:
Linkit
Version:
8.x-5.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
22 Jul 2019 at 21:25 UTC
Updated:
29 Nov 2019 at 01:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
pingevt commentedLooks like when the related issue was fixed there was just a missed return value and automatically goes to the fallback of the url for the media entity.
Comment #3
pingevt commentedLooks like this is a more complicated issue than I first thought...
For Core 8.7.x in media, they added a checkbox in the settings (/admin/config/media/media-settings) to allow /media/{id}. It appears this should be unchecked for new site. I'm not entirely sure why it is checked on my site. I originally thought it was setting that to true on old sites upgrading, but I believe it remains unchecked on old site.
The problem as described in the related issue I don't think is 100% accurate. depending on that setting the canonical url is different. If checked, /media/{id}, if not checked, /media/{id}/edit.
So, I believe this patch works if that setting is set for backwards compatibility. If it is unchecked, current code works fine.
At the moment, I'm not 100% positive how this should be handled in this module. If a maintainer or others want to weigh in, I'm more than happy to work on patches. Or if I'm completely off base on this error please let me know.
My main issue is my old and new content in the wysiwyg still creates links as /media/{id}. If I change the setting, all my content (thousands of nodes) will now have bad links. I can easily do a little DB manipulation, but I'd rather not... if there is a better solution.
Comment #4
larowlan+1 I think this is just a bug in linkit.
Comment #5
alisonPatch works for me, on LinkIt 8.x-5.0-beta9 -- thank you!!
Comment #6
jddh commented+1 — thanks team!
Comment #7
dench0Yea, it is for sure bug in linkit code.
Comment #8
phuang07 commentedThe patch work! thanks.
Comment #9
kasey_mk commentedThanks, works for me, even though I do have "Standalone media URL" checked on /admin/config/media/media-settings
Comment #10
acbramley commentedThe fact this went unnoticed tells me there's probably not sufficient test coverage? Shouldn't we add it here?
Comment #11
acbramley commentedHere's an updated patch with test modifications.
Comment #12
acbramley commentedFailure seems unrelated, HEAD is also failing https://www.drupal.org/pift-ci-job/1442921
Comment #14
anonThanks for the patch and the test patch.