Merge pull request #496 from GeraintEdwards/4.0-dev

Handle situation where webslinks are trashed within trashed categories
This commit is contained in:
Tuan Pham Ngoc 2022-05-20 23:32:32 +07:00 committed by GitHub
commit 6c3d57cd59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -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);