Merge pull request #12660 from Ahuahuachi/develop

Bugfix: Module builder missing table prefix
This commit is contained in:
Laurent Destailleur 2019-12-09 15:56:01 +01:00 committed by GitHub
commit 04a7de14c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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 llx_".preg_replace('/^llx_/', '', $tmp[0])."(".$tmp[1].");";
$texttoinsert .= "\n";
}
}