Problem/Motivation
When an oEmbed resource is fetched this message is shown:
"The provided URL does not represent a valid oEmbed resource."
This information is usually not enough to figure out the problem without looking at the logs.
Steps to reproduce
Attempt to save an entity that holds a Facebook video without an OAuth token.
Proposed resolution
A better message might be a message that not only explains what happened in the Drupal context but also what happened in the third-party context, and that information is sent in the message included in the response to the fetch request.
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | 3186977-15.patch | 1.88 KB | odai jbr |
| #12 | 3186977-show-third-party-message-on-oembed-resource-exception.patch | 1.88 KB | scott_euser |
| #2 | 3186977.patch | 1.8 KB | betoaveiga |
Issue fork drupal-3186977
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
betoaveigaComment #3
phenaproximaI'm not sure this is something we should do in core, and my reason is that the presence of detailed error information is not part of the oEmbed specification. It's cool that some providers do it, but in core we want to avoid special-casing particular providers.
Don't get me wrong: I'm in favor of this feature in general, but we'd need to do it in a generic, reliable way for it to be included in core. Maybe we can find some way to empower contrib modules to customize the exception before it's thrown? Or maybe they could decorate the resource fetcher, catch the ResourceException, analyze it as needed, and re-throw it with a different message?
Comment #4
avpadernoDrupal 8.9.x is in security support only.
Comment #12
scott_euser commentedMR updated for 9.5.x here https://git.drupalcode.org/project/drupal/-/merge_requests/4051/diffs, matching patch attached (given this thread seems to be a mix of patch and MR)
Comment #13
smustgrave commentedWill need test coverage as well.
Would recommend starting with 11.x. though as that's the current development branch. Code has to go there first to be backported later.
Comment #15
odai jbr commentedRe-roll #12 for Drupal 10.3
Comment #16
anybodyThanks, closely related to #2972846: Improve oEmbed exception logging I think. Any plans to finish this? Looks really helpful.
Comment #17
anybodyComment #18
sivaji_ganesh_jojodae commented+1 to mark this issue as duplicate in favor of #2972846.