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

DOM + ImageDOM breaks drag and drop reordering on DOM


Reply

5 Posts   1725 Views

Avatar
Carbon Crayon

18 November 2009 at 12:19pm (Last edited: 18 November 2009 12:21pm), Community Member, 598 Posts

Hi Uncle Cheese

I appear to have found a strange bug whereby if you use an image DOM and a normal DOM on the same page, the drag and drop reordering on the normal DOM does not work. As soon as I change the ImageDOM to a FileDOM it then the normal DOMs re-ordering starts working.

When I say it doesnt work, you can check the box and as you hover over the items you get the multi directional arrow, but when you try to drag them it does nothing. I assume it must be a JS conflict of some sort?

What is strange is that I am also running the image gallery which has a normal DOM for albums and a ImageDOM for images yes seems to work fine....

Many thanks

Aram

Avatar
klikhier

8 December 2009 at 10:37pm Community Member, 150 Posts

I also ran into this problem again today. Situation:

Page.php with ImageDOM
HomePage.php extends Page.php and adds DOM

SortableDataObject::add_sortable_class('Photo'); in _config.php
SortableDataObject::add_sortable_class('HomePageLink'); in _config.php

Now with this setup I was not able to reorder the DOM on the HomePage page type.

Solution (work-around):

I removed the ImageDOM in Homepage.php:

$fields->removeByName("Images");

Now I was able to reorder the DOM on the HomePage page type.

Avatar
klikhier

27 January 2010 at 12:27am Community Member, 150 Posts

Found solution. Drag-and-drop ONLY seems to break if ImageDOM tab is added before DOM tab. If ImageDOM is added after normal DOM everything seems to work fine:

public function getCMSFields() {
$fields = parent::getCMSFields();

// Add DOM tab

// Add ImageDOM tab

return $fields;
}

Avatar
UncleCheese

27 January 2010 at 2:37am 4085 Posts

This was fixed a few revs ago. See "OMG New Stuff" thread.

Avatar
klikhier

29 January 2010 at 12:31am Community Member, 150 Posts

Ok, use latest version now. Many_many thanks!