How to reproduce
- Open settings page
- Click “add source” button
- Select type “deviantART - daily deviations” and click “save” button
- Click “edit” button on the newly-created spout
- Click “save” button
What happens
The client will send the following data to /source/16:
title=DeviantArt%3A+Daily+Deviations&tags%5B%5D=&filter=&spout=spouts_deviantart_dailydeviations&ajax=true
which will produce the following response:
an error occured: Invalid argument supplied for foreach()
[selfoss/vendor/bcosca/fatfree-core/base.php:2219] Base->error()
[selfoss/controllers/Sources.php:176] Base->{closure}()
[selfoss/vendor/bcosca/fatfree-core/base.php:1834] controllers\Sources->write()
[selfoss/vendor/bcosca/fatfree-core/base.php:1642] Base->call()
[selfoss/index.php:80] Base->run()
There will be no error in the user interface, the throbber will keep loading.
The following error is shown in the browser console:
SyntaxError: JSON.parse: unexpected keyword at line 1 column 1 of the JSON data [selfoss-events-sources.js:99]
What needs to be done
The Sources controller needs to handle missing params gracefully. It would be also nice if the client handled unexpected errors somehow.
How to reproduce
What happens
The client will send the following data to
/source/16:which will produce the following response:
There will be no error in the user interface, the throbber will keep loading.
The following error is shown in the browser console:
What needs to be done
The
Sourcescontroller needs to handle missingparamsgracefully. It would be also nice if the client handled unexpected errors somehow.