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.

Issue fork drupal-3186977

Command icon 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

BetoAveiga created an issue. See original summary.

betoaveiga’s picture

StatusFileSize
new1.8 KB
phenaproxima’s picture

I'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?

avpaderno’s picture

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8.9.x is in security support only.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.1.10 (June 4, 2021) and Drupal 9.2.10 (November 24, 2021) were the last bugfix releases of those minor version series. Drupal 9 bug reports should be targeted for the 9.3.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

nitesh624 made their first commit to this issue’s fork.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

scott_euser made their first commit to this issue’s fork.

scott_euser’s picture

Status: Active » Needs review
StatusFileSize
new1.88 KB

MR 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)

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs Review Queue Initiative, +Needs tests

Will 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.

Version: 9.5.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

odai jbr’s picture

StatusFileSize
new1.88 KB

Re-roll #12 for Drupal 10.3

anybody’s picture

Thanks, closely related to #2972846: Improve oEmbed exception logging I think. Any plans to finish this? Looks really helpful.

anybody’s picture

sivaji_ganesh_jojodae’s picture

+1 to mark this issue as duplicate in favor of #2972846.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.