21301 Posts in 5735 Topics by 2603 members
|Go to End|
27 May 2010 at 10:26am Last edited: 27 May 2010 12:40pm
I've run into a bit of a problem with page types. We had two page types called "Section" and "Holder" which I changed to "Tier1LandingPage" and "Tier2LandingPage" by renaming the files in /mysite/code/, editing the class titles and renaming the template files in /theme/themename/templates/Layout/
Now if I try to change the page type of pages that were previous set as "Section" or "Holder" in the CMS to "Tier1 Landing Page" the page type resets itself to the first selection on the list on publish.
I've flushed the templates, rebuilt the database and at a bit of a loss about what to do.
Any suggestions appreciated.
27 May 2010 at 12:10pm
I solved this problem but it took a tiny bit of SQL hacking. It looks like removing Page Types which are used by existing pages breaks things.
I went into MySQL and found that ClassName for the affected pages was "" in the SiteTree table and NULL in the SiteTree_Live. These could not be changed under the Behaviour tab in the CMS.
Running the following SQL command fixed this problem:
UPDATE SiteTree SET ClassName="NewPageType" WHERE ClassName="";
UPDATE SiteTree_Live SET ClassName="NewPageType" WHERE ClassName IS NULL;
Hope this helps someone later on.
6 July 2010 at 3:34am Last edited: 6 July 2010 3:35am
In case anybody didn't know, you can also just duplicate the page. that fixes it.
then delete the original and rename the duplicate...
5 September 2011 at 8:57am
@Tama - just wanted to log in and say thanks for posting that solution. You saved me a lot of time and panic.
|Go to Top|