mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-11 04:52:14 +09:00
Fix isIDExists() error when installing member module for the first time
This commit is contained in:
parent
9bb2e40ef4
commit
566c1f54b7
2 changed files with 3 additions and 3 deletions
|
|
@ -383,7 +383,7 @@ class ModuleController extends Module
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check whether the module name already exists
|
// Check whether the module name already exists
|
||||||
if(ModuleModel::isIDExists($args->mid))
|
if(ModuleModel::isIDExists($args->mid, $args->module))
|
||||||
{
|
{
|
||||||
return new BaseObject(-1, 'msg_module_name_exists');
|
return new BaseObject(-1, 'msg_module_name_exists');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,13 +23,13 @@ class ModuleModel extends Module
|
||||||
/**
|
/**
|
||||||
* @brief Check if mid is available
|
* @brief Check if mid is available
|
||||||
*/
|
*/
|
||||||
public static function isIDExists($id)
|
public static function isIDExists($id, $module = null)
|
||||||
{
|
{
|
||||||
if (!preg_match('/^[a-z]{1}([a-z0-9_]+)$/i', $id))
|
if (!preg_match('/^[a-z]{1}([a-z0-9_]+)$/i', $id))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (Context::isReservedWord(strtolower($id)))
|
if (Context::isReservedWord(strtolower($id)) && $id !== $module)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue