From e6acacee4b86f0410aa8fe5f0ae91aa4f65b1fe1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 Aug 2018 19:19:25 +0200 Subject: [PATCH] Fix cleandata method of modulebuilder template of AAPI --- .../template/class/api_mymodule.class.php | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/htdocs/modulebuilder/template/class/api_mymodule.class.php b/htdocs/modulebuilder/template/class/api_mymodule.class.php index b4abf60861e..7de56ff726e 100644 --- a/htdocs/modulebuilder/template/class/api_mymodule.class.php +++ b/htdocs/modulebuilder/template/class/api_mymodule.class.php @@ -170,7 +170,7 @@ class MyModuleApi extends DolibarrApi $obj = $db->fetch_object($result); $myobject_static = new MyObject($db); if($myobject_static->fetch($obj->rowid)) { - $obj_ret[] = parent::_cleanObjectDatas($myobject_static); + $obj_ret[] = $this->_cleanObjectDatas($myobject_static); } $i++; } @@ -279,6 +279,27 @@ class MyModuleApi extends DolibarrApi } + + /** + * Clean sensible object datas + * + * @param object $object Object to clean + * @return array Array of cleaned object properties + */ + function _cleanObjectDatas($object) + { + $object = parent::_cleanObjectDatas($object); + + /*unset($object->note); + unset($object->address); + unset($object->barcode_type); + unset($object->barcode_type_code); + unset($object->barcode_type_label); + unset($object->barcode_type_coder);*/ + + return $object; + } + /** * Validate fields before create or update object *