Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
0.5
-
None
Description
Adding a file to a media block before setting other fields results in an error being thrown. This is likely because simply adding a block to the story won't result in the story being saved to the server, indeed not until one of the text fields is updated, therefore there isn't a story ID to associate the file with while saving it to the server. Without fixing this bug, the only way around it is to clear the browser's local storage, which an author may not know to do nor know how to do.
A solution would be to have the story save to server when the first block is added, or on the first metadata change. This may require adjusting the configuration of the model listener that's currently (at time of filing) set up for creating stories on the first model change.
To reproduce:
1. Go to the Story Edit page
2. Add an image block
3. Click "Upload Image"
4. Pick a file to upload
Expected
The image uploads successfully and the preview is shown in the block editor
Actual
The uploader returns an error: Uploading failed: Error retrieving story with ID null