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.

All other Modules

Discuss all other Modules here.

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

ModelAdmin - file upload not working for Content Contributor


Reply

357 Views

Avatar
BenWu

20 June 2012 at 11:04pm Community Member, 90 Posts

Hello,

I got a class

class Event extends DataObject {

static $db = array(
'Intro'=>'Text',
'Content'=>'HTMLText',

);
}

which is managed by ModelAdmin:
class EventAdmin extends ModelAdmin{
static $url_segment='events';
static $menu_title ='Events';

public static $managed_models = array('Event');

}

Now when I login as the default admin, click on edit/add an event, the content field is shown as a tinymce. If I want to insert an image, i can click on the right hand side to upload a new image with no problem.

However, when i login as an Content Contributor (which is allowed access to the Events section), I can add/remove/edit an event fine. The content contributor doesn't have access to the 'Page' section. When I would like to insert an image in tinymce, right after i choose an image to upload, my browser goes to blank.

To make it works again, I have to give content contributor access to the 'Page' section. It's a work-around and it doesn't resolve my problem at all. It looks like there is some problem with base.js which is tricky to debug