SetChangedOnPublish property doesnt seem to work

Nat
Nat
Vote:
 

the documentation for this particular PageData property says :

indicating whether the PageData.Changed should be updated on publish

I have set this to true in the SetDefaultValues method for our pages, but it does not update when the page is published.

do I need to hook into the publish event instead? or am I using it incorrectly?

I appreciate there is a tickbox on the settings tab, but seemed that this property was the way to avoid having to use that tickbox.

#287981
Sep 23, 2022 12:55
Vote:
 

The Modified Date, I believe in code it is PageData.Changed is only updated if  "Update modified date" 

You can check this by default so on every publish it will also update this date

#287983
Sep 23, 2022 13:23
Vote:
 

I believe their is a configuration setting aswell that can be set to Mark as modified by default, have a search for "uIDefaultValueForSetChangedOnPublish" 

#287984
Sep 23, 2022 13:25
Vote:
 

If you want changed to be always updated when publish, use uIDefaultValueForSetChangedOnPublish as Minesh suggested - more information Release note - CMS-8263 (optimizely.com) 

if you want to have more flexibility, you can listen to IContentEvents.PublishingContent and set the value on content (you can have some criteria etc.) 

#288105
Sep 26, 2022 8:27
Nat
Vote:
 

hi,

thanks for that, the release notes are talking about adding that settings to the <appsettings node in a web.config - and seem to be referencing the CMS 11 package.
I am having this problem in CMS 12, where does this need adding in the appsettings.json - its not mentioned on either of these documentaion pages

https://docs.developers.optimizely.com/content-cloud/v12.0.0-content-cloud/docs/configuring-cms

https://docs.developers.optimizely.com/content-cloud/v12.0.0-content-cloud/docs/cmsui-section-replace-when-cms-22234-goes-out

?

#288106
Edited, Sep 26, 2022 9:10
Vote:
 

Apparently it was removed in CMS 12, I'm not sure why. but your second option (IContentEvents) should still work 

#288107
Sep 26, 2022 9:31
Nat
Vote:
 

Guess I should hide the tickbox as well then, or it will be confusing for the editors.

#288108
Sep 26, 2022 9:33
Quan Mai - Sep 26, 2022 9:40
I meant uIDefaultValueForSetChangedOnPublish flag was removed, if that was not clear. the feature should be the same, but I'm not 100% sure
Nat
Vote:
 

hi Quan Mai, 

Thanks for the clarification, I just meant that if I am setting modified explicitly on publish - regardless of what the checkbox is set to, that would seem to make that checkbox confusing for editors. So I think I will use an editordescriptor to hide it to avoid that confusion.

#288110
Sep 26, 2022 9:46
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.