-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
New entries with a Date field show changed status #725
Comments
This happens with the Relation Widget also, even on existing entries. It is due to the way widgets dynamically set their inital state -- widgets that do not set inital state (most) do not cause this bug. |
The way I see to fix that would be to provide a "default default", maybe |
We could also provide a |
As per PR just created - we've encountered a similar issue to that reported here where the inclusion of a relation widget in the editor page causes an article to require hitting the save button twice to save the article. This seems to be because the setting of metadata in the a DRAFT_CHANGE_FIELD signal is changing hasChanged attribute in the entry state to be true even though the value has not changed at all. I'm new to the internals of Netlify CMS and various logic flows, but I'm wondering whether the metadata changing should really be indicating that entry has changed, or whether this meta data is just used for the CMS interface. Any guidance on any side effects not setting hasChange to true when only meta data set would be appreciated to help me steer to the correct solution. |
Just updated the PR above so now preview - https://deploy-preview-2377--cms-demo.netlify.com/ - allows you to create new post / edit post / new kitchen sink / edit kitchen sink, with the hasChanged flag not being set on load of the first screen (i.e. no changes to save wrongly detected) , and that flag is only changed with you actually make some content changes. |
Awesome, I'll take a look soon! |
Any updates on this? |
The right approach is going to involve widgets setting their own default values and directly reporting clean/dirty status, which means some API additions - this requires communication and agreement about approach before a PR is opened. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Just curious, is there a workaround until this PR gets merged? |
The relation field status change already fixed here #3306, we are now only dealing with the |
- Do you want to request a feature or report a bug?
bug
- What is the current behavior?
Entries with a Date field will ask the user whether or not they want to save changes, when the entry was just created.
- If the current behavior is a bug, please provide the steps to reproduce.
- What is the expected behavior?
If nothing has been added, the entry should not prompt to save.
- Please mention your CMS, node.js, and operating system version.
0.5.1 (actually master)
The text was updated successfully, but these errors were encountered: