Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for search indexing #326

Merged
merged 1 commit into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Changelog
1.10.3 (Unreleased)
------------------------
- Fix #321: Fix indexing of template content for search
- Fix #326: Fix for search indexing

1.10.2 (January 8, 2024)
------------------------
Expand Down
12 changes: 2 additions & 10 deletions models/CustomContentContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@ abstract class CustomContentContainer extends ContentActiveRecord
const VISIBILITY_PRIVATE = 0;
const VISIBILITY_PUBLIC = 1;

/**
* @inheritdoc
*/
public $streamChannel = null;

/**
* @inheritdoc
*/
Expand Down Expand Up @@ -494,11 +489,8 @@ public function beforeSave($insert)
break;
}

if ($this->checkAbstract() && !$this->admin_only) {
$this->streamChannel = 'default';
} else {
$this->streamChannel = null;
}
// Keep page hidden on stream when "Abstract" field is not filled, or it is visible only for admin
$this->content->hidden = $this->admin_only || !$this->checkAbstract();

return parent::beforeSave($insert);
}
Expand Down
2 changes: 1 addition & 1 deletion models/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public function getSearchAttributes()
'title' => $this->title,
'content' => preg_replace('/[\r\n\s]+/', ' ', strip_tags($this->type === TemplateType::ID
? TemplateRenderer::render($this, false, false)
: $this->page_content)),
: $this->abstract . "\r\n" . $this->page_content)),
];
}

Expand Down
Loading