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

Empty ClassName is built every time


Go to End


3 Posts   1532 Views

Avatar
Xazen

Community Member, 18 Posts

16 June 2013 at 11:14pm

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)

Avatar
swaiba

Forum Moderator, 1899 Posts

18 June 2013 at 6:55am

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 = '';

Avatar
Xazen

Community Member, 18 Posts

23 June 2013 at 11:21pm

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;