CC-2318 Edit Metadata of Live shows doesn't work
form is not taking care that a track number should be an integer, default empty string cannot be set for integer, rejected by database.
This commit is contained in:
parent
6a181a4e9a
commit
765897600d
2 changed files with 16 additions and 15 deletions
|
@ -43,9 +43,7 @@ class Application_Form_EditAudioMD extends Zend_Form
|
||||||
'required' => true,
|
'required' => true,
|
||||||
'class' => 'input_text',
|
'class' => 'input_text',
|
||||||
'filters' => array('StringTrim'),
|
'filters' => array('StringTrim'),
|
||||||
'validators' => array(
|
'validators' => array('NotEmpty')
|
||||||
'NotEmpty',
|
|
||||||
)
|
|
||||||
));
|
));
|
||||||
|
|
||||||
// Add album field
|
// Add album field
|
||||||
|
@ -55,11 +53,12 @@ class Application_Form_EditAudioMD extends Zend_Form
|
||||||
'filters' => array('StringTrim')
|
'filters' => array('StringTrim')
|
||||||
));
|
));
|
||||||
|
|
||||||
// Add mood field
|
// Add track number field
|
||||||
$this->addElement('text', 'track_number', array(
|
$this->addElement('text', 'track_number', array(
|
||||||
'label' => 'Track:',
|
'label' => 'Track:',
|
||||||
'class' => 'input_text',
|
'class' => 'input_text',
|
||||||
'filters' => array('StringTrim')
|
'filters' => array('StringTrim'),
|
||||||
|
'validators' => array('Int')
|
||||||
));
|
));
|
||||||
|
|
||||||
// Add genre field
|
// Add genre field
|
||||||
|
@ -78,7 +77,7 @@ class Application_Form_EditAudioMD extends Zend_Form
|
||||||
array('date', false, array('YYYY-MM-DD')),
|
array('date', false, array('YYYY-MM-DD')),
|
||||||
array('date', false, array('YYYY-MM')),
|
array('date', false, array('YYYY-MM')),
|
||||||
array('date', false, array('YYYY'))
|
array('date', false, array('YYYY'))
|
||||||
)
|
)
|
||||||
));
|
));
|
||||||
|
|
||||||
// Add label field
|
// Add label field
|
||||||
|
@ -135,9 +134,9 @@ class Application_Form_EditAudioMD extends Zend_Form
|
||||||
'ignore' => true,
|
'ignore' => true,
|
||||||
'class' => 'ui-button ui-state-default',
|
'class' => 'ui-button ui-state-default',
|
||||||
'label' => 'Submit',
|
'label' => 'Submit',
|
||||||
'decorators' => array(
|
'decorators' => array(
|
||||||
'ViewHelper'
|
'ViewHelper'
|
||||||
)
|
)
|
||||||
));
|
));
|
||||||
|
|
||||||
// Add the submit button
|
// Add the submit button
|
||||||
|
@ -146,13 +145,13 @@ class Application_Form_EditAudioMD extends Zend_Form
|
||||||
'class' => 'ui-button ui-state-default ui-button-text-only md-cancel',
|
'class' => 'ui-button ui-state-default ui-button-text-only md-cancel',
|
||||||
'label' => 'Cancel',
|
'label' => 'Cancel',
|
||||||
'onclick' => 'javascript:document.location="/Library"',
|
'onclick' => 'javascript:document.location="/Library"',
|
||||||
'decorators' => array(
|
'decorators' => array(
|
||||||
'ViewHelper'
|
'ViewHelper'
|
||||||
)
|
)
|
||||||
));
|
));
|
||||||
|
|
||||||
$this->addDisplayGroup(array('submit', 'cancel'), 'submitButtons', array(
|
$this->addDisplayGroup(array('submit', 'cancel'), 'submitButtons', array(
|
||||||
'decorators' => array(
|
'decorators' => array(
|
||||||
'FormElements',
|
'FormElements',
|
||||||
'DtDdWrapper'
|
'DtDdWrapper'
|
||||||
)
|
)
|
||||||
|
|
|
@ -546,10 +546,12 @@ class StoredFile {
|
||||||
|
|
||||||
$data = array();
|
$data = array();
|
||||||
foreach ($p_values as $category => $value) {
|
foreach ($p_values as $category => $value) {
|
||||||
$escapedValue = pg_escape_string($value);
|
if (isset($value) && ($value != '')) {
|
||||||
$columnName = $category;
|
$escapedValue = pg_escape_string($value);
|
||||||
if (!is_null($columnName)) {
|
$columnName = $category;
|
||||||
$data[] = "$columnName='$escapedValue'";
|
if (!is_null($columnName)) {
|
||||||
|
$data[] = "$columnName='$escapedValue'";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue