mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 02:31:40 +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
|
||||
if(ModuleModel::isIDExists($args->mid))
|
||||
if(ModuleModel::isIDExists($args->mid, $args->module))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_module_name_exists');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,13 +23,13 @@ class ModuleModel extends Module
|
|||
/**
|
||||
* @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))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (Context::isReservedWord(strtolower($id)))
|
||||
if (Context::isReservedWord(strtolower($id)) && $id !== $module)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue