UploadMedia: only set thumb asset id for tags that don't have one yet

This commit is contained in:
Aaron van Geffen 2023-03-13 16:30:24 +01:00
parent c6dc6bbac4
commit 65cea8ed8a

View File

@ -42,8 +42,11 @@ class UploadMedia extends HTMLController
$new_ids[] = $asset->getId();
$asset->linkTags([$tag->id_tag]);
$tag->id_asset_thumb = $asset->getId();
$tag->save();
if (empty($tag->id_asset_thumb))
{
$tag->id_asset_thumb = $asset->getId();
$tag->save();
}
}
if (isset($_REQUEST['format']) && $_REQUEST['format'] === 'json')