Jump to:

7935 Posts in 1536 Topics by 943 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Errors With Image Gallery

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1
Go to End
Author Topic: 1511 Views
  • Liam
    Avatar
    Community Member
    470 Posts

    Errors With Image Gallery Link to this post

    I've used this script on multiple sites with no problems, but setup a new site I'm working on and I'm getting errors.

    [Notice] Trying to get property of non-object
    POST /admin/EditForm/field/GalleryItems/UploadifyForm?SecurityID=cd5e68cc288b37ecdc6847690cae985094084cd1&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_2&ctf[GalleryItems][view]=grid&ctf[GalleryItems][imagesize]=100

    & line 418 is the highlighted in red error in FileDataObjectManager.php:

    $file_class = $this->fileClassName;
    410       $do_class = $this->sourceClass();
    411       $idxfield = $this->fileFieldName."ID";
    412       $fff = $this->fileFieldName;
    413       $dataobject_ids = array();
    414       if($this->hasDataObject) {
    415          foreach($data['UploadedFiles'] as $id) {
    416             if($file = DataObject::get_by_id("File", (int) $id)) {
    417                $upload_folder = $form->Fields()->fieldByName('UploadedFiles')->uploadFolder;
    418                $folder_id = Folder::findOrMake($upload_folder)->ID;
    419                if($file->ParentID != $folder_id) {
    420                   $new_file_path = $this->uploadFolder.'/'.$file->Name;
    421                   copy($file->getFullPath(), BASE_PATH.'/'.ASSETS_DIR.'/'.$new_file_path);
    422                   $clone = new $file_class();
    423                   $clone->Filename = $new_file_path;
    424                   $clone->ParentID = $folder_id;                  

    Using the latest version of everything including SS. Using uploadify.

    I can create the imagegallery page type, but when I upload errors, they're all broken. Also, the link to the test album I setup throws a 404 error. The link is domain.com/photos/album/26

    Any ideas?

  • Liam
    Avatar
    Community Member
    470 Posts

    Re: Errors With Image Gallery Link to this post

    I just tried installing this on a fresh install on the same server and ran into the same errors. Uploadify works, as I tested that before installing the image gallery.

    I've tested this in both Chrome and Firefox. When I go to create the image gallery page in the site tree, nothing happens. When I reload the page, the new pagetype is there in the site tree. When I go to change the name of the page and hit save, it says 'error saving content' and nothing happens. But when I refresh the page, the change is in place.

    I have the site in dev mode but no other specific errors other than what I posted in the first thread.

    Any idea at all? I'm pretty stumped. This is my own server where I've installed and used image gallery dozens of times, so the configuration should be fine. It appears to be this latest version I'm using.

  • Musicaldustbin
    Avatar
    Community Member
    13 Posts

    Re: Errors With Image Gallery Link to this post

    I've also been having this problem with the the image gallery, When using the latest version of silverstripe. Also when photos have been succfully loaded into the gallery they do not load on the live site the lodaing gif just spins indefinitely.

  • _Vince
    Avatar
    Community Member
    158 Posts

    Re: Errors With Image Gallery Link to this post

    I am having the same problem, too.

  • Liam
    Avatar
    Community Member
    470 Posts

    Re: Errors With Image Gallery Link to this post

    Make sure you grab it from GitHub - https://github.com/unclecheese/

    I wasn't thinking and downloaded it from the SS module page which is the old svn version at least when I did it a few months ago.

    With that said, I still get the error below as I wrote earlier:

    ======
    When I go to create the image gallery page in the site tree, nothing happens. When I reload the page, the new pagetype is there in the site tree. When I go to change the name of the page and hit save, it says 'error saving content' and nothing happens. But when I refresh the page, the change is in place.
    ======

    But for the most part it works and I can upload images and view them on the front end. Just creating the page is a little buggy and takes some refreshes.

  • Arbee
    Avatar
    Community Member
    17 Posts

    Re: Errors With Image Gallery Link to this post

    Did you get this fixed? I am having the same problem. When I check in the images and files tab, there are all sorts of folders. I'm having lots of problems getting the photos in.

    1511 Views
Page: 1
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.