Problem/Motivation
File uploads that contains spaces return an error message that the file is not valid.
Steps to reproduce
1. Install json_form_widget.
2. Create a JSON Form field on a content type.
3. Use a schema that defines a property with "format": "uri". # Do this so it's DKAN agnostic
4. In the widget, type a filename with a space into that field (e.g., "I want to upload this file.pdf").
Attempt to save the node.
Result: The field displays an "Invalid URL" error and prevents saving.
Proposed resolution
Update the valueHandler() to look for fields that represent generic URL/URI, Drupal internal stream wrappers like "public://", "private://", or schema definitions that use uri, url, or data-url formats.
Remaining tasks
Review merge request, which hopefully resolves or at least creates a muse for the solution to this specific issue.
Test this with your own use application and use case.
User interface changes
MR includes a plugin so that you can easily assign the JSON Form Widget to a field in a content type.
API changes
None.
Data model changes
URL and URI strings will now be stored in their encoded formats (""%20") first instead of actual spaces.
Issue fork json_form_widget-3589259
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 #3
chri5tia commentedComment #4
chri5tia commentedComment #8
chri5tia commentedClosed MR11 in favor of MR12 for a better description.