CC-5211:
Php Exception: Set large number as year in tracks Metadata fixed
This commit is contained in:
parent
f7a6fec5eb
commit
6498f43dad
|
@ -426,6 +426,9 @@ class LibraryController extends Zend_Controller_Action
|
|||
|
||||
$request = $this->getRequest();
|
||||
|
||||
|
||||
|
||||
|
||||
$file_id = $this->_getParam('id', null);
|
||||
$file = Application_Model_StoredFile::RecallById($file_id);
|
||||
|
||||
|
@ -438,7 +441,15 @@ class LibraryController extends Zend_Controller_Action
|
|||
$form->populate($file->getDbColMetadata());
|
||||
|
||||
if ($request->isPost()) {
|
||||
if ($form->isValid($request->getPost())) {
|
||||
|
||||
$js = $this->_getParam('data');
|
||||
$serialized = array();
|
||||
//need to convert from serialized jQuery array.
|
||||
foreach ($js as $j) {
|
||||
$serialized[$j["name"]] = $j["value"];
|
||||
}
|
||||
|
||||
if ($form->isValid($serialized)) {
|
||||
|
||||
$formValues = $this->_getParam('data', null);
|
||||
$formdata = array();
|
||||
|
|
|
@ -39,7 +39,7 @@ class Application_Form_EditAudioMD extends Zend_Form
|
|||
$this->addElement('text', 'track_number', array(
|
||||
'label' => _('Track:'),
|
||||
'class' => 'input_text',
|
||||
'filters' => array('StringTrim')
|
||||
'filters' => array('StringTrim'),
|
||||
));
|
||||
|
||||
// Add genre field
|
||||
|
@ -50,16 +50,18 @@ class Application_Form_EditAudioMD extends Zend_Form
|
|||
));
|
||||
|
||||
// Add year field
|
||||
$this->addElement('text', 'year', array(
|
||||
'label' => _('Year:'),
|
||||
'class' => 'input_text',
|
||||
'filters' => array('StringTrim'),
|
||||
'validators' => array(
|
||||
$year = new Zend_Form_Element_Text('year');
|
||||
$year->class = 'input_text';
|
||||
$year->setLabel(_('Year:'))
|
||||
->setFilters(array('StringTrim'))
|
||||
->setValidators(array(
|
||||
new MyValidator(),
|
||||
new Zend_Validate_StringLength(array('max' => 10)),
|
||||
Application_Form_Helper_ValidationTypes::overrrideDateValidator("YYYY-MM-DD"),
|
||||
Application_Form_Helper_ValidationTypes::overrrideDateValidator("YYYY-MM"),
|
||||
Application_Form_Helper_ValidationTypes::overrrideDateValidator("YYYY")
|
||||
)
|
||||
));
|
||||
));
|
||||
$this->addElement($year);
|
||||
|
||||
// Add label field
|
||||
$this->addElement('text', 'label', array(
|
||||
|
|
Loading…
Reference in New Issue