Jump to:

7939 Posts in 1472 Topics by 944 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Image Gallery not working in 2.3.4, bug?

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1 2 3 4
Go to End
Author Topic: 4693 Views
  • Scorpiankh
    Avatar
    Community Member
    60 Posts

    Re: Image Gallery not working in 2.3.4, bug? Link to this post

    ok in dev mode the error when i try to create a new gallery page is:

    ERROR [User Error]: Bad RecordClassName '' and $baseClass not set
    IN POST /admin/AddPageOptionsForm
    Line 2762 in C:\Domains\kenpo-karate.co.nz\wwwroot\sapphire\core\model\DataObject.php

    Source
    ======
    2753:      foreach($records as $record) {
    2754:         if(empty($record['RecordClassName'])) {
    2755:            $record['RecordClassName'] = $record['ClassName'];
    2756:         }
    2757:         if(class_exists($record['RecordClassName'])) {
    2758:            $results[] = new $record['RecordClassName']($record);
    2759:         } else {
    2760:            if(!$baseClass) {
    2761:               user_error("Bad RecordClassName '{$record['RecordClassName']}' and "
    * 2762:                  . "\$baseClass not set", E_USER_ERROR);
    2763:            } else if(!is_string($baseClass) || !class_exists($baseClass)) {
    2764:               user_error("Bad RecordClassName '{$record['RecordClassName']}' and bad "
    2765:                  . "\$baseClass '$baseClass not set", E_USER_ERROR);
    2766:            }
    2767:            $results[] = new $baseClass($record);
    2768:         }

    Trace
    =====
    <ul>user_error(Bad RecordClassName '' and $baseClass not set,256)
    line 2762 of DataObject.php

    DataObject->buildDataObjectSet(MySQLQuery,DataObjectSet)
    line 745 of File.php

    File->instance_get("File"."ParentID" = 19 AND "File"."ID" != 19,,,,DataObjectSet)
    line 2714 of DataObject.php

    DataObject::get(File,"File"."ParentID" = 19 AND "File"."ID" != 19,)
    line 531 of Hierarchy.php

    Hierarchy->stageChildren(1)

    call_user_func_array(Array,Array)
    line 693 of Object.php

    Object->__call(stageChildren,Array)

    Folder->stageChildren(1)
    line 413 of Hierarchy.php

    Hierarchy->AllChildren()

    call_user_func_array(Array,Array)
    line 693 of Object.php

    Object->__call(AllChildren,Array)

    Folder->AllChildren()
    line 343 of Folder.php

    Folder->updateFilesystem()
    line 345 of Folder.php

    Folder->updateFilesystem()
    line 345 of Folder.php

    Folder->updateFilesystem()
    line 355 of File.php

    File->onBeforeWrite()
    line 936 of DataObject.php

    DataObject->write()
    line 77 of ImageGalleryPage.php

    ImageGalleryPage->checkFolder()
    line 63 of ImageGalleryPage.php

    ImageGalleryPage->onAfterWrite()
    line 1056 of DataObject.php

    DataObject->write()
    line 559 of CMSMain.php

    CMSMain->addpage(Array,Form,SS_HTTPRequest)
    line 300 of Form.php

    Form->httpSubmission(SS_HTTPRequest)
    line 137 of RequestHandler.php

    RequestHandler->handleRequest(SS_HTTPRequest)
    line 155 of RequestHandler.php

    RequestHandler->handleRequest(SS_HTTPRequest)
    line 147 of Controller.php

    Controller->handleRequest(SS_HTTPRequest)
    line 281 of Director.php

    Director::handleRequest(SS_HTTPRequest,Session)
    line 124 of Director.php

    Director::direct(/admin/AddPageOptionsForm)
    line 127 of main.php

    </ul>

  • UncleCheese
    Avatar
    4085 Posts

    Re: Image Gallery not working in 2.3.4, bug? Link to this post

    Check your File table and make sure there are no records with null ClassName fields.

    --------------------
    SilverStripe tips, tutorials, screencasts and more: http://www.leftandmain.com

  • Scorpiankh
    Avatar
    Community Member
    60 Posts

    Re: Image Gallery not working in 2.3.4, bug? Link to this post

    There are 4 images in there with blank ClassName fields, all from the assets/image-gallery/album folder that I couldn't delete ...
    Should I delete these from the database?

  • Storm Striker
    Avatar
    Community Member
    6 Posts

    Re: Image Gallery not working in 2.3.4, bug? Link to this post

    Hi everybody.........!

    Im using version SS 2.4.4

    First Case :

    Im also getting the same error. When i create a new image gallery page and click the go button, the gallery page doesn't appear in the site tree as the normal page types appear within a flash of second.
    So what i do is, i'll refresh the the page once, then the gallery page appears in the site tree.

    Second Case :

    Any how the page is created after the page is refreshed, but here is the second error, When i save the page, it says ' Error Saving '.
    This error is thrown for some time. and then n then when i change the page name by luck the gallery page gets saved.

    Please Uncle Cheese ............ what is this, why is this problem occurring? and what is the sollution.
    Any body with the answer, please help me out, i'll be thank full to u.

    Thanq..........!

  • Scorpiankh
    Avatar
    Community Member
    60 Posts

    Re: Image Gallery not working in 2.3.4, bug? Link to this post

    I fixed the problem I was having by deleting the images with the blank class names from the database.

    I've since had the problem again with another website and something similar with another website again. It seems that sometimes when you create a gallery page, it creates multiple 'Gallery' folders within the 'Files and Images' section of the CMS (for example, on one website I built, after creating a gallery page and then getting the error when trying to save, I looked at the Files and Images section and found that it had created one folder gallery 'Gallery' which was empty, and one folder called 'Image-Gallery' which contained 2 folders also called 'Gallery', one of which contained a folder called 'Default album')
    I fixed the problem by deleting these folders from the Files and Images Section, then going back to the Gallery page and clicking Save again.
    It seems that the image gallery gets confused when there are multiple folders called Gallery and so returns an error. As for why it's creating multiple folders in the first place? I have no idea.

    I'm now getting a different but similar problem occuring where when creating albums it's sometimes creating duplicate album folders in the files and images section (these duplicate folders are appearing both inside the 'image-gallery' folder and outside it), and if I try to upload images to that album they're coming up blank. If I try to visit that album page on the website it tells me the page doesn't exist. I was hoping to fix this problem in the same way as I fixed the gallery problem, deleted the duplicate folders from the files and images section, and saved the album again, which created just one album folder this time, but it was outside of the 'image-gallery' folder, and the website is still telling me the page doesn't exist. Tried to delete the affected album from the albums list but nothing happened when I clicked delete. Am now trying to find some sort of error message.

  • Storm Striker
    Avatar
    Community Member
    6 Posts

    Re: Image Gallery not working in 2.3.4, bug? Link to this post

    Thank you ' @Scorpiankh ' for letting me know what was the problem. Let me try what u did.

  • joey
    Avatar
    Community Member
    9 Posts

    Re: Image Gallery not working in 2.3.4, bug? Link to this post

    I was getting the same error. I changed the page name, nav name and title then I was able to save and it changed the names under folders/files.

    Then I created a gallery and added one image but the thumbnail is blank and the image doesn't show:

    http://www.rbsportsclub.com/photo-album/

    http://www.rbsportsclub.com/assets/image-gallery/Photo-Album/2011-golf-classic/IMG6589.JPG

    I know I've comes across this before but I just cannot for the life of me remember what I did to fix it. Any ideas anyone?

    Thanks,
    Joe

  • joey
    Avatar
    Community Member
    9 Posts

    Re: Image Gallery not working in 2.3.4, bug? Link to this post

    Got it, just edited the .htaccess file in the assets directory and it solved it.

    Joe

    4693 Views
Page: 1 2 3 4
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.