+ if (empty($target_item)) {
+ Logger::log('Item ' . $target_id . "wasn't found. Quitting here.");
+ return;
+ }
+
+ if (empty($parent)) {
+ Logger::log('Parent ' . $parent_id . ' for item ' . $target_id . "wasn't found. Quitting here.");
+ return;
+ }
+
+ if (!empty($target_item['contact-uid'])) {
+ $uid = $target_item['contact-uid'];
+ } elseif (!empty($target_item['uid'])) {
+ $uid = $target_item['uid'];
+ } else {
+ Logger::log('Only public users for item ' . $target_id, Logger::DEBUG);
+ return;
+ }