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,
|
||||
'class' => 'input_text',
|
||||
'filters' => array('StringTrim'),
|
||||
'validators' => array(
|
||||
'NotEmpty',
|
||||
)
|
||||
'validators' => array('NotEmpty')
|
||||
));
|
||||
|
||||
// Add album field
|
||||
|
@ -55,11 +53,12 @@ class Application_Form_EditAudioMD extends Zend_Form
|
|||
'filters' => array('StringTrim')
|
||||
));
|
||||
|
||||
// Add mood field
|
||||
// Add track number field
|
||||
$this->addElement('text', 'track_number', array(
|
||||
'label' => 'Track:',
|
||||
'class' => 'input_text',
|
||||
'filters' => array('StringTrim')
|
||||
'filters' => array('StringTrim'),
|
||||
'validators' => array('Int')
|
||||
));
|
||||
|
||||
// Add genre field
|
||||
|
|
|
@ -546,10 +546,12 @@ class StoredFile {
|
|||
|
||||
$data = array();
|
||||
foreach ($p_values as $category => $value) {
|
||||
$escapedValue = pg_escape_string($value);
|
||||
$columnName = $category;
|
||||
if (!is_null($columnName)) {
|
||||
$data[] = "$columnName='$escapedValue'";
|
||||
if (isset($value) && ($value != '')) {
|
||||
$escapedValue = pg_escape_string($value);
|
||||
$columnName = $category;
|
||||
if (!is_null($columnName)) {
|
||||
$data[] = "$columnName='$escapedValue'";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue