Add temporary support for the 'fixup' tag for cleaning up legacy artwork entries

This commit is contained in:
Alex Cabal 2024-02-05 10:20:45 -06:00
parent 1394a25b27
commit 6da7f948b7

View file

@ -356,6 +356,16 @@ class Artwork extends PropertiesBase{
* @throws \Exceptions\ValidationException * @throws \Exceptions\ValidationException
*/ */
protected function Validate(?string $imagePath = null, bool $isImageRequired = true): void{ 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')); $now = new DateTime('now', new DateTimeZone('UTC'));
$thisYear = intval($now->format('Y')); $thisYear = intval($now->format('Y'));
$error = new Exceptions\ValidationException(); $error = new Exceptions\ValidationException();