7911 Posts in 1354 Topics by 930 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » ImageDocumentManager getElementByID null issue
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 912 Views |
-
ImageDocumentManager getElementByID null issue

12 September 2009 at 9:14am
Here is some more weirdness. I'm creating a custom page for one of our departments that needs to manage images. So I create a dataobject:
class Slide extends DataObject {
static $has_one = array(
'Image' => 'Image',
'SlideshowPage' => 'SlideshowPage'
);
public function getCMSFields_forPopup() {
return new FieldSet(
new ImageField('Image')
);
}
}And a page to interact with it:
class SlideshowPage extends Page {
static $db = array(
'Speed' => 'Int'
);
static $has_many = array(
'Slides' => 'Slide'
);
function getCMSFields() {
$f = parent::getCMSFields();
$slidemanager = new ImageDataObjectManager(
$this,
'Slides',
'Slide',
'Image',
array(
'Image' => 'Image',
),
'getCMSFields_forPopup'
);
$slidemanager->allowUploadFolderSelection();
$f->addFieldToTab("Root.Content.Slides", $slidemanager);
$f->addFieldToTab("Root.Content.Slides", new TextField('Speed', 'Slideshow speed in milliseconds'));
return $f;
}
}The popup appears and all the elements load properly. I click the button to choose files, and do so. They appear queued up. I click the upload button and get what appears to be a javascript alert that says: "TypeError: document.getElementById(params[name]) is null"
When this happens nothing else occurs, no upload, etc. I don't think it is an issue with SWFUploader as putting it in debug mode doesn't report any errors. Also opening the popup in its own tab and using the firefug console doesn't help either as no JS errors appear.
Were it gets weird is two fold:
1. If I change it to FileDocumentManager it works fine (this is my temporary workaround to get them going)
2. Image Gallery also works fine. When I create an image gallery page I can upload images all day long.Any ideas?
| 912 Views | ||
|
Page:
1
|
Go to Top |

