mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-09 12:02:24 +09:00
Fix error when using a namespaced module with forwarded action from another module
This commit is contained in:
parent
3260d90d18
commit
b91fb3ee7a
1 changed files with 19 additions and 2 deletions
|
|
@ -424,11 +424,28 @@ class ModuleHandler extends Handler
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$oModule = self::getModuleInstance($this->module, $type ?: 'class', $kind);
|
$oModule = self::getModuleInstance($this->module, $type ?: 'class', $kind);
|
||||||
|
if (!$oModule)
|
||||||
|
{
|
||||||
|
$base_class_fullname = sprintf('Rhymix\\Modules\\%s\\Base', $this->module);
|
||||||
|
if (class_exists($base_class_fullname))
|
||||||
|
{
|
||||||
|
$oModule = $base_class_fullname::getInstance();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$base_class_fullname = sprintf('Rhymix\\Modules\\%s\\Controllers\\Base', $this->module);
|
||||||
|
if (class_exists($base_class_fullname))
|
||||||
|
{
|
||||||
|
$oModule = $base_class_fullname::getInstance();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!is_object($oModule))
|
// If the base module is not found, return an error now.
|
||||||
|
if (!isset($oModule) || !is_object($oModule))
|
||||||
{
|
{
|
||||||
return self::_createErrorMessage(-1, $this->error, $this->httpStatusCode);
|
return self::_createErrorMessage(-1, 'msg_module_is_not_exists', 404);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If there is no such action in the module object
|
// If there is no such action in the module object
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue