diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index e1872b09d55..573526413e5 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -1033,16 +1033,16 @@ class DoliDBPgsql extends DoliDB $infotables = array(); $sql = "SELECT "; - $sql .= " infcol.column_name as 'Column',"; + $sql .= " infcol.column_name as \"Column\","; // pgsql need " for alias names ! $sql .= " CASE WHEN infcol.character_maximum_length IS NOT NULL THEN infcol.udt_name || '('||infcol.character_maximum_length||')'"; $sql .= " ELSE infcol.udt_name"; - $sql .= " END as 'Type',"; - $sql .= " infcol.collation_name as 'Collation',"; - $sql .= " infcol.is_nullable as 'Null',"; - $sql .= " '' as 'Key',"; - $sql .= " infcol.column_default as 'Default',"; - $sql .= " '' as 'Extra',"; - $sql .= " '' as 'Privileges'"; + $sql .= " END as \"Type\","; // pgsql need " for alias names ! + $sql .= " infcol.collation_name as \"Collation\","; // pgsql need " for alias names ! + $sql .= " infcol.is_nullable as \"Null\","; // pgsql need " for alias names ! + $sql .= " '' as \"Key\","; // pgsql need " for alias names ! + $sql .= " infcol.column_default as \"Default\","; // pgsql need " for alias names ! + $sql .= " '' as \"Extra\","; // pgsql need " for alias names ! + $sql .= " '' as \"Privileges\""; // pgsql need " for alias names ! $sql .= " FROM information_schema.columns infcol"; $sql .= " WHERE table_schema = 'public' "; $sql .= " AND table_name = '".$this->escape($table)."'"; diff --git a/htdocs/core/modules/modWebhook.class.php b/htdocs/core/modules/modWebhook.class.php index 655dbe75faf..2d2a62d0c8e 100644 --- a/htdocs/core/modules/modWebhook.class.php +++ b/htdocs/core/modules/modWebhook.class.php @@ -40,7 +40,8 @@ class modWebhook extends DolibarrModules */ public function __construct($db) { - global $langs, $conf; + global $conf; + $this->db = $db; // Id for module (must be unique). diff --git a/htdocs/install/mysql/migration/21.0.0-22.0.0.sql b/htdocs/install/mysql/migration/21.0.0-22.0.0.sql index e37a288296c..511d7094bd1 100644 --- a/htdocs/install/mysql/migration/21.0.0-22.0.0.sql +++ b/htdocs/install/mysql/migration/21.0.0-22.0.0.sql @@ -220,6 +220,10 @@ UPDATE llx_expeditiondet as ed SET ed.fk_product = (SELECT cd.fk_product FROM ll ALTER TABLE llx_webhook_target ADD COLUMN type integer DEFAULT 0 NOT NULL AFTER label; +-- remove foreign keys we should not have (bad name and bad use) +ALTER TABLE llx_webhook_target DROP FOREIGN KEY llx_webhook_target_fk_user_creat; +ALTER TABLE llx_webhook_target DROP FOREIGN KEY fk_webhook_target_fk_user_creat; + INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES (__ENTITY__, 'pixelfed', 'Pixelfed', '{socialid}', 'fa-pixelfed', 0); -- Add input reason on invoice diff --git a/htdocs/install/mysql/tables/llx_webhook_target-webhook.key.sql b/htdocs/install/mysql/tables/llx_webhook_target-webhook.key.sql index 18d8d149fd7..c0c6ef4ff22 100644 --- a/htdocs/install/mysql/tables/llx_webhook_target-webhook.key.sql +++ b/htdocs/install/mysql/tables/llx_webhook_target-webhook.key.sql @@ -17,7 +17,6 @@ -- BEGIN MODULEBUILDER INDEXES ALTER TABLE llx_webhook_target ADD INDEX idx_webhook_target_rowid (rowid); ALTER TABLE llx_webhook_target ADD INDEX idx_webhook_target_ref (ref); -ALTER TABLE llx_webhook_target ADD CONSTRAINT llx_webhook_target_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid); ALTER TABLE llx_webhook_target ADD INDEX idx_webhook_target_status (status); -- END MODULEBUILDER INDEXES diff --git a/test/phpunit/ModulesTest.php b/test/phpunit/ModulesTest.php index f5521692b4c..a923127d135 100644 --- a/test/phpunit/ModulesTest.php +++ b/test/phpunit/ModulesTest.php @@ -85,8 +85,6 @@ class ModulesTest extends CommonClassTest // TestCase //CommonClassTest $langs = $this->savlangs; $db = $this->savdb; - //$this->nbLinesToShow = 0; // Only 3 lines of the log. - require_once DOL_DOCUMENT_ROOT.'/core/modules/mod'.$modlabel.'.class.php'; $class = 'mod'.$modlabel; $mod = new $class($db);