Fix error message

This commit is contained in:
Laurent Destailleur 2018-08-15 14:42:03 +02:00
parent 37ca3ff230
commit 5a1a6ac095
2 changed files with 12 additions and 3 deletions

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2018 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
@ -927,6 +927,15 @@ if ($action == 'create')
if ($id > 0)
{
$result1=$object->fetch($id);
if ($result1 <= 0)
{
$langs->load("errors");
print $langs->trans("ErrorRecordNotFound");
llxFooter();
exit;
}
$result2=$object->fetch_thirdparty();
$result2=$object->fetch_projet();
$result3=$object->fetch_contact();
@ -957,7 +966,7 @@ if ($id > 0)
$object->note = GETPOST("note",'none');
}
if ($result1 < 0 || $result2 < 0 || $result3 < 0 || $result4 < 0 || $result5 < 0)
if ($result2 < 0 || $result3 < 0 || $result4 < 0 || $result5 < 0)
{
dol_print_error($db,$object->error);
exit;

View File

@ -620,7 +620,7 @@ class ActionComm extends CommonObject
$this->contact->id = $obj->fk_contact; // deprecated
$this->fk_element = $obj->elementid;
$this->elementid = $obj->elementid;
$this->elementid = $obj->elementid;
$this->elementtype = $obj->elementtype;
$this->fetchResources();