Jump to:

7940 Posts in 1543 Topics by 946 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » ImageGallery Module Error: [Notice] Trying to get property of non-object

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: 2054 Views
  • sysyphus
    Community Member
    20 Posts

    ImageGallery Module Error: [Notice] Trying to get property of non-object Link to this post

    Hi all,

    I've been using ImageGallery to display a slideshow. Last night I went to add more images to the slideshow using Admin --> Files & Images --> Upload - This is something I've done before successfully, last night when I then went to the slideshow page to link the uploads in the photos tab the images came up as broken (ie they didn't show thumbnails of the images) so I unlinked them. When I then tried to refresh the webpage in my browser I cam up with the following warning:

    [Notice] Trying to get property of non-object
    GET /costumes/album/

    Line 351 in /home/kidscost/public_html/image_gallery/code/ImageGalleryPage.php

    342    }
    344    public function PrevAlbum()
    345    {
    346       return $this->adjacentAlbum("prev");
    347    }
    349    public function AlbumTitle()
    350    {
    351       return $this->CurrentAlbum()->AlbumName;
    352    }
    354    public function SingleAlbumView()
    355    {
    356       if($this->Albums()->Count() == 1) {
    357          $this->current_album = $this->Albums()->First();


    * ImageGalleryPage_Controller->AlbumTitle()
    * call_user_func_array(Array,Array)
    Line 409 of ViewableData.php
    * ViewableData->XML_val(AlbumTitle,,1)
    Line 63 of .cache.home.kidscost.public_html.image_gallery.templates.Layout.ImageGalleryPage_album.ss
    * include(/home/kidscost/public_html/silverstripe-cache/.cache.home.kidscost.public_html.image_gallery.templates.Layout.ImageGalleryPage_album.ss)
    Line 354 of SSViewer.php
    * SSViewer->process(ImageGalleryPage_Controller)
    Line 346 of SSViewer.php
    * SSViewer->process(ImageGalleryPage_Controller)
    Line 175 of Controller.php
    * Controller->handleAction(HTTPRequest)
    Line 107 of RequestHandler.php
    * RequestHandler->handleRequest(HTTPRequest)
    Line 122 of Controller.php
    * Controller->handleRequest(HTTPRequest)
    Line 28 of ModelAsController.php
    * ModelAsController->handleRequest(HTTPRequest)
    Line 277 of Director.php
    * Director::handleRequest(HTTPRequest,Session)
    Line 121 of Director.php
    * Director::direct(costumes/album/)
    Line 115 of main.php

    I'm using SS 2.3.1 and am assuming I'm using the latest builds of the DOM and ImageGallery modules (I downloaded them about 2 weeks ago). I did have a search on the SS forums and elsewhere and did come across other people having similar issues with galleries but I couldn't find any fixes.

  • UncleCheese
    4085 Posts

    Re: ImageGallery Module Error: [Notice] Trying to get property of non-object Link to this post

    Yeah, you can't do that. By uploading through the Files & Images section, the files are not being stored properly as ImageGalleryImage and ImageGalleryItem objects.

    To do that, you're going to need to upload to a designated folder in your assets section, then use the import feature of the ImageGallery. You could save a whole lot of trouble by just uploading through the ImageGallery interface.

  • sysyphus
    Community Member
    20 Posts

    Re: ImageGallery Module Error: [Notice] Trying to get property of non-object Link to this post

    Hi UncleCheese,

    That's how I've uploaded in the past, interesting it's just decided to break this time.... I'll do a clean install of the necessary modules and start again. I had a feeling there were some file ownership issues starting to creep in - so time to start over and do it properly methinks

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.