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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

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

2.4.3 and latest Image_Gallery, can't import from existing folders


Go to End


6 Posts   1918 Views

Avatar
Wilson

Community Member, 63 Posts

21 December 2010 at 6:29pm

Hi UC,

This may very well be an error in my installation, but I've installed image_gallery similar as in the past and when I try to import from existing FileStore images into an album, I get:

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

Line 140 in .../image_gallery/code/ImageGalleryManager.php
Source

137 	public function getPreviewFieldFor($fileObject, $size = 150)
138 	{
139 		if($fileObject instanceof Image) {
140 			$URL = $fileObject->SetHeight($size)->URL;

Do I need to set a relationship in Page.php or Photo.php to fix this? Like, say:

public static $has_many = array (
	'Album' => 'Photos'
);

As always, thanks!
Wilson

Avatar
Wilson

Community Member, 63 Posts

21 December 2010 at 6:30pm

I should add, that I can upload from my machine and also import into the gallery outside of albums.

Avatar
DsX

Community Member, 178 Posts

22 December 2010 at 11:00am

I am also getting the same behavior.
I will add that I am also having a hard time uploading to a specific asset folder. It seems to always put new images in the root of the asset folder.

Avatar
Nicolaas

Forum Moderator, 224 Posts

1 June 2011 at 3:41am

I am experiencing the same issue - Wilson, did you find a solution for this?

Avatar
Wilson

Community Member, 63 Posts

1 June 2011 at 2:47pm

Last time I checked, I was still getting it. In the meantime, I plan to train my clients to upload rather than 'Choose Existing', when they ask.

UC explained in another similar thread, that's it quite a difficult issue due to a single image needing to be two classes. Someone else posted a 'many many' data model (I believe) that may be the answer. I'll try and find the thread. Or if you find it, let's put the link here.

Avatar
Nicolaas

Forum Moderator, 224 Posts

3 June 2011 at 3:52am

I am extending the ImageGalleryPage and I think this is the problem...