Jump to:

22977 Posts in 11806 Topics by 2826 members

General Questions

SilverStripe Forums » General Questions » Empty ClassName is built every time

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

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

Page: 1
Go to End
Author Topic: 301 Views
  • Xazen
    Avatar
    Community Member
    18 Posts

    Empty ClassName is built every time Link to this post

    I am not sure whether it has something to do that I upgraded to SS3.0.5 from SS2.4.5.

    Everythings works fine. I deleted some modules, adjusted ss-files and php-files.

    But now I have got the problem everytime I run dev/build?flush=1 an empty ClassName is added the table File and all the SiteTree tables. Even if I run it multiple time in a row.

    Field File.ClassName: changed to enum('','File','Image','Folder','ProfileImage','Image_Cached') character set utf8 collate utf8_general_ci default '' (from enum(\','File','Image','Folder','ProfileImage','Image_Cached') character set utf8 collate utf8_general_ci)
    Field SiteTree.ClassName: changed to enum('','AdventCalender','ApplicationPage','ArticleCategory','ArticlePage','GeneralContactPage','Home','LcPage','Maid','MaidHolder','News','RentingPage','ErrorPage','RedirectorPage','Media','SiteTree','Page','VirtualPage') character set utf8 collate utf8_general_ci default '' (from enum(\','AdventCalender','ApplicationPage','ArticleCategory','ArticlePage','GeneralContactPage','Home','LcPage','Maid','MaidHolder','News','RentingPage','ErrorPage','RedirectorPage','Media','SiteTree','Page','VirtualPage') character set utf8 collate utf8_general_ci)
    Field SiteTree_Live.ClassName: changed to enum('','AdventCalender','ApplicationPage','ArticleCategory','ArticlePage','GeneralContactPage','Home','LcPage','Maid','MaidHolder','News','RentingPage','ErrorPage','RedirectorPage','Media','SiteTree','Page','VirtualPage') character set utf8 collate utf8_general_ci default '' (from enum(\','AdventCalender','ApplicationPage','ArticleCategory','ArticlePage','GeneralContactPage','Home','LcPage','Maid','MaidHolder','News','RentingPage','ErrorPage','RedirectorPage','Media','SiteTree','Page','VirtualPage') character set utf8 collate utf8_general_ci)
    Field SiteTree_versions.ClassName: changed to enum('','AdventCalender','ApplicationPage','ArticleCategory','ArticlePage','GeneralContactPage','Home','LcPage','Maid','MaidHolder','News','RentingPage','ErrorPage','RedirectorPage','Media','SiteTree','Page','VirtualPage') character set utf8 collate utf8_general_ci default '' (from enum(\','AdventCalender','ApplicationPage','ArticleCategory','ArticlePage','GeneralContactPage','Home','LcPage','Maid','MaidHolder','News','RentingPage','ErrorPage','RedirectorPage','Media','SiteTree','Page','VirtualPage') character set utf8 collate utf8_general_ci)

  • swaiba
    Avatar
    Forum Moderator
    1769 Posts

    Re: Empty ClassName is built every time Link to this post

    Hi Xazen,

    This happens when you use a class and then lose/rename it. So you probably had something like...

    class MyPage extends Page {
    ...
    }

    and removed it. I seen it a long time back... it's not really preventable, so I have a script...

    UPDATE SiteTree SET ClassName='Page' WHERE ClassName='';
    UPDATE SiteTree_Live SET ClassName='Page' WHERE ClassName='';
    UPDATE SiteTree_versions SET ClassName='Page' WHERE ClassName='';
    UPDATE File SET ClassName = 'File' WHERE ClassName = '';

  • Xazen
    Avatar
    Community Member
    18 Posts

    Re: Empty ClassName is built every time Link to this post

    Thanks this solved the problem. However I needed to change the code a bit. I did'nt get any result with ClassName='' . I used ClassName = 0 instead (since the columns where enums).

    UPDATE SiteTree SET ClassName='Page' WHERE ClassName = 0;
    UPDATE SiteTree_Live SET ClassName='Page' WHERE ClassName = 0;
    UPDATE SiteTree_versions SET ClassName='Page' WHERE ClassName = 0;
    UPDATE File SET ClassName = 'File' WHERE ClassName = 0;

    301 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.