From 311f1e6cb212f089e72d3c1bd4c9f2899a3d461c Mon Sep 17 00:00:00 2001 From: Stefanie Gevaert Date: Fri, 2 Aug 2024 11:58:57 +0200 Subject: [PATCH 1/3] fix: added section.all fallback for the delete --- src/Typesense.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/Typesense.php b/src/Typesense.php index 6432946..4260cab 100755 --- a/src/Typesense.php +++ b/src/Typesense.php @@ -391,16 +391,22 @@ function (ElementEvent $event) { $entry = Entry::find()->id($element->id)->siteId($site['siteId'])->one(); if ($entry) { - $section = $entry->section->handle ?? null; + $sectionHandle = $entry->section->handle ?? null; $type = $entry->type->handle ?? null; $collection = null; $resolver = null; - if ($section) { + + if ($sectionHandle) { if ($type) { - $section = $section . '.' . $type; + $section = $sectionHandle . '.' . $type; + $collection = CollectionHelper::getCollectionBySection($section); + } + + // get the generic type if specific doesn't exist + if (is_null($collection)) { + $section = $sectionHandle . '.all'; + $collection = CollectionHelper::getCollectionBySection($section); } - - $collection = CollectionHelper::getCollectionBySection($section); } if ($collection) { From fed736d85081ca9091a6e0399ec349ca032115bf Mon Sep 17 00:00:00 2001 From: Stefanie Gevaert Date: Fri, 2 Aug 2024 11:59:21 +0200 Subject: [PATCH 2/3] chore: update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index bc6f8d4..1324b51 100755 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "craftpulse/craft-typesense", "description": "Craft Plugin that synchronises with Typesense", "type": "craft-plugin", - "version": "5.5.1", + "version": "5.5.2", "keywords": [ "craft", "cms", From d1b3b425a0429dfc36fa6e747662b38b228d86b9 Mon Sep 17 00:00:00 2001 From: Stefanie Gevaert Date: Fri, 2 Aug 2024 12:00:23 +0200 Subject: [PATCH 3/3] chore: update CHANGELOG.md --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d7b06a..c713074 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +### 5.5.2 - 2024-08-02 + +### Fixed +- Added section.all fallback for the deletion of documents + ### 5.5.1 - 2024-07-15 ### Fixed