Remove deleted routes from action_forward table

This commit is contained in:
Kijin Sung 2020-12-18 00:54:34 +09:00
parent aef258e48a
commit 70c2bfe5df
2 changed files with 30 additions and 0 deletions

View file

@ -1414,6 +1414,23 @@ class moduleController extends module
}
}
// Clean up any action-forward routes that are no longer needed.
foreach ($forwardable_routes as $action_name => $route_info)
{
unset($action_forward[$action_name]);
}
foreach ($action_forward as $action_name => $forward_info)
{
if ($forward_info->module === $module_name && $forward_info->route_regexp !== null)
{
$output = $this->deleteActionForward($module_name, null, $action_name);
if (!$output->toBool())
{
return $output;
}
}
}
return new BaseObject();
}
}

View file

@ -1524,6 +1524,19 @@ class moduleModel extends module
$info->need_update = true;
}
}
// Clean up any action-forward routes that are no longer needed.
foreach ($forwardable_routes as $action_name => $route_info)
{
unset($action_forward[$action_name]);
}
foreach ($action_forward as $action_name => $forward_info)
{
if ($forward_info->module === $module_name && $forward_info->route_regexp !== null)
{
$info->need_update = true;
}
}
}
$list[] = $info;
}