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

Feature Requests


75 Posts   13707 Views


22 June 2010 at 2:50am 4085 Posts

@timwjohn: HasMany and ManyMany FileDOM has existed for well over a year. I never added them for ImageDOM, because it seemed a little pointless.. ImageDOM is nothing more than an FDOM with a little resizing widget and automatically filtered file types. The latter can be added with one line of code.

@howard -- That functionality exists, and I believe I've checked it in. I used it recently on a project and I just need to find out where.


22 June 2010 at 4:26am (Last edited: 22 June 2010 4:29am), Community Member, 51 Posts

@howard : I'm not sure about a primary sort by associated/related records -- this functionality would be nice && UC may detail. Here's my workaround;

$dom = new ManyManyFileDataObjectManager(....);
$relationCount = $this->owner->$relation()->Count();
$dom->setOnlyRelated((bool) $relationCount );

Basically I check to see if there are related records during the getCMSFields where I instantiate the DOM, and if so, set it so it defaults to showing only related records.

So in the above, you could change $relation() to Videos() if your many-many relation is named "Videos".

NOTE: I'm doing this in a DataObjectDecorator using updateCMSFields() .. thus you'll probably want to do

$relationCount = $this->Videos()->Count();

in getCMSFields)().

Hope this makes sense.

Richard Sjöqvist

22 June 2010 at 11:01pm Community Member, 4 Posts

@UC: Here's the updated patch. Is this more like what you had in mind?

- ORIGINAL CODE - - - - - - - - - - - - - - - -
$.post($target.attr('href'),params,function() {$($target).parents('li:first').fadeOut();$(".ajax-loader").fadeOut("fast");});

- PATCHED CODE - - - - - - - - - - - - - - - - -
request = $.ajax({
   cache:      false,
   url:      $target.attr('href'),
   data:      params,
   error:      function(xhr){statusMessage(xhr.responseText,'bad');},
   success:   function(message){
- - - - - - - - - - - - - - - - - - - - - - - -


class MyClass extends DataObject {
   function onBeforeDelete()
      // 2.3 compatibility
      $class = class_exists('SS_HTTPResponse') ? 'SS_HTTPResponse' : 'HTTPResponse';
      if(<check if object can be deleted>)
         // Send success message
         $response = new $class("Item successfully deleted");
         // Send error message
         $response = new $class("Cannot delete this item", 401);
         exit; // Stop the object from being deleted

Andrew Houle

8 July 2010 at 5:36am Community Member, 132 Posts

I'd like to second this request that was made a while back by Shawn Parr...

"It would be great if there could be an ics feed for all the calendar events, along with the individual ics and full rss capabilities. This would be especially awesome in conjunction with the ICS feed feature. "

Is this already setup? If not is it possible?


5 August 2010 at 6:32am Community Member, 125 Posts

I would love it if SWFUpload and the DataObjectManager would integrate with Amazon S3 cloud servers.
I would pay for this feature to be developed if someone is interested.


5 August 2010 at 6:39am 4085 Posts

Yup. Working on it now, actually.


5 August 2010 at 6:55am Community Member, 125 Posts

SICK! I figured a workaround to allowing it to show progress on upload to S3 in flash (requires a small bit of JS changes) if you are interested.


5 August 2010 at 7:10am 4085 Posts

Sure, go ahead and post 'em.