Fix test on $resql
This commit is contained in:
parent
17807ea00c
commit
3961fa7a97
@ -3930,8 +3930,8 @@ class CommandeFournisseurLigne extends CommonOrderLine
|
|||||||
$sql .= " WHERE rowid = ".((int) $this->id);
|
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::updateline", LOG_DEBUG);
|
dol_syslog(get_class($this)."::updateline", LOG_DEBUG);
|
||||||
$result = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($result) {
|
if ($resql) {
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
$result = $this->insertExtraFields();
|
$result = $this->insertExtraFields();
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
@ -3940,7 +3940,6 @@ class CommandeFournisseurLigne extends CommonOrderLine
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!$error && !$notrigger) {
|
if (!$error && !$notrigger) {
|
||||||
global $user;
|
|
||||||
// Call trigger
|
// Call trigger
|
||||||
$result = $this->call_trigger('LINEORDER_SUPPLIER_MODIFY', $user);
|
$result = $this->call_trigger('LINEORDER_SUPPLIER_MODIFY', $user);
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
|
|||||||
@ -4240,7 +4240,7 @@ class Product extends CommonObject
|
|||||||
$sql = "SELECT MAX(rang) as max_rank FROM ".$this->db->prefix()."product_association";
|
$sql = "SELECT MAX(rang) as max_rank FROM ".$this->db->prefix()."product_association";
|
||||||
$sql .= " WHERE fk_product_pere = ".((int) $id_pere);
|
$sql .= " WHERE fk_product_pere = ".((int) $id_pere);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql > 0) {
|
if ($resql) {
|
||||||
$obj = $this->db->fetch_object($resql);
|
$obj = $this->db->fetch_object($resql);
|
||||||
$rank = $obj->max_rank + 1;
|
$rank = $obj->max_rank + 1;
|
||||||
//Addition of a product with the highest rank +1
|
//Addition of a product with the highest rank +1
|
||||||
|
|||||||
@ -544,6 +544,16 @@ class CodingPhpTest extends PHPUnit\Framework\TestCase
|
|||||||
$this->assertTrue($ok, 'Found a preg_grep with a param that is a $var but without preg_quote in file '.$file['relativename'].'.');
|
$this->assertTrue($ok, 'Found a preg_grep with a param that is a $var but without preg_quote in file '.$file['relativename'].'.');
|
||||||
|
|
||||||
|
|
||||||
|
// Test we don't have "if ($resql >"
|
||||||
|
$ok=true;
|
||||||
|
$matches=array();
|
||||||
|
preg_match_all('/if \(\$resql >/', $filecontent, $matches, PREG_SET_ORDER);
|
||||||
|
foreach ($matches as $key => $val) {
|
||||||
|
$ok=false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$this->assertTrue($ok, 'Found a if $resql with a > operator (when $resql is a boolean or resource) in file '.$file['relativename'].'. Please remove the > ... part.');
|
||||||
|
|
||||||
// Test we don't have empty($user->hasRight
|
// Test we don't have empty($user->hasRight
|
||||||
$ok=true;
|
$ok=true;
|
||||||
$matches=array();
|
$matches=array();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user