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

Upload Location? ImageGallery plus Subsites


4 Posts   796 Views


2 April 2010 at 3:02am Community Member, 63 Posts

Hi UncleCheese,

Wondered if you might be able to help me debug an issue, or if you would be interested in an hour or two of work today?

I'm running SS 2.4beta1, recent ImageGallery mod and recent Subsites working. At one point last week, the project seemed to be very stable so I locked all their revision numbers in my externals. Everything's great.

The one last issue I have is that when a User uploads files in the Files & Images area, it uploads into the correct 'virtual' directory but then creates another blank 'virtual' parent directory. I've pored through FileDataObjectManager.php and the SWFUpload code, turned the debugger on, etc. But am not able to -pinpoint what's creating the extra Folder. Perhaps, it's a JOIN query in the SQL that's causing it? If I set the 'SubsiteID' to 0 in the File table, then it works, but the User can then see all of the other Users asset directories.

A minor related issue, is that the file is physically uploaded to the '/assets/' root instead of into the selected directory.

Everything appears OK to the end-user, except for the extra directory created.

Thanks for your time!



2 April 2010 at 3:10pm Community Member, 63 Posts

Still debugging. Everything looks fine in both the SWFUpload debugger and PHP logs (incidentally I found a nice way to debug the PHP functions that you can't see with SS debugger or FirePHP is just to write it to PHP error_log, probably obvious).

Is it possible there is a variable type issue? All of my asset folders are numbers, based on the ID of a particular store for this corporate HQ.

Thanks for any help anyone.


2 April 2010 at 4:44pm Community Member, 63 Posts

The problem appears to be in line 23 of Folder.php.

$item = DataObject::get_one("Folder", "\"Name\" = '$part' AND \"ParentID\" = $parentID");

The filter is correct, but it's returning false.


2 April 2010 at 6:34pm Community Member, 63 Posts

Crazy thing is I can do $item = DataObject::get_by_id('Folder', AN ID); and it works.

Something must be overriding 'get_one'?