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 U4-2372 Save and Publish creates fewer versions #9

Closed
wants to merge 1 commit into from
Closed

Fix U4-2372 Save and Publish creates fewer versions #9

wants to merge 1 commit into from

Conversation

dpen2000
Copy link
Contributor

This PR is to fix http://issues.umbraco.org/issue/U4-2372.

Previous to 6.1.0, when this line in ContentRepository was reached:
bool shouldCreateNewVersion = (((ICanBeDirty)entity).IsPropertyDirty("Published") && publishedState != PublishedState.Unpublished) || ((ICanBeDirty)entity).IsPropertyDirty("Language");
the property Published was dirty when a Save and Publish was initiated from the front end.

This is no longer always the case. Because of this, this line in ContentRepository:
((Content)entity).UpdatingEntity();
is being called only for new Content and for Content moving between Unpublished to Published. The UpdatingEntity method is responsible for setting a new guid on the Version property on the Content. Because of this, only new Content and Content moving between Unpublished to Published is getting a new version number. In this context, by unpublished, I mean Content that has not yet been published before the Save And Publish was initiated.

I've changed the check in shouldCreateNewVersion to be based on the actual Published property itself. This restores the original functionality of a new cmsDocument row being created everytime a user clicks Save and Publish and this results in a successful Publish.

Please note the issue in http://issues.umbraco.org/issue/U4-2361 appears worse as there are more versions being saved so this will also need to be fixed.

…version of Content

Published property is no longer dirty at this point after initial publish so it's checking for it being so can't be used for determining whether a new version should be created. Instead, check if Published property is true; in which case we want to create a new version.
@dpen2000
Copy link
Contributor Author

This won't create a new version when switching from Published to Unpublished so I'll close this.

@dpen2000 dpen2000 closed this Jun 16, 2013
@dpen2000 dpen2000 deleted the FixU4-2372 branch January 13, 2014 20:03
@dpen2000 dpen2000 restored the FixU4-2372 branch January 13, 2014 20:04
@ghost ghost assigned robert-cpl Jul 18, 2018
mikecp added a commit that referenced this pull request Oct 29, 2021
Revert accidental commit of "Remove need of SMTP.Host config when def…
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.

2 participants