Validate text length on lockup text fields
Because of developer laziness and not a great need, we weren't doing this before. However it is good to ensure that we hold to standards that we set, so we're putting this into play. Javascript validation occurs and the server checks as well, on create and edit processes.
Merge request reports
Activity
240 $lockup_model->acronym_subject = strtoupper($post_params['acronym_subject']); 241 $lockup_model->extension_county = $post_params['extension_county']; 242 $lockup_model->style = $post_params['type']; 243 $lockup_model->user_id = \Auth::$current_user->id; 244 $lockup_model->date_created = date('Y-m-d H:i:s'); 245 $lockup_model->status = Lockup::AWAITING_APPROVAL; 246 $lockup_model->creative_status = Lockup::AWAITING_APPROVAL; 247 $lockup_model->preview_svg = $svg_text; 248 $lockup_model->vert_preview_svg = $vert_svg_text; 249 $lockup_model->approver_id = empty($post_params['approver']) ? NULL : $post_params['approver']; 250 $lockup_model->file_organization = $post_params['file_organization']; 251 $lockup_model->file_organization_acronym = $post_params['file_organization_acronym']; 252 $lockup_model->file_department = $post_params['file_department']; 253 $lockup_model->file_department_acronym = $post_params['file_department_acronym']; 254 255 $valid = TRUE; 14 \Core::$breadcrumbs[] = array('text' => 'Create Lockup'); 15 16 $context = new \stdClass; 17 $context->lockup = new Lockup; 18 $context->approvers = User::find('all', array('conditions' => array('role' => 'approver'))); 19 return self::renderView('new_lockup', $context); 20 } 21 22 public static function editAction($get_params) { 23 self::requireAuth(); 24 \Core::$breadcrumbs[] = array('text' => 'Edit Lockup'); 25 26 if (empty($get_params['id'])) { 27 \Core::notFound(); 13 private static function checkTextFieldLength($params, $field, $max_length) { 14 if (strlen($params[$field]) > $max_length) { mentioned in commit d910c69f
Please register or sign in to reply