Add media edit link to OEmbed error message

Created on 14 February 2024, about 1 year ago

Problem/Motivation

When you try to reference a media object to an entity it sometimes throws the error "Could not retrieve the oEmbed resource.".
This is because there is a media entity in the overview that contains a reference to an external video (ex. youtube, vimeo, ..) that could not be retrieved. This message is too ambiguous and does not tell the user which media entity is missing.

Steps to reproduce

Proposed resolution

Add the edit link into the error message so the user can find and update the media entity correctly.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Feature request
Status

Active

Version

9.5

Component
Media 

Last updated 1 day ago

Created by

🇧🇪Belgium wouter waeytens

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @wouter waeytens
  • Status changed to Needs review about 1 year ago
  • Drupal 9 is end-of-life. I am moving this to the feature branch.

  • last update about 1 year ago
    Custom Commands Failed
  • Status changed to Needs work about 1 year ago
  • Moving to needs works as a patch has a CCF error.

  • First commit to issue fork.
  • 🇮🇳India shalini_jha

    I have added a patch against 11.x . please review

  • Status changed to Needs review about 1 year ago
  • Status changed to Needs work about 1 year ago
  • 🇺🇸United States smustgrave

    New features need test coverage

  • 🇺🇸United States yospyn

    Confirming #8 worked for me on core 10.2.3. The message went from "Could not retrieve the oEmbed resource." to something much more helpful, "An error occurred: Could not retrieve the oEmbed resource. Title of video here".

    When you fix the media entity, the message stops showing. Thanks!

  • 🇸🇳Senegal diaodiallo

    A new patch for 10.3.x

  • First commit to issue fork.
  • Merge request !9922Edit error and fix test → (Open) created by oily
  • Pipeline finished with Failed
    7 months ago
    Total: 856s
    #318611
  • 🇬🇧United Kingdom oily Greater London

    Testing this issue in a local Drupal 11.x site. see screenshot showing how a YouTube video saved in a node when the video was publically available but has since been deleted on YouTube is handled.

    A message similar to this, also set in an autogenerated error thumbnail image is displayed if the setting for a YouTube video is changed from 'public' to 'private'. In neither case is a message displayed on the page.

    A message IS displayed if the user, for example, tries to edit the url to a non-existent url and then save the node.

  • 🇬🇧United Kingdom oily Greater London
  • 🇬🇧United Kingdom oily Greater London
  • 🇬🇧United Kingdom oily Greater London
  • 🇬🇧United Kingdom oily Greater London
  • Pipeline finished with Canceled
    7 months ago
    Total: 640s
    #318763
  • 🇬🇧United Kingdom oily Greater London
  • Pipeline finished with Failed
    7 months ago
    Total: 1696s
    #318769
  • Pipeline finished with Success
    7 months ago
    Total: 2776s
    #318778
  • 🇬🇧United Kingdom oily Greater London

    The error message has been replaced by: 'Check the url. It does not correspond to any remote oEmbed resource.' The existing test has been updated to assert the new error message. All tests are green. Changing to 'Needs review'.

  • 🇬🇧United Kingdom oily Greater London
  • 🇺🇸United States smustgrave

    Left a comment on the MR.

  • 🇬🇧United Kingdom oily Greater London
  • 🇬🇧United Kingdom oily Greater London

    @smustgrave The original description was that the url needs to be included in the error message. After reproducing the error I discovered that the description is not clear enough. What in fact happens is that according to form validation functionality the Oembed resource field is highlighted in red. See Oembed url highlighted in red in combination with the message being printed in the standard message position of the page.

    This led me to think that either the existing form validation mechanism which is similar to many other form libraries out there on the web is not adequate and so form validation itself needs to be fixed, or it does its job in this case.

    From there I concluded that the problem is not that the url is not printed in the error message which would seem like unnecessary duplication, since the url is contained in the field that has been highlighted in red, rather the problem is that the error message itself is not clear. In as few words as possible I have tried to rectify the message. The existing message does not say what action needs to be taken. The new message makes it clear IMO that it is the url that is at fault. Therefore the url should be checked as it appears not to exist.

  • 🇬🇧United Kingdom oily Greater London
  • 🇬🇧United Kingdom oily Greater London
  • 🇺🇸United States smustgrave

    FYI this "update" believe only benefits a sighted user who can see the entire form.

  • 🇬🇧United Kingdom oily Greater London

    There is a problem with the existing description. I have made some edits to the description already but this one remains.

    'When you try to reference a media object to an entity it sometimes throws the error...'

    This sounds to me like the error occurs from time to time randomly. But that is not the case. When the user is trying to add a YouTube video (i have not tested with Vimeo) in the background httpclient validates the url by issuing a GET request to that Url. If the Url does not correspond to a currently publically available YouTube video as proven by the result of the GET request, validation fails and the error message appears.

    On the other hand, when a YouTube video has been successfully added as an Oembed resource in the media library and then inserted into a node but the video is then deleted or made private by the YouTube owner, then this error is shown in the node

  • 🇬🇧United Kingdom oily Greater London
  • 🇬🇧United Kingdom oily Greater London
  • 🇬🇧United Kingdom oily Greater London

    I have done further manual UI testing of the error message(s). It is clear that the description is confusing and misleading. I have made further edits.

  • 🇬🇧United Kingdom oily Greater London
  • 🇬🇧United Kingdom oily Greater London
  • 🇮🇳India shalini_jha

    I have checked the related issues.

  • 🇺🇸United States smustgrave

    Believe feedback has been addressed here.

  • 🇳🇿New Zealand quietone

    This is changing user facing test so tagging for Usability. Also, this should have before and after screenshots available from the issue summary.

    I used the steps to reproduce in the issue summary and was not able to reproduce the error message. I could when this step, Add a Media Entity Reference field to the Article content type, is changed to Add a Media Entity field to the Article content type.

    In #29 it was suggested to use an existing string, "The provided URL does not represent a valid oEmbed resource.' Why was that not discussed? That makes much more sense to me than introducing another string.

  • 🇬🇧United Kingdom oily Greater London

    @quietone Thank you for reviewing and adding the tags to help define the tasks now remaining.

    I am supportive of the idea of using the existing message that I identified in #29.

    Once the issue summary is redone including the screenshots perhaps a discussion should be held on the final wording of the message.

Production build 0.71.5 2024