Load tables for opensurvey only when module opensurvey is enabled

This commit is contained in:
Laurent Destailleur 2022-04-05 19:14:00 +02:00
parent 7896baa6c9
commit f9c9e518c3
9 changed files with 7 additions and 0 deletions

View File

@ -182,6 +182,13 @@ class modOpenSurvey extends DolibarrModules
*/
public function init($options = '')
{
global $conf, $langs;
$result = $this->_load_tables('/install/mysql/tables/', 'opensurvey');
if ($result < 0) {
return -1; // Do not activate module if error 'not allowed' returned when loading module SQL queries (the _load_table run sql with run_sql with the error allowed parameter set to 'default')
}
// Permissions
$this->remove($options);