Skip to content
Snippets Groups Projects
Commit 8d718e1a authored by Florian Azizian's avatar Florian Azizian
Browse files

FIX #12091 TIME 0:05 empty date was not updated for custom fields

parent 222d413f
No related branches found
No related tags found
No related merge requests found
...@@ -181,7 +181,7 @@ class StoreController ...@@ -181,7 +181,7 @@ class StoreController
if (!empty($args['customFields'])) { if (!empty($args['customFields'])) {
foreach ($args['customFields'] as $key => $value) { foreach ($args['customFields'] as $key => $value) {
$customField = CustomFieldModel::getById(['id' => $key, 'select' => ['type']]); $customField = CustomFieldModel::getById(['id' => $key, 'select' => ['type']]);
if ($customField['type'] == 'date') { if ($customField['type'] == 'date' && !empty($value)) {
$date = new \DateTime($value); $date = new \DateTime($value);
$value = $date->format('Y-m-d'); $value = $date->format('Y-m-d');
$args['customFields'][$key] = $value; $args['customFields'][$key] = $value;
...@@ -271,7 +271,7 @@ class StoreController ...@@ -271,7 +271,7 @@ class StoreController
if (!empty($args['customFields'])) { if (!empty($args['customFields'])) {
foreach ($args['customFields'] as $key => $value) { foreach ($args['customFields'] as $key => $value) {
$customField = CustomFieldModel::getById(['id' => $key, 'select' => ['type']]); $customField = CustomFieldModel::getById(['id' => $key, 'select' => ['type']]);
if ($customField['type'] == 'date') { if ($customField['type'] == 'date' && !empty($value)) {
$date = new \DateTime($value); $date = new \DateTime($value);
$value = $date->format('Y-m-d'); $value = $date->format('Y-m-d');
$args['customFields'][$key] = $value; $args['customFields'][$key] = $value;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment