show upload error for TinyMCE images by pushing it as error-message to client and also show it instead of the URL

This commit is contained in:
ralf 2024-06-25 13:46:11 +02:00
parent bad6a86f39
commit 5327c6e770

View File

@ -205,7 +205,13 @@ class Vfs extends File
if ($type == 'htmlarea') if ($type == 'htmlarea')
{ {
$result = array ('location' => Api\Framework::link(Api\Vfs::download_url($path))); // try to show error to user by push and instead of the (anyway not working) URL
if (isset($error))
{
$push = new Json\Push();
$push->message($error, 'error');
}
$result = array ('location' => $error ?? Api\Framework::link(Api\Vfs::download_url($path)));
} }
else else
{ {