Bugfix: Module builder missing table prefix

The function rebuildObjectSql from the module builder module is missing the table prefix when adding a constraint
This commit is contained in:
Alfredo Altamirano 2019-12-08 19:29:46 -06:00
parent 2ca5a4378b
commit 39afe39016

View File

@ -321,7 +321,7 @@ function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir = '
$tmp = explode('.', $val['foreignkey']);
if (!empty($tmp[0]) && !empty($tmp[1]))
{
$texttoinsert .= "ALTER TABLE llx_".strtolower($module).'_'.strtolower($objectname)." ADD CONSTRAINT llx_".strtolower($module).'_'.strtolower($objectname)."_".$key." FOREIGN KEY (".$key.") REFERENCES ".$tmp[0]."(".$tmp[1].");";
$texttoinsert .= "ALTER TABLE llx_".strtolower($module).'_'.strtolower($objectname)." ADD CONSTRAINT llx_".strtolower($module).'_'.strtolower($objectname)."_".$key." FOREIGN KEY (".$key.") REFERENCES ".MAIN_DB_PREFIX.$tmp[0]."(".$tmp[1].");";
$texttoinsert .= "\n";
}
}