From 525eea082c9f146dd4a39c569e0612b255c7d7d5 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 26 Jul 2022 11:31:36 +0200 Subject: [PATCH 1/3] depend on symfony/http-foundation --- composer-dist.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer-dist.json b/composer-dist.json index 43624bd3a..7c0171634 100644 --- a/composer-dist.json +++ b/composer-dist.json @@ -11,6 +11,7 @@ "pear/auth_sasl": "*", "pear/db": "*", "alecrabbit/php-console-colour": "*", - "zf1/zend-search-lucene": "*" + "zf1/zend-search-lucene": "*", + "symfony/http-foundation": "^5.4" } } From 6421aa94edf3d812f4d9825d4a79d9acadb0ee3f Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 26 Jul 2022 11:33:12 +0200 Subject: [PATCH 2/3] pass array passed to __invoke() to hooks preRun and postRun --- inc/inc.ClassControllerCommon.php | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/inc/inc.ClassControllerCommon.php b/inc/inc.ClassControllerCommon.php index 403f18518..947f45bb8 100644 --- a/inc/inc.ClassControllerCommon.php +++ b/inc/inc.ClassControllerCommon.php @@ -54,17 +54,18 @@ class SeedDMS_Controller_Common { * @return mixed return value of called method */ function __invoke($get=array()) { - $this->callHook('preRun', isset($get['action']) ? $get['action'] : 'run'); - if(isset($get['action']) && $get['action']) { - if(method_exists($this, $get['action'])) { - return $this->{$get['action']}(); - } else { - echo "Missing action '".$get['action']."'"; - return false; - } - } else - return $this->run(); - $this->callHook('postRun', isset($get['action']) ? $get['action'] : 'run'); + if(!$this->callHook('preRun', get_class($this), isset($get['action']) ? $get['action'] : 'run', $get)) { + if(isset($get['action']) && $get['action']) { + if(method_exists($this, $get['action'])) { + return $this->{$get['action']}(); + } else { + echo "Missing action '".$get['action']."'"; + return false; + } + } else + return $this->run(); + } + $this->callHook('postRun', get_class($this), isset($get['action']) ? $get['action'] : 'run', $get); } function setParams($params) { From 29ec6ff2c9b597e9b66e741dc11bea7bb54647b4 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 26 Jul 2022 11:57:45 +0200 Subject: [PATCH 3/3] run invoke instead of run() --- op/op.RemoveDocument.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/op/op.RemoveDocument.php b/op/op.RemoveDocument.php index f700b96ac..93b013646 100644 --- a/op/op.RemoveDocument.php +++ b/op/op.RemoveDocument.php @@ -78,7 +78,7 @@ $docname = $document->getName(); $controller->setParam('document', $document); $controller->setParam('fulltextservice', $fulltextservice); -if(!$controller->run()) { +if(!$controller($_POST)) { if ($controller->getErrorMsg() != '') $errormsg = $controller->getErrorMsg(); else