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

fix(netlify-cms-core): fix identifier field validation #1907

Merged
merged 2 commits into from
Nov 27, 2018

Conversation

slathrop
Copy link
Contributor

@slathrop slathrop commented Nov 24, 2018

Describe the bug
Follow-on to #1543 and #1878. Attempting to use the identifier_field feature introduced in 2.2.0 with an identifier that is not all lowercase causes the backend (On Save) error: 'Collection must have a field name that is a valid entry identifier, or must have identifier_field set'.

To Reproduce
Specify an identifier_field that has uppercase characters and then attempt to create and save an entry.

Expected behavior
The CMS saves without throwing an error.

Minor Refactor
Also fix spelling of local variable in the selectIdentifier function.

@verythorough
Copy link
Contributor

verythorough commented Nov 24, 2018

Deploy preview for netlify-cms-www ready!

Built with commit c72540d

https://deploy-preview-1907--netlify-cms-www.netlify.com

@erquhart
Copy link
Contributor

@slathrop looks great, thanks for this 👍 Can you push a quick fix for the formatting so the test build passes? Just requires running yarn format locally and committing/pushing the result.

@slathrop
Copy link
Contributor Author

@erquhart Gotcha. Typo in commit message, sorry, but formatting corrected! 👍 ...my pleasure. Thanks for all the great work on 2.x!

@verythorough
Copy link
Contributor

Deploy preview for cms-demo ready!

Built with commit c72540d

https://deploy-preview-1907--cms-demo.netlify.com

@erquhart erquhart merged commit d5f4c99 into decaporg:master Nov 27, 2018
LoicMahieu added a commit to LoicMahieu/netlify-cms that referenced this pull request Nov 29, 2018
* official/master: (42 commits)
  chore: improve publish scripts
  Publish
  chore: test before publishing
  chore(netlify-cms-core): upgrade react-dnd to 7.x (decaporg#1922)
  chore(netlify-cms-widget-text): upgrade to react-textarea-autosize 7.x (decaporg#1921)
  chore(netlify-cms-core): upgrade to react-waypoint 8.x (decaporg#1920)
  fix(backend): use singular label in custom commit message (decaporg#1917)
  docs: add GAE-specific oAuth client (decaporg#1918)
  fix(netlify-cms-widget-text): set correct font family (decaporg#1916)
  chore(netlify-cms-core): upgrade redux and related dependencies (decaporg#1914)
  chore(dependencies): bump npm-run-all (decaporg#1913)
  fix(netlify-cms-core): fix identifier field validation (decaporg#1907)
  docs: improve widget custom validation sample (decaporg#1911)
  improvement(backends): changes for registerBackend compatibility (decaporg#1880)
  fix(netlify-cms-core): fix prop-types warnings (decaporg#1906)
  fix(a11y): correct label "for" references to fields (decaporg#1904)
  improvement(netlify-cms-core): wrap navigations in lists for better a11y (decaporg#1903)
  fix(netlify-cms-widget-markdown): add missing border radius on toolbar (decaporg#1905)
  fix(netlify-cms-core): remove double focusable elements on profile menu button (decaporg#1900)
  fix(config): remove identifier field validation (decaporg#1882)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants