You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calling the ContentService to get a content item by Key (Guid) returns a cached version of the item, not the latest version.
If you call the contentService.GetById with the int id you get the latest version
Reproduction
I had the following code in an ApIController (Id / Guid is same bit of content for test)
var item = Services.ContentService.GetById(1061);
Logger.Info<uSyncDashboardApiController>($"By Id Content Version: {item.VersionId}");
var itemByKey = Services.ContentService.GetById(Guid.Parse("fdfa7dd1-b45d-4a14-bc66-83f441df2d69"));
Logger.Info<uSyncDashboardApiController>($"By Key Content Version: {itemByKey.VersionId}");
Before content modification log :
By Id Content Version: 2
By Key Content Version: 2
2 . Go to content update a field and publish the node
3. Call after publish (new version of content)
By Id Content Version: 3
By Key Content Version: 2
You might not really notice this until you try and save the via the content service and you get Cannot save a non-current version because your version is old.
The text was updated successfully, but these errors were encountered:
Latest Nightly : 8.0.0-alpha.58.2084
Calling the ContentService to get a content item by Key (Guid) returns a cached version of the item, not the latest version.
If you call the contentService.GetById with the int id you get the latest version
Reproduction
I had the following code in an ApIController (Id / Guid is same bit of content for test)
2 . Go to content update a field and publish the node
3. Call after publish (new version of content)
You might not really notice this until you try and save the via the content service and you get
Cannot save a non-current version
because your version is old.The text was updated successfully, but these errors were encountered: