Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

populateDefaults functions replace content on changing Page type


Go to End


2 Posts   388 Views

Avatar
Praveen

Community Member, 49 Posts

26 September 2014 at 4:37pm

Edited: 26/09/2014 5:26pm

Hello,

populateDefaults function populate a Content field with HTMLText with default data at page creation. But this should not populate when the page is already created and page type is changed.

function overrides the content already present . I moved HTMLText to static defaults Content and the issue is solved.

Avatar
camfindlay

Forum Moderator, 267 Posts

2 October 2014 at 2:09pm

populateDefault ideally shouldn't override your content - which version of SilverStripe are you using and could you provide a code example some we can see if the same problem happens elsewhere. If it can be validated as a bug we can log a github issue.