LSioFormat: Add some checks/logs during export process

This commit is contained in:
Benjamin Renard 2021-02-18 15:51:46 +01:00
parent 6098f3bc5f
commit 4c4983b634

View file

@ -131,7 +131,16 @@ class LSioFormat extends LSlog_staticLoggerClass {
// Add attributes to export and put their values to data to export // Add attributes to export and put their values to data to export
foreach($fields as $key => $attr_name) { 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); $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); $objects_data[$object -> getDn()][$key] = $export -> elements[$attr_name] -> getApiValue(false);
} }
} }