From 6da7f948b7d5272d8e7d58f84dd6053620686f23 Mon Sep 17 00:00:00 2001 From: Alex Cabal Date: Mon, 5 Feb 2024 10:20:45 -0600 Subject: [PATCH] Add temporary support for the 'fixup' tag for cleaning up legacy artwork entries --- lib/Artwork.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/Artwork.php b/lib/Artwork.php index a345fb9f..d5ae539b 100644 --- a/lib/Artwork.php +++ b/lib/Artwork.php @@ -356,6 +356,16 @@ class Artwork extends PropertiesBase{ * @throws \Exceptions\ValidationException */ protected function Validate(?string $imagePath = null, bool $isImageRequired = true): void{ + // TODO: Remove this block once all legacy artworks are fixed up + // If this is tagged with 'fixup' and we're the admin user, skip validation + if($GLOBALS['User']?->Benefits->CanReviewOwnArtwork){ + foreach($this->Tags as $tag){ + if($tag->Name == 'fixup'){ + return; + } + } + } + $now = new DateTime('now', new DateTimeZone('UTC')); $thisYear = intval($now->format('Y')); $error = new Exceptions\ValidationException();