mirror of
https://github.com/standardebooks/web.git
synced 2025-07-20 13:24:48 -04:00
Add temporary support for the 'fixup' tag for cleaning up legacy artwork entries
This commit is contained in:
parent
1394a25b27
commit
6da7f948b7
1 changed files with 10 additions and 0 deletions
|
@ -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();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue