7911 Posts in 1354 Topics by 930 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » SQL column error but not ParentID
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 318 Views |
-
SQL column error but not ParentID

2 August 2011 at 12:20am Last edited: 2 August 2011 12:22am
Hi!
I have tried this on a fresh 2.4.5 and on a fresh 2.4.0 setup but the same error occur.
Im using the latest versions from git of
dataobject_manager
image_gallery
uploadifyAnd everything goes accoording to plan until i try to add images.
On a local machine i get the first album to be correct, but when trying to add or modify more albums i get the error below.
On a live site the error occurs directly.After searching the fourms i see alot of information about the missing column error, but i can't seem to apply those fixes on my project since i intend to use the image gallery module straight out of the box, so i have not modified any code.
the files are uploaded and file permissions are set ok.
my untrained eye says that the error-message:
FROM "File"
WHERE ("File"."ID" IN (17))
ORDER BY "SortOrder" ASCis wrong and is missing something in (xxxx IS 17) or something like that, but I have no idea on how to correct it.
At this point my Files table is looks like this:
ID ClassName Created LastEdited Name Title Filename Content Sort SortOrder ParentID OwnerID
1 Folder 2011-08-01 13:54:55 2011-08-01 13:54:55 image-gallery Image Gallery assets/image-gallery/ NULL 0 0 0 0
2 Folder 2011-08-01 13:54:55 2011-08-01 13:55:08 Album Album assets/image-gallery/Album/ NULL 0 2 1 0
16 ImageGalleryImage 2011-08-01 14:03:41 2011-08-01 14:03:41 06.jpg 06 assets/image-gallery/Album/testalbum/06.jpg NULL 0 5 11 0
4 Folder 2011-08-01 13:55:32 2011-08-01 13:55:32 Uploads Uploads assets/Uploads/ NULL 0 3 0 0
11 Folder 2011-08-01 14:03:01 2011-08-01 14:03:01 testalbum testalbum assets/image-gallery/Album/testalbum/ NULL 0 4 2 0
12 ImageGalleryImage 2011-08-01 14:03:33 2011-08-01 14:03:33 01.jpg 01 assets/image-gallery/Album/testalbum/01.jpg NULL 0 0 11 0
13 ImageGalleryImage 2011-08-01 14:03:34 2011-08-01 14:03:34 03.jpg 03 assets/image-gallery/Album/testalbum/03.jpg NULL 0 2 11 0
14 ImageGalleryImage 2011-08-01 14:03:37 2011-08-01 14:03:37 04.jpg 04 assets/image-gallery/Album/testalbum/04.jpg NULL 0 3 11 0
15 ImageGalleryImage 2011-08-01 14:03:39 2011-08-01 14:03:39 05.jpg 05 assets/image-gallery/Album/testalbum/05.jpg NULL 0 4 11 0
17 ImageGalleryImage 2011-08-01 14:04:47 2011-08-01 14:04:47 2.jpg 2 assets/image-gallery/Album/testalbum/2.jpg NULL 0 6 11 0so ID 17 exist but no column named 17 so i can see how it gets messed up.
The full error is:
ERROR [User Error]: Couldn't run query:
SELECT "File"."ClassName", "File"."Created", "File"."LastEdited", "File"."Name", "File"."Title", "File"."Filename", "File"."Content", "File"."Sort", "File"."SortOrder", "File"."ParentID", "File"."OwnerID", "File"."ID", CASE WHEN "File"."ClassName" IS NOT NULL THEN "File"."ClassName" ELSE 'File' END AS "RecordClassName"
FROM "File"
WHERE ("File"."ID" IN (17))
ORDER BY "SortOrder" ASCUnknown column '17' in 'where clause'
IN GET /admin/EditForm/field/GalleryItems/UploadifyForm/field/UploadedFiles/refresh?ctf[GalleryItems][start]=0&ctf[GalleryItems][per_page]=10&ctf[GalleryItems][showall]=0&ctf[GalleryItems][sort]=SortOrder&ctf[GalleryItems][sort_dir]=&ctf[GalleryItems][search]=&ctf[GalleryItems][filter]=AlbumID_3&ctf[GalleryItems][view]=grid&ctf[GalleryItems][imagesize]=100&FileIDs=%EF%BB%BF17
Line 536 in /www/webvol11/w5/l6lgn8fcossyycu/bergstensbilder.se/public_html/sapphire/core/model/MySQLDatabase.phpSource
======
527: }
528:
529: function databaseError($msg, $errorLevel = E_USER_ERROR) {
530: // try to extract and format query
531: if(preg_match('/Couldn\'t run query: ([^\|]*)\|\s*(.*)/', $msg, $matches)) {
532: $formatter = new SQLFormatter();
533: $msg = "Couldn't run query: \n" . $formatter->formatPlain($matches[1]) . "\n\n" . $matches[2];
534: }
535:
* 536: user_error($msg, $errorLevel);
537: }
538:
539: /**
540: * Return a boolean type-formatted string
541: *
542: * @param array $values Contains a tokenised list of info about this data typeTrace
=====
<ul>user_error(Couldn't run query:
SELECT "File"."ClassName", "File"."Created", "File"."LastEdited", "File"."Name", "File"."Title", "File"."Filename", "File"."Content", "File"."Sort", "File"."SortOrder", "File"."ParentID", "File"."OwnerID", "File"."ID", CASE WHEN "File"."ClassName" IS NOT NULL THEN "File"."ClassName" ELSE 'File' END AS "RecordClassName"
FROM "File"
WHERE ("File"."ID" IN (17))
ORDER BY "SortOrder" ASCUnknown column '17' in 'where clause',256)
line 536 of MySQLDatabase.phpMySQLDatabase->databaseError(Couldn't run query: SELECT "File"."ClassName", "File"."Created", "File"."LastEdited", "File"."Name", "File"."Title", "File"."Filename", "File"."Content", "File"."Sort", "File"."SortOrder", "File"."ParentID", "File"."OwnerID", "File"."ID", CASE WHEN "File"."ClassName" IS NOT NULL THEN "File"."ClassName" ELSE 'File' END AS "RecordClassName" FROM "File" WHERE ("File"."ID" IN (17)) ORDER BY "SortOrder" ASC | Unknown column '17' in 'where clause',256)
line 134 of MySQLDatabase.phpMySQLDatabase->query(SELECT "File"."ClassName", "File"."Created", "File"."LastEdited", "File"."Name", "File"."Title", "File"."Filename", "File"."Content", "File"."Sort", "File"."SortOrder", "File"."ParentID", "File"."OwnerID", "File"."ID", CASE WHEN "File"."ClassName" IS NOT NULL THEN "File"."ClassName" ELSE 'File' END AS "RecordClassName" FROM "File" WHERE ("File"."ID" IN (17)) ORDER BY "SortOrder" ASC,256)
line 126 of DB.phpDB::query(SELECT "File"."ClassName", "File"."Created", "File"."LastEdited", "File"."Name", "File"."Title", "File"."Filename", "File"."Content", "File"."Sort", "File"."SortOrder", "File"."ParentID", "File"."OwnerID", "File"."ID", CASE WHEN "File"."ClassName" IS NOT NULL THEN "File"."ClassName" ELSE 'File' END AS "RecordClassName" FROM "File" WHERE ("File"."ID" IN (17)) ORDER BY "SortOrder" ASC,256)
line 386 of SQLQuery.phpSQLQuery->execute()
line 599 of File.phpFile->instance_get("File"."ID" IN (17),,,,DataObjectSet)
line 2657 of DataObject.phpDataObject::get(File,"File"."ID" IN (17))
line 161 of MultipleFileUploadField.phpMultipleFileUploadField->Files()
line 369 of ViewableData.phpViewableData->obj(Files,,,1,)
line 411 of ViewableData.phpViewableData->cachedCall(Files,)
line 424 of ViewableData.phpViewableData->hasValue(Files)
line 11 of .cache.www.webvol11.w5.l6lgn8fcossyycu.bergstensbilder.se.public_html.uploadify.templates.Includes.AttachedFiles.ssinclude(/tmp/silverstripe-cache-www-webvol11-w5-l6lgn8fcossyycu-bergstensbilder.se-public_html/.cache.www.webvol11.w5.l6lgn8fcossyycu.bergstensbilder.se.public_html.uploadify.templates.Includes.AttachedFiles.ss)
line 392 of SSViewer.phpSSViewer->process(MultipleImageUploadField)
line 342 of ViewableData.phpViewableData->renderWith(AttachedFiles)
line 107 of MultipleFileUploadField.phpMultipleFileUploadField->refresh(SS_HTTPRequest)
line 134 of RequestHandler.phpRequestHandler->handleRequest(SS_HTTPRequest)
line 152 of RequestHandler.phpRequestHandler->handleRequest(SS_HTTPRequest)
line 152 of RequestHandler.phpRequestHandler->handleRequest(SS_HTTPRequest)
line 152 of RequestHandler.phpRequestHandler->handleRequest(SS_HTTPRequest)
line 152 of RequestHandler.phpRequestHandler->handleRequest(SS_HTTPRequest)
line 147 of Controller.phpController->handleRequest(SS_HTTPRequest)
line 283 of Director.phpDirector::handleRequest(SS_HTTPRequest,Session)
line 127 of Director.phpDirector::direct(/admin/EditForm/field/GalleryItems/UploadifyForm/field/UploadedFiles/refresh)
line 127 of main.php</ul>
Thanks for all help!
| 318 Views | ||
|
Page:
1
|
Go to Top |

