This module takes whatever is pasted into the source field and uses Guzzle to fetch it without any error handling. So if the request 404's, the user will just get the 500 error page.

Ideally media entity would provide a way to set a form error when the field data cannot be retrieved, but I don't think it's setup to handle that.

The least we can do is catch any Guzzle exception, return FALSE in getField(), set an error message, and log the exception.

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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bkosborne created an issue. See original summary.

bkosborne’s picture

Priority: Normal » Major
Status: Active » Needs review
FileSize
1.8 KB
bkosborne’s picture

Better - this handles all transfer exceptions from Guzzle and logs the error.

  • bkosborne committed fa632f0 on 8.x-1.x
    Issue #2834437 by bkosborne: Error handling when Facebook URL is not...
bkosborne’s picture

Status: Needs review » Fixed

  • bkosborne committed fa632f0 on 8.x-2.x
    Issue #2834437 by bkosborne: Error handling when Facebook URL is not...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

arun898’s picture

I am facing the issue even with latest version , while creating media item it accepts invalid URL like test 123, http://facebook.com/12@34
Constraint validation does not seems to work.
Can anyone help here.