Fix migration
This commit is contained in:
parent
98a894fd1e
commit
78dfe881d2
|
@ -58,11 +58,16 @@ class CreateTicketSettings extends SettingsMigration
|
||||||
$old_value = DB::table('settings_old')->where('key', '=', $key)->get(['value', 'type'])->first();
|
$old_value = DB::table('settings_old')->where('key', '=', $key)->get(['value', 'type'])->first();
|
||||||
|
|
||||||
// Handle the old values to return without it being a string in all cases.
|
// Handle the old values to return without it being a string in all cases.
|
||||||
|
|
||||||
|
if (is_null($old_value)) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
if ($old_value->type === "string" || $old_value->type === "text") {
|
if ($old_value->type === "string" || $old_value->type === "text") {
|
||||||
if (is_null($old_value->value)) {
|
if (is_null($old_value->value)) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Some values have the type string, but their values are boolean.
|
// Some values have the type string, but their values are boolean.
|
||||||
if ($old_value->value === "false" || $old_value->value === "true") {
|
if ($old_value->value === "false" || $old_value->value === "true") {
|
||||||
return filter_var($old_value->value, FILTER_VALIDATE_BOOL);
|
return filter_var($old_value->value, FILTER_VALIDATE_BOOL);
|
||||||
|
|
Loading…
Reference in a new issue