I have enabled JSONAPI on my site and when creating content that has an Image field on it via Media, I get this error:
"POST /node/add/article?ajax_form=1&_wrapper_format=drupal_ajax HTTP/1.1" 500
Uncaught PHP Exception InvalidArgumentException: "The URI '/sites/default/files/anner%20%281%29.jpg' is invalid. You must use a valid URI scheme." at /mnt/www/html/vkajnwtoai/docroot/core/lib/Drupal/Core/Url.php line 280 request_id="v-b3d39744-1a0d-11e7-9f10-22000b5e357e"
If I uninstall jsonapi the error goes away
Core: 8.2.6
The following Media modules are enabled:
Media Entity Browser (entity_browser) Module Enabled
Media File entity (file_entity) Module Enabled
Media Image Effects (image_effects) Module Enabled
Media Media entity (media_entity) Module Enabled
Media Media entity document (media_entity_document) Module Enabled
Media Media entity image (media_entity_image) Module Enabled
Media Media entity Instagram (media_entity_instagram) Module Enabled
Media Media entity Twitter (media_entity_twitter) Module Enabled
Media Media entity video (media_entity_video) Module Enabled
Video Embed Field Video Embed Media (video_embed_media) Module Enabled
Field types Image (image) Module Enabled 8.2.6
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | 2867106--unrenderable-uri--7.patch | 1.2 KB | e0ipso |
Comments
Comment #2
meba commentedHere is another way of triggering the issue: Once you have some entity with a file attached go to example.com/file/[fid] - you will see the same error
Comment #3
wim leersCan you also reproduce this with the core REST module?
Comment #4
e0ipsoBlocking RC on this bug.
Comment #5
meba commented@Wim I cannot reproduce this with core REST. I used core REST on the same site and everything worked.
Comment #7
e0ipsoThis is the patch that fixed the issue. It turns out that t he hostname agnostic path introduced in https://www.drupal.org/node/2793809#comment-11592483 was never renderable as a URI.