From cbb72e06d9dffa9cd2d9f5f344695a414e37b5af Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 24 Nov 2021 20:57:26 +0100 Subject: [PATCH 01/10] fix / work around PHP 8.0 Error Call to undefined method EGroupware\Api\Etemplate\Widget\Vfs::set_attrs() --- api/src/Etemplate/Widget/File.php | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/api/src/Etemplate/Widget/File.php b/api/src/Etemplate/Widget/File.php index add9a199e9..db1f92bacd 100644 --- a/api/src/Etemplate/Widget/File.php +++ b/api/src/Etemplate/Widget/File.php @@ -75,11 +75,32 @@ class File extends Etemplate\Widget return; } - if (!($template = Template::instance(self::$request->template['name'], self::$request->template['template_set'], - self::$request->template['version'], self::$request->template['load_via']))) - { - // Can't use callback - error_log("Could not get template for file upload, callback skipped"); + try { + if (!($template = Template::instance(self::$request->template['name'], self::$request->template['template_set'], + self::$request->template['version'], self::$request->template['load_via']))) + { + // Can't use callback + error_log("Could not get template for file upload, callback skipped"); + } + } + catch (\Error $e) { + // retry 3 times, in case the problem (Call to undefined method EGroupware\Api\Etemplate\Widget\Vfs::set_attrs()) is caused by something internal in PHP 8.0 + if (!isset($_REQUEST['retry']) || $_REQUEST['retry'] < 3) + { + $url = Api\Header\Http::schema().'://'.Api\Header\Http::host().$_SERVER['REQUEST_URI']; + if (strpos($url, '&retry=') === false) + { + $url .= '&retry=1'; + } + else + { + $url = preg_replace('/&retry=\d+/', '&retry='.($_REQUEST['retry']+1), $url); + } + header('Location: '.$url); + http_response_code(307); + exit; + } + throw new \Error('Error instantiating template '.json_encode(self::$request->template).', $_REQUEST='.json_encode($_REQUEST).': '.$e->getMessage(), $e->getCode(), $e); } $file_data = array(); From d40a1d992ab41cb1d55f248c614b78b9e0258aca Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sat, 27 Nov 2021 11:21:54 +0200 Subject: [PATCH 02/10] fix not working multiple users for single mail account replaced legacy-options and type attribute with the actual ones --- admin/inc/class.admin_mail.inc.php | 2 +- admin/templates/default/mailaccount.xet | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/admin/inc/class.admin_mail.inc.php b/admin/inc/class.admin_mail.inc.php index 60a07707a3..6c16e59c2a 100644 --- a/admin/inc/class.admin_mail.inc.php +++ b/admin/inc/class.admin_mail.inc.php @@ -176,7 +176,7 @@ class admin_mail * Step 1: IMAP account * * @param array $content - * @param type $msg + * @param string $msg */ public function add(array $content=array(), $msg='', $msg_type='success') { diff --git a/admin/templates/default/mailaccount.xet b/admin/templates/default/mailaccount.xet index 79e20d5923..0aac424c4e 100644 --- a/admin/templates/default/mailaccount.xet +++ b/admin/templates/default/mailaccount.xet @@ -338,7 +338,7 @@ -