Merge pull request #8945 from bafbes/abb7009

Fix: Do not activate module if errors found on execution of module SQL queries
This commit is contained in:
Laurent Destailleur 2018-06-13 21:28:04 +02:00 committed by GitHub
commit bc0080b945
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -314,7 +314,8 @@ class modMyModule extends DolibarrModules
*/
public function init($options='')
{
$this->_load_tables('/mymodule/sql/');
$result=$this->_load_tables('/mymodule/sql/');
if ($result < 0) return -1; // Do not activate module if not allowed errors found on module SQL queries (the _load_table run sql with run_sql with error allowed parameter to 'default')
// Create extrafields
include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';