don't bother trimming if it's going to exit anyways.

removes a warning on empty attribute.
pull/1184/head
Steve Fossen 2016-05-27 07:00:55 -07:00
parent 044755fe07
commit a308f8dcf5
1 changed files with 3 additions and 3 deletions

View File

@ -513,13 +513,13 @@ class Attribute extends AppModel {
public function beforeValidate($options = array()) {
parent::beforeValidate();
// remove leading and trailing blanks
$this->data['Attribute']['value'] = trim($this->data['Attribute']['value']);
if (!isset($this->data['Attribute']['type'])) {
return false;
}
// remove leading and trailing blanks
$this->data['Attribute']['value'] = trim($this->data['Attribute']['value']);
// make some last changes to the inserted value
$this->data['Attribute']['value'] = $this->modifyBeforeValidation($this->data['Attribute']['type'], $this->data['Attribute']['value']);