From 2c4c69fcfcb736a964d45999afddca6cfe38da91 Mon Sep 17 00:00:00 2001 From: Eric Espie Date: Tue, 30 May 2023 15:25:00 +0200 Subject: [PATCH] Fixed regression due to forcing camel case names in operation methods, now allow both camel case and snake case --- .../TwigBase/Controller/Controller.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/sources/Application/TwigBase/Controller/Controller.php b/sources/Application/TwigBase/Controller/Controller.php index 8db17c1a9..47bf8f917 100644 --- a/sources/Application/TwigBase/Controller/Controller.php +++ b/sources/Application/TwigBase/Controller/Controller.php @@ -168,17 +168,19 @@ abstract class Controller extends AbstractController $this->CheckAccess(); $this->m_sOperation = utils::ReadParam('operation', $this->m_sDefaultOperation); - $sMethodName = 'Operation'.utils::ToCamelCase($this->m_sOperation); $oKPI = new ExecutionKPI(); $oKPI->ComputeAndReport('Starting operation '.$this->m_sOperation); - if (method_exists($this, $sMethodName)) - { - $this->$sMethodName(); + + if ($this->CallOperation(utils::ToCamelCase($this->m_sOperation))) { + return; } - else - { - $this->DisplayBadRequest(); + + // Fallback to unchanged names for compatibility + if ($this->CallOperation($this->m_sOperation)) { + return; } + + $this->DisplayBadRequest(); } catch (Exception $e) {