Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot save any data files after new markdown editor. #605

Closed
tech4him1 opened this issue Sep 15, 2017 · 1 comment
Closed

Cannot save any data files after new markdown editor. #605

tech4him1 opened this issue Sep 15, 2017 · 1 comment
Assignees
Milestone

Comments

@tech4him1
Copy link
Contributor

tech4him1 commented Sep 15, 2017

- Do you want to request a feature or report a bug?
bug

- What is the current behavior?
After #254 (the new editor) was added, any data file on the example site (test-repo backend), whether it contains a markdown field or not, can no longer be saved. The console error is:

Uncaught TypeError: Cannot read property 'reduce' of undefined
    at runSerializer (serializeEntryValues.js?6de9:31)
    at serializeValues (serializeEntryValues.js?6de9:62)
    at eval (entries.js?c1a9:279)
    at eval (index.js?8a13:9)
    at eval (bindActionCreators.js?b33a:3)
    at eval (EntryPage.js?2e7b:100)

Related to #575 (cc/@erquhart).
- If the current behavior is a bug, please provide the steps to reproduce.

  1. Run the example site, or any site with a config with a data file like this: https://github.com/netlify/netlify-cms/blob/6af9a3155c794cec697bc0722907c738200e292b/example/config.yml#L29-L46.
  2. Open the CMS and edit the data file (settings.json in the example).
  3. Try to save the entry.

- What is the expected behavior?
The entry should be saved.

@tech4him1
Copy link
Contributor Author

tech4him1 commented Sep 15, 2017

Tracing this back, at this line collection.get('fields') is resolving to undefined:
https://github.com/netlify/netlify-cms/blob/ac8df984074fec231a470ad2aaca5fe3299049f0/src/actions/entries.js#L279

I'm thinking this is because data file collections, instead of having fields directly, have files which then have their own fields. The interesting thing is that as far as I know this worked before, so I'm not exactly sure what changed.

@tech4him1 tech4him1 changed the title Cannot save data files after #254. Cannot save any data files after new markdown editor. Sep 15, 2017
@tech4him1 tech4him1 added this to the 1.0.0 milestone Sep 15, 2017
@erquhart erquhart self-assigned this Sep 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants