From c2aae4fb6e226fc8bf6f6b37859c962a958aaf96 Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Wed, 17 Jan 2024 17:54:14 +0100 Subject: [PATCH] EditAsset: replace Asset::setKeyData with Asset::save equivalent --- controllers/EditAsset.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/controllers/EditAsset.php b/controllers/EditAsset.php index 010144f0..b6b999ac 100644 --- a/controllers/EditAsset.php +++ b/controllers/EditAsset.php @@ -77,10 +77,12 @@ class EditAsset extends HTMLController // Key info if (isset($_POST['title'], $_POST['slug'], $_POST['date_captured'], $_POST['priority'])) { - $date_captured = !empty($_POST['date_captured']) ? + $asset->date_captured = !empty($_POST['date_captured']) ? new DateTime(str_replace('T', ' ', $_POST['date_captured'])) : null; - $slug = Asset::cleanSlug($_POST['slug']); - $asset->setKeyData(htmlspecialchars($_POST['title']), $slug, $date_captured, intval($_POST['priority'])); + $asset->slug = Asset::cleanSlug($_POST['slug']); + $asset->title = htmlspecialchars($_POST['title']); + $asset->priority = intval($_POST['priority']); + $asset->save(); } // Changing parent album?