From 1be33e1ddaacc718ee7436e01a6cf613c24b8d56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 19 Jul 2015 14:56:52 +0200 Subject: [PATCH] FIX [ bug 1634 ] Error deleting a project when it had many linked objects Projet::delete was throwing DB error messages directly to the user instead of logging them and showing a proper error message to the user --- ChangeLog | 1 + htdocs/projet/card.php | 2 +- htdocs/projet/class/project.class.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0002ce6b3fa..243b350ba85 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,7 @@ FIX [ bug #2855 ] Wrong translation key in localtax report page FIX [ bug #1852 ] JS error when editing a customer order line FIX [ bug #2900 ] Courtesy title is not stored in create thirdparty form FIX [ bug #3055 ] Product image thumbnails were not deleted after deleting the image +FIX [ bug 1634 ] Error deleting a project when it had many linked objects ***** ChangeLog for 3.7.1 compared to 3.7.* ***** FIX Bug in the new photo system diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 1c971ef9e35..00b3f54eab8 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -339,7 +339,7 @@ if (empty($reshook)) else { dol_syslog($object->error,LOG_DEBUG); - setEventMessage($object->error,'errors'); +// setEventMessage($object->error,'errors'); setEventMessage($object->errors,'errors'); } } diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index a52a9f133e9..8d2068b4591 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -533,7 +533,7 @@ class Project extends CommonObject $resql = $this->db->query($sql); if (!$resql) { - $this->errors[] = $this->db->lasterror(); + $this->errors[] = $langs->trans("CantRemoveProject"); $error++; } }