From 3dbcd69b8e43f1ae53e58b81bd03221afc191db3 Mon Sep 17 00:00:00 2001 From: Geraint Edwards Date: Wed, 18 May 2022 12:11:10 +0100 Subject: [PATCH] Handle situation where webslinks are trashed within trashed categories --- src/plugins/finder/weblinks/weblinks.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/finder/weblinks/weblinks.php b/src/plugins/finder/weblinks/weblinks.php index 6a025c1..7ac45c5 100644 --- a/src/plugins/finder/weblinks/weblinks.php +++ b/src/plugins/finder/weblinks/weblinks.php @@ -282,11 +282,14 @@ class PlgFinderWeblinks extends Adapter $item->addInstruction(Indexer::META_CONTEXT, 'author'); $item->addInstruction(Indexer::META_CONTEXT, 'created_by_alias'); + // Translate the state. Weblinks should only be published if the category is published and also ensure that 'state' for trashed items is set to zero + $item->state = $this->translateState($item->state, $item->cat_state); + // Add the type taxonomy data. $item->addTaxonomy('Type', 'Web Link'); // Add the category taxonomy data. - $item->addTaxonomy('Category', $item->category, $item->cat_state, $item->cat_access); + $item->addTaxonomy('Category', $item->category, $this->translateState($item->cat_state), $item->cat_access); // Add the language taxonomy data. $item->addTaxonomy('Language', $item->language);