Fix: Regression of return code
This commit is contained in:
parent
218583640e
commit
87cc1cc578
@ -221,10 +221,10 @@ class Project extends CommonObject
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Get object and lines from database
|
* Get object and lines from database
|
||||||
* \param rowid id of object to load
|
* @param rowid id of object to load
|
||||||
* \param ref Ref of project
|
* @param ref Ref of project
|
||||||
* \return int >0 if OK, <0 if KO
|
* @return int >0 if OK, 0 if not found, <0 if KO
|
||||||
*/
|
*/
|
||||||
function fetch($id,$ref='')
|
function fetch($id,$ref='')
|
||||||
{
|
{
|
||||||
@ -269,14 +269,14 @@ class Project extends CommonObject
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return -1;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->error=$this->db->lasterror();
|
$this->error=$this->db->lasterror();
|
||||||
dol_syslog("Project::fetch ".$this->error, LOG_ERR);
|
dol_syslog("Project::fetch ".$this->error, LOG_ERR);
|
||||||
return -2;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -168,7 +168,6 @@ class CommonObjectTest extends PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
$localobject=new Commande($this->savdb);
|
$localobject=new Commande($this->savdb);
|
||||||
$localobject->fetch(1);
|
$localobject->fetch(1);
|
||||||
|
|
||||||
$result=$localobject->fetch_projet();
|
$result=$localobject->fetch_projet();
|
||||||
|
|
||||||
print __METHOD__." result=".$result."\n";
|
print __METHOD__." result=".$result."\n";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user