Problem/Motivation
Currently the editor user has no feedback if the URL entered to the embed dialog box is valid or not. If the embed object gets an empty response to ::getCode(), we are silently creating the wrapper with an empty content. The problem with this is that it's impossible to the end user to edit the wrapper back inside the CKEditor preview, and change the URL to a new one. The only solution is to view the source, and delete / modify the code from there.
Proposed resolution
if $info->getCode() returns empty, put an informative string inside the wrapper, allowing users to click on it and modify / delete it without having to go into the source.
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | url_embed-non_embeddable_urls-2761187-11.patch | 745 bytes | loze |
| #9 | urlembed-non-embeddable-urls-2761187-9-d8.patch | 823 bytes | navneet0693 |
| #2 | improve-handling-of-non-embeddable-URLs-2761187-2.patch | 613 bytes | marcoscano |
Issue fork url_embed-2761187
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
marcoscanoSomething like this would be enough to improve the user experience with these URLs.
Comment #3
cassien commentedThat little hack saved my day.
I was pretty frustrated about the urls non embedable wich were not displayed.
I just replaced the dialog to simply show the url with a link
$url_output = !empty($url_output) ? $info->getCode() : '<a href="'.$url.'">'.$url.'</a>';Comment #4
socialnicheguru commentedConflicts with https://www.drupal.org/project/url_embed/issues/2871744
Comment #5
jaapjan commentedWhat is the status of this exactly?
URL Embed is still in a 2-year old alpha1 phase. It would be nice to move this forward.
Although the patch from comment 2 works, I propose to just display the old URL instead of the text.
E.g. a fallback like this would be sufficient in my case:
Comment #6
justcaldwellThis is solved nicely in #2864302: Add validation to ensure URL is embeddable, which has an RTBC patch. Can this be closed as a duplicate?
Comment #7
justcaldwellComment #8
navneet0693 commentedThat issue is just adding a validation for workaround for avoiding users to not enter the URL which non-embeddable and that does not solves the problem. The problem is bigger than that.
Comment #9
navneet0693 commentedComment #10
Yuri commented(using D9.0.3) the patch #9 above gives:
Comment #11
loze commentedThe patch in #9 is missing the use statements for Link and Url mentioned in #5
However, I don't think this filter should convert the url to a link. If you want it displayed as a clickable link you can run the core "convert urls to links" filter after this one.
Here is a patch.
Comment #13
strykaizerPushed branch fixes this issue by not altering (nor wrapping) urls with data-embed-url.
This allows to use core "Convert URLs into links" filter triggering after this filter without issues.
Comment #15
mark_fullmerComment #17
mark_fullmerThe code change in the MR makes perfect sense, and I think it also reflects how the code should have been implemented in the first place, rather than an affordance for an edge case. In that sense, I agree with the comment in #8, arguing for this in favor of #2864302: Add validation to ensure URL is embeddable . Merging. Thanks, everyone!