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, biapar, Willr, Ingo, swaiba, simon_w

Errors With Image Gallery


Reply


6 Posts   1570 Views

Avatar
Liam

Community Member, 470 Posts

7 April 2011 at 8:44am

Edited: 07/04/2011 8:45am

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?

Avatar
Liam

Community Member, 470 Posts

8 April 2011 at 9:08am

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.

Avatar
Musicaldustbin

Community Member, 13 Posts

8 April 2011 at 2:31pm

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.

Avatar
_Vince

Community Member, 162 Posts

8 June 2011 at 9:00pm

I am having the same problem, too.

Avatar
Liam

Community Member, 470 Posts

9 June 2011 at 2:21am

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.

Avatar
Arbee

Community Member, 21 Posts

14 January 2012 at 11:26am

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.