Explorar o código

Remove warning

Laurent Destailleur %!s(int64=4) %!d(string=hai) anos
pai
achega
2da6fc1ef0
Modificáronse 2 ficheiros con 8 adicións e 5 borrados
  1. 2 2
      dev/examples/zapier/README.md
  2. 6 3
      htdocs/core/class/commonobject.class.php

+ 2 - 2
dev/examples/zapier/README.md

@@ -3,9 +3,9 @@
 
 ## ENABLE MODULE ZAPIER ON DOLIBARR
 
-This should also enable the module API (required for authentication by Zapier service).
+This should also enable the module API (required for authentication by Zapier service and to execute action in Dolibarr by Zapier).
 
-Create the Dolibarr login that will be used by Zapier to call APIs.
+Create the Dolibarr login that will be used by Zapier to call APIs. Give the login the permissions on the action you plan to automate.
 
 
 ## CREATE A ZAPIER DEVELOPPER ACCOUNT

+ 6 - 3
htdocs/core/class/commonobject.class.php

@@ -7538,9 +7538,12 @@ abstract class CommonObject
 				if ($field == 'entity' && is_null($this->{$field})) $queryarray[$field] = $conf->entity;
 				else {
 					// $this->{$field} may be null, '', 0, '0', 123, '123'
-					if ($this->{$field} != '' || !empty($info['notnull'])) {
-						if ($this->isInt($info)) $queryarray[$field] = (int) $this->{$field};	// If '0', it may be set to null later if $info['notnull'] == -1
-						if ($this->isFloat($info)) $queryarray[$field] = (double) $this->{$field};	// If '0', it may be set to null later if $info['notnull'] == -1
+					if ((isset($this->{$field}) && $this->{$field} != '') || !empty($info['notnull'])) {
+						if ($this->isInt($info)) {
+							$queryarray[$field] = (int) $this->{$field};	// If '0', it may be set to null later if $info['notnull'] == -1
+						} elseif ($this->isFloat($info)) {
+							$queryarray[$field] = (double) $this->{$field};	// If '0', it may be set to null later if $info['notnull'] == -1
+						}
 					} else $queryarray[$field] = null;
 				}
 			} else {