mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-08 19:21:40 +09:00
Fix #1406 convert 'jp' to 'ja' in lang table
This commit is contained in:
parent
0177ee3abe
commit
338951f5c8
5 changed files with 67 additions and 4 deletions
|
|
@ -104,6 +104,18 @@ class module extends ModuleObject
|
|||
if(!$oDB->isColumnExists('action_forward', 'route_regexp')) return true;
|
||||
if(!$oDB->isColumnExists('action_forward', 'route_config')) return true;
|
||||
if(!$oDB->isColumnExists('action_forward', 'global_route')) return true;
|
||||
|
||||
// check additional indexes on lang table
|
||||
if(!$oDB->isIndexExists('lang', 'idx_site_srl')) return true;
|
||||
if(!$oDB->isIndexExists('lang', 'idx_name')) return true;
|
||||
if(!$oDB->isIndexExists('lang', 'idx_lang_code')) return true;
|
||||
|
||||
// check deprecated lang code
|
||||
$output = executeQuery('module.getLangCount', ['site_srl' => 0, 'lang_code' => 'jp']);
|
||||
if ($output->data->count > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -173,6 +185,31 @@ class module extends ModuleObject
|
|||
{
|
||||
$oDB->addColumn('action_forward', 'global_route', 'char', 1, 'N', true);
|
||||
}
|
||||
|
||||
// check additional indexes on lang table
|
||||
if(!$oDB->isIndexExists('lang', 'idx_site_srl'))
|
||||
{
|
||||
$oDB->addIndex('lang', 'idx_site_srl', array('site_srl'), false);
|
||||
}
|
||||
if(!$oDB->isIndexExists('lang', 'idx_name'))
|
||||
{
|
||||
$oDB->addIndex('lang', 'idx_name', array('name'), false);
|
||||
}
|
||||
if(!$oDB->isIndexExists('lang', 'idx_lang_code'))
|
||||
{
|
||||
$oDB->addIndex('lang', 'idx_lang_code', array('lang_code'), false);
|
||||
}
|
||||
|
||||
// check deprecated lang code
|
||||
$output = executeQuery('module.getLangCount', ['site_srl' => 0, 'lang_code' => 'jp']);
|
||||
if ($output->data->count > 0)
|
||||
{
|
||||
$output = executeQuery('module.updateLangCode', ['lang_code' => 'jp', 'new_lang_code' => 'ja']);
|
||||
if (!$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue