Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

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

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

Go to End

3 Posts   2566 Views


Community Member, 20 Posts

27 May 2009 at 12:57pm

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
    * include(/home/kidscost/public_html/silverstripe-cache/
      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.


Forum Moderator, 4102 Posts

27 May 2009 at 2:17pm

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. :)


Community Member, 20 Posts

27 May 2009 at 4:20pm

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 :)