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.

Customising the CMS /

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

Silverstripe duplicate database field causing error in save and publish


Go to End


3 Posts   1437 Views

Avatar
Neelam

Community Member, 15 Posts

10 January 2013 at 9:58pm

Hi,

I am using Silverstripe 3.0

I had created a field in the class Page(Page.php) as

"LinkTo" => "SiteTree"

which already exists in RedirectorPage

Even after removing the line of code and building the database, the field still exists in Page and Page_live which is giving me an error while publishing...no error while saving to draft...and the content gets saved...the success message is not displayed and Firebug console: Response: There has been an error

Is the field not removed from these tables even after building the database?

Avatar
kaanuni

Community Member, 22 Posts

13 January 2013 at 12:55am

Yes unused fields are not removed when the database is rebuilt. I guess the reasoning behind it is that you might still have important data in them. You need to manually remove the fields. I usually use phpmyadmin to do so.

Avatar
Willr

Forum Moderator, 5523 Posts

13 January 2013 at 8:58pm

The dbplumber module also includes features to clean up old columns

http://www.silverstripe.org/database-plumber-module/