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.

General Questions /

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

/dev/build?flush=all problem 2.4.6


Reply


3 Posts   1130 Views

Avatar
Josua

Community Member, 86 Posts

14 January 2012 at 7:33am

In my Page.php file I deleted the following lines and I do a build (/dev/build?flush=all)

class Page extends SiteTree {

/*
public static $db = array(
'OpeningHours' => 'HTMLText',
);

public function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab(
'Root.Content.Main',
new HtmlEditorField(
'OpeningHours',
'Opening hours of the bar',
'Content'
)
);
return $fields;
}
*/
.....
......

but has given the following errors:

Building database ss_dominio using MySQL 5.5.14

Creating database tables
PageComment
SiteConfig
SiteTree
Email_BounceRecord
QueuedEmail
File
Group
LoginAttempt
Member
MemberPassword
Permission
PermissionRole
PermissionRoleCode
Widget
WidgetArea
Page
Table Page: renamed to _obsolete_Page
Table Page_versions: renamed to _obsolete_Page_versions
Table Page_Live: renamed to _obsolete_Page_Live
ContentPage
IntroPage
ErrorPage
[User Error] Couldn't run query: SELECT COUNT(*) FROM "ErrorPage_versions" LEFT JOIN "Page_versions" ON "Page_versions"."RecordID" = "ErrorPage_versions"."RecordID" AND "Page_versions"."Version" = "ErrorPage_versions"."Version" WHERE "Page_versions"."ID" IS NULL Table 'ss_dominio.Page_versions' doesn't exist
GET /dev/build?flush=all

Line 525 in /var/www/vhosts/dominiosoft.com/httpdocs/sapphire/core/model/MySQLDatabase.php
Source

516    }
517    
518    function databaseError($msg, $errorLevel = E_USER_ERROR) {
519       // try to extract and format query
520       if(preg_match('/Couldn\'t run query: ([^\|]*)\|\s*(.*)/', $msg, $matches)) {
521          $formatter = new SQLFormatter();
522          $msg = "Couldn't run query: \n" . $formatter->formatPlain($matches[1]) . "\n\n" . $matches[2];
523       }
524       
525       user_error($msg, $errorLevel);
526    }
527    
528    /**
529     * Return a boolean type-formatted string
530     *
531     * @param array $values Contains a tokenised list of info about this data type

Trace

Couldn't run query: SELECT COUNT(*) FROM "ErrorPage_versions" LEFT JOIN "Page_versions" ON "Page_versions"."RecordID" = "ErrorPage_versions"."RecordID" AND "Page_versions"."Version" = "ErrorPage_versions"."Version" WHERE "Page_versions"."ID" IS NULL Table 'ss_dominio.Page_versions' doesn't exist
Line 525 of MySQLDatabase.php
MySQLDatabase->databaseError(Couldn't run query: SELECT COUNT(*) FROM "ErrorPage_versions" LEFT JOIN "Page_versions" ON "Page_versions"."RecordID" = "ErrorPage_versions"."RecordID" AND "Page_versions"."Version" = "ErrorPage_versions"."Version" WHERE "Page_versions"."ID" IS NULL | Table 'ss_dominio.Page_versions' doesn't exist,256)
Line 123 of MySQLDatabase.php
MySQLDatabase->query( SELECT COUNT(*) FROM "ErrorPage_versions" LEFT JOIN "Page_versions" ON "Page_versions"."RecordID" = "ErrorPage_versions"."RecordID" AND "Page_versions"."Version" = "ErrorPage_versions"."Version" WHERE "Page_versions"."ID" IS NULL ,256)
Line 129 of DB.php
DB::query( SELECT COUNT(*) FROM "ErrorPage_versions" LEFT JOIN "Page_versions" ON "Page_versions"."RecordID" = "ErrorPage_versions"."RecordID" AND "Page_versions"."Version" = "ErrorPage_versions"."Version" WHERE "Page_versions"."ID" IS NULL )
Line 325 of Versioned.php
Versioned->augmentDatabase(,,,,,,)
Line 963 of Object.php
Object->extend(augmentDatabase,)
Line 3012 of DataObject.php
DataObject->requireTable()
Line 213 of DatabaseAdmin.php
DatabaseAdmin->doBuild(,1)
Line 106 of DatabaseAdmin.php
DatabaseAdmin->build(SS_HTTPRequest)
Line 193 of Controller.php
Controller->handleAction(SS_HTTPRequest)
Line 143 of RequestHandler.php
RequestHandler->handleRequest(SS_HTTPRequest)
Line 147 of Controller.php
Controller->handleRequest(SS_HTTPRequest)
Line 134 of DevelopmentAdmin.php
DevelopmentAdmin->build(SS_HTTPRequest)
Line 143 of RequestHandler.php
RequestHandler->handleRequest(SS_HTTPRequest)
Line 147 of Controller.php
Controller->handleRequest(SS_HTTPRequest)
Line 282 of Director.php
Director::handleRequest(SS_HTTPRequest,Session)
Line 125 of Director.php
Director::direct(/dev/build)
Line 127 of main.php

Avatar
smares

Community Member, 25 Posts

15 January 2012 at 7:07am

I think it's a general bug in SilverStripe.

SilverStripe renames tables no longer used from TableName to _obsolete_TableName that is why the JOIN on TableName no longer works. If you run /dev/build a second time, the error should be gone.

You might want to file a bug report since SilverStripe should notice that it renamed a table during the rebuild process.

Avatar
Josua

Community Member, 86 Posts

17 January 2012 at 12:17am

Thank you very much for the information.

Regards,
Jose A.