From eda6e26017e9e6f4f18943a8d7e9158842921556 Mon Sep 17 00:00:00 2001 From: ralf Date: Tue, 25 Jun 2024 13:46:11 +0200 Subject: [PATCH] show upload error for TinyMCE images by pushing it as error-message to client and also show it instead of the URL --- api/src/Etemplate/Widget/Vfs.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/api/src/Etemplate/Widget/Vfs.php b/api/src/Etemplate/Widget/Vfs.php index d9390fee9f..9bbb9502f1 100644 --- a/api/src/Etemplate/Widget/Vfs.php +++ b/api/src/Etemplate/Widget/Vfs.php @@ -205,7 +205,13 @@ class Vfs extends File 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 {