From 4c4983b634e9d48bcf93d86b6c973d500e1f1683 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Thu, 18 Feb 2021 15:51:46 +0100 Subject: [PATCH] LSioFormat: Add some checks/logs during export process --- src/includes/class/class.LSioFormat.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/includes/class/class.LSioFormat.php b/src/includes/class/class.LSioFormat.php index 62ab1f1e..115f2c96 100644 --- a/src/includes/class/class.LSioFormat.php +++ b/src/includes/class/class.LSioFormat.php @@ -131,7 +131,16 @@ class LSioFormat extends LSlog_staticLoggerClass { // Add attributes to export and put their values to data to export foreach($fields as $key => $attr_name) { + $objects_data[$object -> getDn()][$key] = null; + if (!isset($object -> attrs[$attr_name])) { + self :: log_warning("exportObjects($object): attribute '$attr_name' does not exist !"); + continue; + } $object -> attrs[$attr_name] -> addToExport($export); + if (!isset($export -> elements[$attr_name])) { + self :: log_warning("exportObjects($object): fail to add attribute '$attr_name' to export !"); + continue; + } $objects_data[$object -> getDn()][$key] = $export -> elements[$attr_name] -> getApiValue(false); } }