Skip to content

Editing “Daily deviations” source fails #1062

Description

@jtojnar

How to reproduce

  1. Open settings page
  2. Click “add source” button
  3. Select type “deviantART - daily deviations” and click “save” button
  4. Click “edit” button on the newly-created spout
  5. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions