21301 Posts in 5735 Topics by 2603 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1482 Views |
-
[SOLVED] Cannot change Page Type in CMS

27 May 2010 at 10:26am Last edited: 27 May 2010 12:40pm
Morning
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.
Cheers
Tama -
Re: [SOLVED] Cannot change Page Type in CMS

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.
-
Re: [SOLVED] Cannot change Page Type in CMS

27 May 2010 at 6:14pm
Ideally I think it should default back to 'Page' if a page type gets removed. Ticket has been created - http://open.silverstripe.org/ticket/5656
-
Re: [SOLVED] Cannot change Page Type in CMS

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... -
Re: [SOLVED] Cannot change Page Type in CMS

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.
| 1482 Views | ||
|
Page:
1
|
Go to Top |



