diff --git a/controllers/EditAsset.php b/controllers/EditAsset.php index a057529c..fed113d8 100644 --- a/controllers/EditAsset.php +++ b/controllers/EditAsset.php @@ -42,7 +42,8 @@ class EditAsset extends HTMLController // Key info if (isset($_POST['title'], $_POST['slug'], $_POST['date_captured'], $_POST['priority'])) { - $date_captured = !empty($_POST['date_captured']) ? new DateTime($_POST['date_captured']) : null; + $date_captured = !empty($_POST['date_captured']) ? + new DateTime(str_replace('T', ' ', $_POST['date_captured'])) : null; $slug = strtr($_POST['slug'], [' ' => '-', '--' => '-', '&' => 'and', '=>' => '', "'" => "", ":"=> "", '\\' => '-']); $asset->setKeyData(htmlspecialchars($_POST['title']), $slug, $date_captured, intval($_POST['priority'])); } @@ -50,9 +51,11 @@ class EditAsset extends HTMLController // Handle tags $new_tags = []; if (isset($_POST['tag']) && is_array($_POST['tag'])) + { foreach ($_POST['tag'] as $id_tag => $bool) if (is_numeric($id_tag)) $new_tags[] = $id_tag; + } $current_tags = array_keys($asset->getTags()); diff --git a/templates/EditAssetForm.php b/templates/EditAssetForm.php index 70288426..3589cf12 100644 --- a/templates/EditAssetForm.php +++ b/templates/EditAssetForm.php @@ -82,8 +82,9 @@ class EditAssetForm extends Template