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.

Upgrading SilverStripe /

Ask questions about upgrading SilverStripe to the latest version.

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

2.2.2 -> 2.3.4


Go to End
Reply


3 Posts   2025 Views

Avatar
janulka

Community Member, 80 Posts

17 January 2010 at 12:05am

Edited: 17/01/2010 1:11pm

Hello,

I am trying to upgrade from 2.2.2 to 2.3.4, and when I do dev/build, it is giving me following:

Creating database tables
# PageComment
# GalleryPage_Extension
# SiteTree
# Email_BounceRecord
# QueuedEmail
# File
# Group
# LoginAttempt
# Member
# MemberPassword
# Permission
# Widget
# WidgetArea
# Page
# GhostPage
# GalleryPage
# ArticleHolder
# ArticlePage
# ContentHolderNoLinks2Page
# ContentHolderNoLinksPage
# ContentHolderReadMorePage
# ContentNoLinks2Page
# ContentNoLinksPage
# ContentNoLinksProgramPage
# ContentPage
# EngContentHolderReadMorePage
# GalleryFolder
# HomePage
# ErrorPage
# RedirectorPage
# VirtualPage
# EngContentHolderNoLinks2Page
# EngContentNoLinks2Page
# Image
# Folder
# GalleryPage_Image
# Image_Cached

Creating database records
# PageComment
# GalleryPage_Extension
# SiteTree
[User Error] Couldn't run query: ALTER TABLE `SiteTree` CHANGE `Viewers` `_obsolete_Viewers` enum('Anyone','LoggedInUsers','OnlyTheseUsers') character set utf8 collate utf8_general_ci default 'Anyone' Duplicate column name '_obsolete_Viewers'
GET /dev/build/

Line 401 in /rgt/212/42196/www/sapphire/core/model/MySQLDatabase.php
Source

392 	}
393 	
394 	function databaseError($msg, $errorLevel = E_USER_ERROR) {
395 		// try to extract and format query
396 		if(preg_match('/Couldn\'t run query: ([^\|]*)\|\s*(.*)/', $msg, $matches)) {
397 			$formatter = new SQLFormatter();
398 			$msg = "Couldn't run query: \n" . $formatter->formatPlain($matches[1]) . "\n\n" . $matches[2];
399 		}
400 		
401 		user_error($msg, $errorLevel);
402 	}
403 }
404 
405 /**
406  * A result-set from a MySQL database.
407  * @package sapphire

Trace

    * Couldn't run query: ALTER TABLE `SiteTree` CHANGE `Viewers` `_obsolete_Viewers` enum('Anyone','LoggedInUsers','OnlyTheseUsers') character set utf8 collate utf8_general_ci default 'Anyone' Duplicate column name '_obsolete_Viewers'
      Line 401 of MySQLDatabase.php
    * MySQLDatabase->databaseError(Couldn't run query: ALTER TABLE `SiteTree` CHANGE `Viewers` `_obsolete_Viewers` enum('Anyone','LoggedInUsers','OnlyTheseUsers') character set utf8 collate utf8_general_ci default 'Anyone' | Duplicate column name '_obsolete_Viewers',256)
      Line 102 of MySQLDatabase.php
    * MySQLDatabase->query(ALTER TABLE `SiteTree` CHANGE `Viewers` `_obsolete_Viewers` enum('Anyone','LoggedInUsers','OnlyTheseUsers') character set utf8 collate utf8_general_ci default 'Anyone')
      Line 269 of MySQLDatabase.php
    * MySQLDatabase->renameField(SiteTree,Viewers,_obsolete_Viewers)
      Line 371 of Database.php
    * Database->dontRequireField(SiteTree,Viewers)
      Line 46 of UpgradeSiteTreePermissionSchemaTask.php
    * UpgradeSiteTreePermissionSchemaTask->run(HTTPRequest)
      Line 969 of SiteTree.php
    * SiteTree->requireDefaultRecords()
      Line 212 of DatabaseAdmin.php
    * DatabaseAdmin->doBuild(,1)
      Line 98 of DatabaseAdmin.php
    * DatabaseAdmin->build()
      Line 135 of DevelopmentAdmin.php
    * DevelopmentAdmin->build(HTTPRequest)
      Line 129 of RequestHandler.php
    * RequestHandler->handleRequest(HTTPRequest)
      Line 119 of Controller.php
    * Controller->handleRequest(HTTPRequest)
      Line 277 of Director.php
    * Director::handleRequest(HTTPRequest,Session)
      Line 121 of Director.php
    * Director::direct(/dev/build/)
      Line 118 of main.php

In advance thanks for help..

Avatar
Fuzz10

Community Member, 787 Posts

17 January 2010 at 1:43am

After you've made a backup , delete the conflicting columns (the obsolete ones) from your database and run again....

Avatar
janulka

Community Member, 80 Posts

17 January 2010 at 1:15pm

Edited: 17/01/2010 1:16pm

Thanks for fast reply :)

The site is now after upgrade, most of it OK, but when I try to insert image (button in TinyMCE panel -> Sidebar), and after choosing folder, where normally images would appear, and I would just choose one of them, now I am getting this scary error and I dont understand a thing of it.. plz help?

ERROR [Warning]: Parameter 1 to Hierarchy::loadDescendantIDListInto() expected to be a reference, value given IN GET /admin/EditorToolbar/ImageForm?action_callfieldmethod=1&fieldName=Image&ajax=1&methodName=getimages&folderID=519&searchText=undefined&cacheKillerDate=1263685728117&cacheKillerRand=1268 Line 550 in /rgt/212/42196/www/sapphire/core/Object.php Source ====== 541: if(isset(self::$extra_methods[$this->class][$method])) { 542: $config = self::$extra_methods[$this->class][$method]; 543: 544: switch(true) { 545: case isset($config['property']) : 546: $obj = $config['index'] !== null ? 547: $this->{$config['property']}[$config['index']] : 548: $this->{$config['property']}; 549: * 550: if($obj) return call_user_func_array(array($obj, $method), $arguments); 551: 552: if($this->destroyed) { 553: throw new Exception ( 554: "Object->__call(): attempt to call $method on a destroyed $this->class object" 555: ); 556: } else {

      call_user_func_array(Array,Array) line 550 of Object.php Object->__call(loadDescendantIDListInto,Array) Image->loadDescendantIDListInto(Array) line 357 of Hierarchy.php Hierarchy->loadDescendantIDListInto(Array) line 342 of Hierarchy.php Hierarchy->getDescendantIDList(Folder) call_user_func_array(Array,Array) line 550 of Object.php Object->__call(getDescendantIDList,Array) Folder->getDescendantIDList(Folder) line 47 of ThumbnailStripField.php ThumbnailStripField->getimages() line 963 of Form.php Form->callfieldmethod(Array,Form,HTTPRequest) line 246 of Form.php Form->httpSubmission(HTTPRequest) line 129 of RequestHandler.php RequestHandler->handleRequest(HTTPRequest) line 143 of RequestHandler.php RequestHandler->handleRequest(HTTPRequest) line 143 of RequestHandler.php RequestHandler->handleRequest(HTTPRequest) line 119 of Controller.php Controller->handleRequest(HTTPRequest) line 277 of Director.php Director::handleRequest(HTTPRequest,Session) line 121 of Director.php Director::direct(/admin/EditorToolbar/ImageForm) line 118 of main.php