Join us this Friday for AI in Action at the Virtual Happy Hour! This free virtual event is open to all—enroll now on Academy and don’t miss out.

 

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/configuring-cmsui

?

#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
Isabella Gross Alström - Jan 11, 2023 14:29
Do you know if there is any plan to add back an easy option to make this happen?
Arvlun - Mar 14, 2023 14:03
+1, Have several different site using this feature. Any plans to add it back for cms12?
Lucas Olsson - Mar 27, 2023 13:23
I agree. This is a useful feature and I think it should be kept in cms 12.
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
Quan Mai - Mar 31, 2023 18:40
it will be released in 12.19.1
Vote:
 

I, too, think that this property should be added in CmsUi settings.

#298368
Mar 15, 2023 14:03
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.