From ed7b175491bd3f06588401209491fe661665379c Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sat, 26 Nov 2022 15:21:46 -0500 Subject: [PATCH 1/2] Catch worker argument type errors - This marks the invalid worker queue item as completed instead of endlessly retrying it - Address https://github.com/friendica/friendica/issues/11992#issuecomment-1327029331 --- src/Core/Worker.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Core/Worker.php b/src/Core/Worker.php index 96f3e7ae0..47da04b35 100644 --- a/src/Core/Worker.php +++ b/src/Core/Worker.php @@ -568,7 +568,15 @@ class Worker // Set the workerLogger as new default logger if ($method_call) { - call_user_func_array(sprintf('Friendica\Worker\%s::execute', $funcname), $argv); + try { + call_user_func_array(sprintf('Friendica\Worker\%s::execute', $funcname), $argv); + } catch (\TypeError $e) { + // No need to defer a worker queue entry if the arguments are invalid + Logger::notice('Wrong worker arguments', ['class' => $funcname, 'argv' => $argv, 'queue' => $queue, 'message' => $e->getMessage()]); + } catch (\Throwable $e) { + Logger::error('Uncaught exception in worker execution', ['class' => get_class($e), 'message' => $e->getMessage(), 'code' => $e->getCode(), 'file' => $e->getFile() . ':' . $e->getLine(), 'trace' => $e->getTraceAsString()]); + Worker::defer(); + } } else { $funcname($argv, count($argv)); } From 34418d790d3ad780a7d39f8225f22d87e817be17 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sat, 26 Nov 2022 15:38:21 -0500 Subject: [PATCH 2/2] Check for existence of $contact.photo_menu.edit in frio:contact/entry.tpl - Address https://github.com/friendica/friendica/issues/11992#issuecomment-1327030221 --- view/theme/frio/templates/contact/entry.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/view/theme/frio/templates/contact/entry.tpl b/view/theme/frio/templates/contact/entry.tpl index 5d29238e7..17436b570 100644 --- a/view/theme/frio/templates/contact/entry.tpl +++ b/view/theme/frio/templates/contact/entry.tpl @@ -6,7 +6,7 @@