We have moved to GitHub Issues
Created by Gary Daly 11 Mar 2013, 08:37:36 Updated by Morten Christensen 21 Mar 2013, 16:49:15
Have described the issue as this but think the issue does not stop there.
Found this error by running a foreach loop on via CurrentPage.Children.OrderBy("UpdateDate desc").
The order was not as I had published, some child pages did not appear, so checked the last published date and saw a node that I had published 5 minutes before had a published date of two days previous. By hitting save and publish again, the date updated to the save of 5 minutes before, hit save and publish again, it updates to current date and time.
So, this could be as simple as the date not being updated, but having asked on the forum for clarification and receiving no replies, thought it must be just something on my local machine.
However, issues are occurring where code that should work, doesn't work, then for no apparent starts working. If the save event is only updating to the last save this would break code? Because a new property you created does not yet exist? Even though you can physically see it. It would appear that content (eg text in RTE) is always updated on save and publish, but, calls that include OrderBy, Where and similar extensions seem to be affected. The "Node" does not seem to be affected,but this could be because it is already "existing", but after receiving so many errors due to a null reference, that clearly exists, with code that should work there has to be something causing the issue?
Apologies for my non-technical explanation, but my knowledge of Umbraco internally is not sufficient to pin-point the issue exactly - but it does exist.
I have been looking for examples - but my code works now - maybe because I double save and publish a lot.
If I can help in any way to resolve anything - please let me know
I believe the issue you are seeing is because of the mix of new and legacy objects we have at the moment, which meant that some of the properties on the Document object wasn't updated upon saving because we use the new model under the hood. I have changed this, so the UpdatedDate on Document (and Media) are updated upon saving which should fix the issue with dates being one save behind. You can use the latest nightly build to verify that the issue was been fixed: http://nightly.umbraco.org/umbraco%206.0.3/UmbracoCms.6.0.3-build.13.zip
Assignee: Morten Christensen
Backwards Compatible: True
Affected versions: 6.0.0, 6.0.1, 6.0.2
Due in version: 6.0.3