Fixes the datepicker saving an empty value when disabled
Refs https://github.com/responsiv/campaign-plugin/issues/4
This commit is contained in:
parent
00be75ce13
commit
a186a60c43
|
|
@ -97,7 +97,8 @@ abstract class FormWidgetBase extends WidgetBase
|
|||
}
|
||||
|
||||
/**
|
||||
* Process the postback value for this widget.
|
||||
* Process the postback value for this widget. If the value is omitted from
|
||||
* postback data, it will be NULL, otherwise it will be an empty string.
|
||||
* @param $value The existing value for this widget.
|
||||
* @return string The new value for this widget.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<?php namespace Backend\FormWidgets;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Backend\Classes\FormField;
|
||||
use Backend\Classes\FormWidgetBase;
|
||||
|
||||
/**
|
||||
|
|
@ -139,6 +140,10 @@ class DatePicker extends FormWidgetBase
|
|||
*/
|
||||
public function getSaveValue($value)
|
||||
{
|
||||
if ($this->formField->disabled) {
|
||||
return FormField::NO_SAVE_DATA;
|
||||
}
|
||||
|
||||
if (!strlen($value)) {
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue