From 1580f92b1164786cd22c8be27d9ac466e75578f2 Mon Sep 17 00:00:00 2001 From: Florian Henry Date: Thu, 27 Jun 2013 08:09:28 +0200 Subject: [PATCH] Fix bug for PGSQL Migration 3.4->3.5 Fix bug on create invoice from contract --- htdocs/commande/fiche.php | 2 +- htdocs/compta/facture.php | 12 ++++++------ htdocs/install/mysql/migration/3.4.0-3.5.0.sql | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 203dbe4be96..cf054a6cfc8 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -315,7 +315,7 @@ else if ($action == 'add' && $user->rights->commande->creer) } //Extrafields - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i],'fetch_optionals') ) // For avoid conflicts if trigger used { $lines[$i]->fetch_optionals($lines[$i]->rowid); $array_option=$lines[$i]->array_options; diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index d8379a02a07..dcacf578843 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1008,12 +1008,12 @@ else if ($action == 'add' && $user->rights->facture->creer) $fk_parent_line = 0; } - //Extrafields - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used - { - $lines[$i]->fetch_optionals($lines[$i]->rowid); - $array_option=$lines[$i]->array_options; - } + //Extrafields + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i],'fetch_optionals')) + { + $lines[$i]->fetch_optionals($lines[$i]->rowid); + $array_option=$lines[$i]->array_options; + } $result = $object->addline( $id, diff --git a/htdocs/install/mysql/migration/3.4.0-3.5.0.sql b/htdocs/install/mysql/migration/3.4.0-3.5.0.sql index 5ab46b6c4f2..e1285d52c1a 100755 --- a/htdocs/install/mysql/migration/3.4.0-3.5.0.sql +++ b/htdocs/install/mysql/migration/3.4.0-3.5.0.sql @@ -66,4 +66,4 @@ ALTER TABLE llx_propaldet_extrafields ADD INDEX idx_propaldet_extrafields (fk_ob DROP table llx_adherent_options; DROP table llx_adherent_options_label; -ALTER TABLE `llx_user` ADD `accountancy_code` VARCHAR( 24 ) NULL; +ALTER TABLE llx_user ADD accountancy_code VARCHAR( 24 ) NULL;