diff --git a/FieldtypeColorPicker.module b/FieldtypeColorPicker.module index 25bc4c4..4e0eb4b 100644 --- a/FieldtypeColorPicker.module +++ b/FieldtypeColorPicker.module @@ -57,6 +57,7 @@ class FieldtypeColorPicker extends Fieldtype { */ public function ___formatValue(Page $page, Field $field, $value){ + if(is_null($field->default)) $field->default=''; if(!$value) $value = trim($field->default); if(!strlen($value)) return $value; if(!$field->formatting) return $value; diff --git a/InputfieldColorPicker.module b/InputfieldColorPicker.module index 3fa5a30..5df5c83 100644 --- a/InputfieldColorPicker.module +++ b/InputfieldColorPicker.module @@ -62,6 +62,7 @@ class InputfieldColorPicker extends Inputfield { /** * add swatches for predefined color values | @Rayden */ + if(is_null($this->swatch)) $this->swatch=''; $swatch = trim($this->swatch); if(strlen($swatch)) {