diff --git a/lib/Db/ObjectEntity.php b/lib/Db/ObjectEntity.php index ddcc06a777..981135643c 100644 --- a/lib/Db/ObjectEntity.php +++ b/lib/Db/ObjectEntity.php @@ -703,12 +703,6 @@ public function jsonSerialize(): array $object['id'] = $this->uuid; } - // Ensure organisation is always accessible at top level (not just in @self). - // Organisation should NEVER be null - it should always have at least the default organisation. - if (($this->organisation ?? null) !== null) { - $object['organisation'] = $this->organisation; - } - // Let's merge and return. return $object; }//end jsonSerialize() diff --git a/lib/Service/File/TaggingHandler.php b/lib/Service/File/TaggingHandler.php index 126ba9d9c0..80958dce2a 100644 --- a/lib/Service/File/TaggingHandler.php +++ b/lib/Service/File/TaggingHandler.php @@ -99,7 +99,11 @@ public function attachTagsToFile(string $fileId, array $tags=[]): void foreach ($tags as $tag) { // Check if tag exists by trying to get it by name. try { - $tagObj = $this->systemTagManager->getTagsByIds([$tag]); + $tagObj = false; + if (ctype_digit($tag) === true) { + $tagObj = $this->systemTagManager->getTagsByIds([$tag]); + } + if (empty($tagObj) === false) { // Tag exists (found by ID), just use its ID. $newTagIds[] = $tag; @@ -117,7 +121,7 @@ public function attachTagsToFile(string $fileId, array $tags=[]): void } catch (Exception $e) { $this->logger->error( message: '[TaggingHandler] Error processing tag '.$tag.': '.$e->getMessage(), - context: ['file' => __FILE__, 'line' => __LINE__] + context: ['file' => __FILE__, 'line' => __LINE__, 'trace' => $e->getTrace()] ); // Try to create it anyway. try {