-
Notifications
You must be signed in to change notification settings - Fork 4
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
Innacurate relationships showing in Craft 3.9.10 #26
Comments
@stevehurst I think I might need abit information.
Basically some images might be useful too I really need to found out HOW to cause the "bug". |
The whole plugin uses /** @var Element $element */
$element = Craft::$app->elements->getElementById($elementId);
/** @var Element $elementType */
$elementType = Craft::$app->elements->getElementTypeById($elementId);
$query = MatrixBlock::find()->site($selectedSite);
$query->relatedTo = $element;
$query->anyStatus();
/** @var MatrixBlock[] $blocks */
$blocks = $query->all();
$matchingBlocks = [];
foreach ($blocks as $block) {
$owner = $block->getOwner();
if ($owner) {
$matchingBlocks[$owner->id] = $owner;
}
}
/** @var Query $query */
$query = Entry::find()->site($selectedSite);
$query->relatedTo = $element;
$query->anyStatus();
/** @var Element[] $entries */
$entries = $query->all(); The relationship has been picked up in the system. I'm wondering you need to rebuild the search and cache 🤔 |
I will try that. Which specific command line commands should I run?
|
I believe it might be in setting and be called "Rebuild Search Indexes" and "Clear Caches" -> "Data caches" I'm not 100% sure where the relatedTo gets its data from without looking under the hood but it could be a good start. If not, I'm convinced it's linked somehow. |
Updating the search indexes worked!
Is there a more consistent maintenance, less-intensive wey to stay on top of this? Is it just junk data that collects over time?
… On Jan 17, 2024, at 5:50 PM, Regan Lawton ***@***.***> wrote:
I believe it might be in setting and be called "Rebuild Search Indexes" and "Clear Caches" -> "Data caches" I'm not 100% sure where the relatedTo gets its data from without looking under the hood but it could be a good start.
If not, I'm convinced it's linked somehow.
—
Reply to this email directly, view it on GitHub <#26 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAAE43IT33ZZESYA3Q5GPQDYPBPUVAVCNFSM6AAAAABB5IV6IWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJXGUYDKNRYGA>.
You are receiving this because you were mentioned.
|
I'm glad to hear! 🙌 You can do it via Craft CLI I believe and set up a cronjob. |
We're seeing some entries related to each other where there is no actual relation. The entries in question share some Title and Slug similarities with other entries that are related, but they have unique entry IDs, so should not be showing in the list.
I don't know how to detail this issue further. Please let me know what level of detail you would need to support.
The text was updated successfully, but these errors were encountered: