CC-2986: Long show description causes Add Show or Edit Show to fail silently
Added StringLength validators for the UI fields. This way when user gave more than what they should gave as the input, it's going to display an error msg. The maximum length for the fields is queried from the database before the fields were initialized.
This commit is contained in:
parent
6d15308e1d
commit
a65fb97aec
2 changed files with 26 additions and 7 deletions
|
@ -1338,4 +1338,19 @@ class Application_Model_Show {
|
|||
|
||||
return $CC_DBC->GetAll($sql);
|
||||
}
|
||||
|
||||
public static function GetMaxLengths() {
|
||||
global $CC_CONFIG, $CC_DBC;
|
||||
$sql = "SELECT column_name, character_maximum_length FROM information_schema.columns"
|
||||
." WHERE table_name = 'cc_show' AND character_maximum_length > 0";
|
||||
$result = $CC_DBC->GetAll($sql);
|
||||
|
||||
// store result into assoc array
|
||||
$assocArray = array();
|
||||
foreach($result as $row) {
|
||||
$assocArray[$row['column_name']] = $row['character_maximum_length'];
|
||||
}
|
||||
|
||||
return $assocArray;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue