3070 Posts in 869 Topics by 651 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 195 Views |
-
File data type cause error

20 November 2012 at 7:02am
Hi,
Forgive me if my problem are related to datamodel, but its hapen in DataObject child class. I using "file" type in my class. Its look like this :
class JakpusUpdate extends DataObject {
public static $db = array(
'InfoMsg' => 'Varchar(255)'
);public static $has_one = array(
'InfoFile' => 'File',
'JakpusUpdateListPage' => 'JakpusUpdateListPage'
);// Summary fields
public static $summary_fields = array(
'InfoMsg' => 'Info Update',
'InfoFile' => 'Gambar / Video',
'Created' => 'Dibuat'
);public function getCMSFields_forPopup() {
$fileField = new UploadField('InfoFile', 'Gambar / Video');
$fileField->allowedExtensions = array('jpg','gif','png', 'flv');// Name, Description and Website fields
return new FieldList(
new TextareaField('InfoMsg', 'Info Update'),
$fileField
);
}
}Point on this code
public static $has_one = array(
'InfoFile' => 'File',
'JakpusUpdateListPage' => 'JakpusUpdateListPage'
);Its give me Server Error page when I tried to accessed backend editor related to this class, its show like pic I've attached.
But if, change the code to this, the error not showup :
public static $has_one = array(
'InfoFile' => 'Image',
'JakpusUpdateListPage' => 'JakpusUpdateListPage'
);I don't have any clue why this happen. Can anyone help me ?
thanks.
-
Re: File data type cause error

19 December 2012 at 4:29am
You should always show error message with "dev" environment turned on in order to receive any help, otherwise we won't have any clue what's going on.
-
Re: File data type cause error

19 December 2012 at 12:37pm
Yeah, it is a dump mistake. I forgot to set the environment setting. I have solved this problem.
Case close.
| 195 Views | ||
|
Page:
1
|
Go to Top |

