mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
Fixed regression due to forcing camel case names in operation methods, now allow both camel case and snake case
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user