Jump to:

7935 Posts in 1536 Topics by 943 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: 2033 Views
  • sysyphus
    Avatar
    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
    Source

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

    Trace

    * 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
    Avatar
    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
    Avatar
    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

    2033 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.