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.

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Fresh install - bug


Go to End


5 Posts   2504 Views

Avatar
Honka

Community Member, 6 Posts

6 August 2009 at 4:55pm

I have just done a fress install of silverstripe onto my apache 2.2 webserver, with php 5. when I put the modules-image_gallery-r210 folder into my main directory and reload my site with the flush=1 I end up getting the following.

It then happens on every load until I remove the module folder.

What is it that would be causing this?

[User Error] Couldn't run query: SELECT `SiteTree`.*, `GhostPage`.*, `ImageGalleryPage`.*, `ErrorPage`.*, `RedirectorPage`.*, `VirtualPage`.*, `SiteTree`.ID, if(`SiteTree`.ClassName,`SiteTree`.ClassName,'SiteTree') AS RecordClassName FROM `SiteTree` LEFT JOIN `GhostPage` ON `GhostPage`.ID = `SiteTree`.ID LEFT JOIN `ImageGalleryPage` ON `ImageGalleryPage`.ID = `SiteTree`.ID LEFT JOIN `ErrorPage` ON `ErrorPage`.ID = `SiteTree`.ID LEFT JOIN `RedirectorPage` ON `RedirectorPage`.ID = `SiteTree`.ID LEFT JOIN `VirtualPage` ON `VirtualPage`.ID = `SiteTree`.ID WHERE (HomepageForDomain REGEXP '(, ^) *localhost *(,|$)') ORDER BY Sort LIMIT 1 | Table 'ss_mysite.imagegallerypage' doesn't exist
GET /u/

Line 401 in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\u\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: SELECT `SiteTree`.*, `GhostPage`.*, `ImageGalleryPage`.*, `ErrorPage`.*, `RedirectorPage`.*, `VirtualPage`.*, `SiteTree`.ID, if(`SiteTree`.ClassName,`SiteTree`.ClassName,'SiteTree') AS RecordClassName FROM `SiteTree` LEFT JOIN `GhostPage` ON `GhostPage`.ID = `SiteTree`.ID LEFT JOIN `ImageGalleryPage` ON `ImageGalleryPage`.ID = `SiteTree`.ID LEFT JOIN `ErrorPage` ON `ErrorPage`.ID = `SiteTree`.ID LEFT JOIN `RedirectorPage` ON `RedirectorPage`.ID = `SiteTree`.ID LEFT JOIN `VirtualPage` ON `VirtualPage`.ID = `SiteTree`.ID WHERE (HomepageForDomain REGEXP '(, ^) *localhost *(,|$)') ORDER BY Sort LIMIT 1 | Table 'ss_mysite.imagegallerypage' doesn't exist
Line 401 of MySQLDatabase.php
* MySQLDatabase->databaseError(Couldn't run query: SELECT `SiteTree`.*, `GhostPage`.*, `ImageGalleryPage`.*, `ErrorPage`.*, `RedirectorPage`.*, `VirtualPage`.*, `SiteTree`.ID, if(`SiteTree`.ClassName,`SiteTree`.ClassName,'SiteTree') AS RecordClassName FROM `SiteTree` LEFT JOIN `GhostPage` ON `GhostPage`.ID = `SiteTree`.ID LEFT JOIN `ImageGalleryPage` ON `ImageGalleryPage`.ID = `SiteTree`.ID LEFT JOIN `ErrorPage` ON `ErrorPage`.ID = `SiteTree`.ID LEFT JOIN `RedirectorPage` ON `RedirectorPage`.ID = `SiteTree`.ID LEFT JOIN `VirtualPage` ON `VirtualPage`.ID = `SiteTree`.ID WHERE (HomepageForDomain REGEXP '(,|^) *localhost *(,|$)') ORDER BY Sort LIMIT 1 | Table 'ss_mysite.imagegallerypage' doesn't exist,256)
Line 102 of MySQLDatabase.php
* MySQLDatabase->query(SELECT `SiteTree`.*, `GhostPage`.*, `ImageGalleryPage`.*, `ErrorPage`.*, `RedirectorPage`.*, `VirtualPage`.*, `SiteTree`.ID, if(`SiteTree`.ClassName,`SiteTree`.ClassName,'SiteTree') AS RecordClassName FROM `SiteTree` LEFT JOIN `GhostPage` ON `GhostPage`.ID = `SiteTree`.ID LEFT JOIN `ImageGalleryPage` ON `ImageGalleryPage`.ID = `SiteTree`.ID LEFT JOIN `ErrorPage` ON `ErrorPage`.ID = `SiteTree`.ID LEFT JOIN `RedirectorPage` ON `RedirectorPage`.ID = `SiteTree`.ID LEFT JOIN `VirtualPage` ON `VirtualPage`.ID = `SiteTree`.ID WHERE (HomepageForDomain REGEXP '(,|^) *localhost *(,|$)') ORDER BY Sort LIMIT 1,256)
Line 120 of DB.php
* DB::query(SELECT `SiteTree`.*, `GhostPage`.*, `ImageGalleryPage`.*, `ErrorPage`.*, `RedirectorPage`.*, `VirtualPage`.*, `SiteTree`.ID, if(`SiteTree`.ClassName,`SiteTree`.ClassName,'SiteTree') AS RecordClassName FROM `SiteTree` LEFT JOIN `GhostPage` ON `GhostPage`.ID = `SiteTree`.ID LEFT JOIN `ImageGalleryPage` ON `ImageGalleryPage`.ID = `SiteTree`.ID LEFT JOIN `ErrorPage` ON `ErrorPage`.ID = `SiteTree`.ID LEFT JOIN `RedirectorPage` ON `RedirectorPage`.ID = `SiteTree`.ID LEFT JOIN `VirtualPage` ON `VirtualPage`.ID = `SiteTree`.ID WHERE (HomepageForDomain REGEXP '(,|^) *localhost *(,|$)') ORDER BY Sort LIMIT 1)
Line 426 of SQLQuery.php
* SQLQuery->execute()
Line 2527 of DataObject.php
* DataObject->instance_get_one(HomepageForDomain REGEXP '(,|^) *localhost *(,|$)',)
Line 2464 of DataObject.php
* DataObject::get_one(SiteTree,HomepageForDomain REGEXP '(,|^) *localhost *(,|$)')
Line 64 of RootURLController.php
* RootURLController::get_homepage_urlsegment()
Line 41 of RootURLController.php
* RootURLController->handleRequest(HTTPRequest)
Line 277 of Director.php
* Director::handleRequest(HTTPRequest,Session)
Line 121 of Director.php
* Director::direct()
Line 118 of main.php
* require_once(C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\u\sapphire\main.php)
Line 71 of index.php

Avatar
Willr

Forum Moderator, 5523 Posts

6 August 2009 at 8:34pm

It says a table does not exist - try doing a site.com/dev/build to rebuild the database tables

Avatar
Honka

Community Member, 6 Posts

6 August 2009 at 10:58pm

Edited: 06/08/2009 11:01pm

Thanks for that willr however new problem with building...

i have only left modules-dataobject_manager-r220 as only module in since image gallery said do that first

Environment Builder (formerly db/build)
http://localhost/u/index.php/
dev→ build
[Warning] fopen(C:\WINDOWS\TEMP\/silverstripe-cacheC--Program-Files-Apache-Software-Foundation-Apache2.2-htdocs-u/manifestClassParse-C__Program Files_Apache Software Foundation_Apache2.2_htdocs_u_modules-dataobject_manager-r220_code_simple_html_editor_field_SimpleHTMLEditorField.php) [function.fopen]: failed to open stream: No such file or directory
GET /u/index.php/dev/build

Line 398 in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\u\sapphire\core\ManifestBuilder.php
Source

389 $parseCacheFile = TEMP_FOLDER . "/manifestClassParse-" . str_replace(array("/",":", "\\"),"_", realpath($filename));
390 if(!file_exists($parseCacheFile) || filemtime($parseCacheFile) < filemtime($filename)) {
391 $tokens = token_get_all($file);
392 $classes = self::getClassDefParser()->findAll($tokens);
393 $interfaces = self::getInterfaceDefParser()->findAll($tokens);
394
395 $cacheContent = '<?php
396 $classes = ' . var_export($classes,true) . ';
397 $interfaces = ' . var_export($interfaces,true) . ';';
398 if($fh = fopen($parseCacheFile,'w')) { // this is the red line
399 fwrite($fh, $cacheContent);
400 fclose($fh);
401 }
402
403 } else {
404 include($parseCacheFile);

first thing i did was check that file path and that file definantly exists

Avatar
UncleCheese

Forum Moderator, 4102 Posts

7 August 2009 at 2:16am

Make sure the name of the folder is dataobject_manager, not dataobject_manager-r123

Avatar
Honka

Community Member, 6 Posts

7 August 2009 at 9:57am

Edited: 07/08/2009 10:00am

Thankyou for that help again

ok, obviously i'm just an idiot, or just having really bad luck here... (feel free to tell me which it is)

when trying to chose images on an image galery page I run into this error after I chose the images (from the assets folder) and select import. -- It seems to work fine when using upload an image

[User Error] Uncaught Exception: Object->__call(): the method 'backlinktracking' does not exist on 'ImageGalleryImage'
POST /u/index.php/admin/EditForm/field/GalleryItems/ImportForm?ctf[GalleryItems][per_page]=10&ctf[GalleryItems][showall]=0&ctf[GalleryItems][sort]=SortOrder&ctf[GalleryItems][sort_dir]=DESC&ctf[GalleryItems][search]=&ctf[GalleryItems][filter]=AlbumID_1&ctf[GalleryItems][view]=grid&ctf[GalleryItems][imagesize]=100

Line 551 in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\u\sapphire\core\Object.php
Source

542 case isset($config['function']) :
543 return $config['function']($this, $arguments);
544
545 default :
546 throw new Exception (
547 "Object->__call(): extra method $method is invalid on $this->class:" . var_export($config, true)
548 );
549 }
550 } else {
551 throw new Exception("Object->__call(): the method '$method' does not exist on '$this->class'");
552 }
553 }
554
555 // -----------------------------------------------------------------------------------------------------------------
556
557 /**