Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#3 | error-handling-invalid-url-2834437-3.patch | 1.96 KB | bkosborne |
#2 | error-handling-invalid-url-2834437.patch | 1.8 KB | bkosborne |
Issue fork media_entity_facebook-2834437
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
bkosborneComment #3
bkosborneBetter - this handles all transfer exceptions from Guzzle and logs the error.
Comment #5
bkosborneComment #8
arun898 CreditAttribution: arun898 commentedI 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.