- πΊπΈUnited States mark_fullmer Tucson
Just noting Wim's comment in the related issue in Drupal core ( https://www.drupal.org/project/drupal/issues/3317769#comment-14989414%2351 β¨ Drastically improve Drupal's default linking experience in text fields Needs work ):
rather than
pretending to link to /media/3/edit, which is blatantly wrong, I'm now
generating an /entity URI/ instead: entity:media/3. That's not familiar for
the end user, but it's equally recognizable, it just doesn't set the wrong
expectations. So it's IMHO a net improvement. - πΊπΈUnited States bvoynick
Here's an alternative workaround that adds media-specific logic to LinkitHelper::getEntityFromUserInput rather than revert the change to the saved URL.
Like the reversion patches, this too is probably not the approach the module should take long term, but it will help work around this problem on sites with the canonical route turned off.
- last update
almost 2 years ago Composer require failure - πΊπΈUnited States mark_fullmer Tucson
This is a solid short-term workaround in #7. I think this bug report is effectively a duplicate of where π Linkit filter does not replace internal node reference with alias Active has ended up.
The longer-term solution is probably going to be along the lines of https://www.drupal.org/project/linkit/issues/3354873#comment-15209028 π Direct URL to media file entity does not work because relative URL does not pass URL path validation Fixed . If you agree and would like to help with finalizing that work, the community would appreciate it!
- π¨πSwitzerland berdir Switzerland
This still breaks entity usage and media detection, because /media/ID is not detected as a routed Url object in \Drupal\entity_usage\UrlToEntity::findEntityIdByRoutedUrl.
#7 won't help with that, #6 would but that seems like a bigger change. FWIW, I don't really agree with the way Wim put it, "which is blatantly wrong". It's not wrong. media/ID/edit *is* the canonical link to a media in that case. We're not actually linking to media/ID either usually, so all 3 options really are quite confusing.
I suppose for UX, the most sensible option would be some kind of managed UI like select2 but that's obviously complex and comes with its own accessibility issues.
For now, just converted my previous patch in a MR.