From c2ff8bb6547ae7d27826e415d637df8a8fb4a294 Mon Sep 17 00:00:00 2001 From: Iwona Just Date: Mon, 12 Feb 2024 13:43:20 +0000 Subject: [PATCH 1/6] delete relations if the element was deleted for a site --- src/fields/BaseRelationField.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/fields/BaseRelationField.php b/src/fields/BaseRelationField.php index ac0092780b8..221e6f17006 100644 --- a/src/fields/BaseRelationField.php +++ b/src/fields/BaseRelationField.php @@ -1013,6 +1013,22 @@ public function afterElementSave(ElementInterface $element, bool $isNew): void parent::afterElementSave($element, $isNew); } + /** + * @inheritdoc + */ + public function afterElementDeleteForSite(ElementInterface $element): void + { + if ($this->localizeRelations) { + Db::delete(DbTable::RELATIONS, [ + 'fieldId' => $this->id, + 'sourceSiteId' => $element->siteId, + 'sourceId' => $element->id, + ]); + } + + parent::afterElementDeleteForSite($element); + } + /** * Normalizes the available sources into select input options. * From 13e12a52506201e51b57b4e9523a6ff1633861e3 Mon Sep 17 00:00:00 2001 From: Brad Bell Date: Tue, 13 Feb 2024 14:53:03 -0800 Subject: [PATCH 2/6] update v3, v4, v5 issue templates --- .github/ISSUE_TEMPLATE/BUG-REPORT-V3.yml | 2 +- .github/ISSUE_TEMPLATE/BUG-REPORT-V4.yml | 2 +- .github/ISSUE_TEMPLATE/BUG-REPORT-V5.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/BUG-REPORT-V3.yml b/.github/ISSUE_TEMPLATE/BUG-REPORT-V3.yml index 56c0f66b57b..6533a32135e 100644 --- a/.github/ISSUE_TEMPLATE/BUG-REPORT-V3.yml +++ b/.github/ISSUE_TEMPLATE/BUG-REPORT-V3.yml @@ -1,4 +1,4 @@ -name: Bug Report – Craft 3 +name: "Bug Report: Craft 3" description: Report an issue or unexpected behavior pertaining to Craft 3 title: '[3.x]: ' labels: diff --git a/.github/ISSUE_TEMPLATE/BUG-REPORT-V4.yml b/.github/ISSUE_TEMPLATE/BUG-REPORT-V4.yml index 71fab5a13b1..8ec55a33ddf 100644 --- a/.github/ISSUE_TEMPLATE/BUG-REPORT-V4.yml +++ b/.github/ISSUE_TEMPLATE/BUG-REPORT-V4.yml @@ -1,4 +1,4 @@ -name: Bug Report – Craft 4 +name: "Bug Report: Craft 4" description: Report an issue or unexpected behavior pertaining to Craft 4 title: '[4.x]: ' labels: diff --git a/.github/ISSUE_TEMPLATE/BUG-REPORT-V5.yml b/.github/ISSUE_TEMPLATE/BUG-REPORT-V5.yml index 79ef6efce80..9dc0d91a7fa 100644 --- a/.github/ISSUE_TEMPLATE/BUG-REPORT-V5.yml +++ b/.github/ISSUE_TEMPLATE/BUG-REPORT-V5.yml @@ -1,4 +1,4 @@ -name: Bug Report – Craft 5 +name: "Bug Report: Craft 5" description: Report an issue or unexpected behavior pertaining to Craft 5 title: '[5.x]: ' labels: From 7d989facf35329832b8a70c7345f339f50147816 Mon Sep 17 00:00:00 2001 From: Brad Bell Date: Tue, 13 Feb 2024 14:53:19 -0800 Subject: [PATCH 3/6] Remove issue template config and rely on org default --- .github/ISSUE_TEMPLATE/config.yml | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/config.yml diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index 4703d4c8f3f..00000000000 --- a/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1,20 +0,0 @@ -blank_issues_enabled: false -contact_links: - - name: Feature Request - url: https://github.com/craftcms/cms/discussions/new?category=ideas - about: Start a new discussion about your idea - - name: Documentation - url: https://docs.craftcms.com/ - about: Read the official documentation - - name: Knowledge Base - url: https://craftcms.com/knowledge-base - about: Find answers to common problems - - name: Developer Support Services - url: https://craftcms.com/support-services - about: Priority developer support from the team that makes Craft - - name: Craft Discord - url: https://craftcms.com/discord - about: Meet the community - - name: Stack Exchange - url: https://craftcms.stackexchange.com/ - about: Get help and help others From f1a52744fa5a9a1aad3fc35a4caac5c7480e76db Mon Sep 17 00:00:00 2001 From: Brad Bell Date: Tue, 13 Feb 2024 14:55:00 -0800 Subject: [PATCH 4/6] =?UTF-8?q?I=20guess=20you=20can=E2=80=99t=20override?= =?UTF-8?q?=20the=20org=20issue=20template=20config=20if=20you=20specify?= =?UTF-8?q?=20anything=20else=20in=20ISSUE=5FTEMPLATE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/ISSUE_TEMPLATE/config.yml | 41 +++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/config.yml diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000000..04ba033481b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,41 @@ +blank_issues_enabled: false +contact_links: + - name: Documentation + url: https://craftcms.com/docs + about: Read the official documentation + - name: Knowledge Base + url: https://craftcms.com/knowledge-base + about: Find official answers to common problems + - name: Developer Support Services + url: https://craftcms.com/support-services + about: Priority developer support from the team that makes Craft + - name: Craft Discord + url: https://craftcms.com/discord + about: Meet the community + - name: Stack Exchange + url: http://craftcms.stackexchange.com/ + about: Get help and help others + - name: "Feature Request: Craft CMS" + url: https://github.com/craftcms/cms/discussions/new?category=ideas + about: Make a feature request or enhancement for Craft CMS + - name: "Feature Request: Craft Console / Plugin Store" + url: https://github.com/craftcms/console/discussions/new?category=ideas + about: Make a feature request or enhancement for Craft Console or the Plugin Store + - name: "Feature Request: Craft Cloud" + url: https://github.com/craftcms/cloud/discussions/new?category=ideas + about: Make a feature request or enhancement for Craft Cloud + - name: "Feature Request: Craft Commerce" + url: https://github.com/craftcms/commerce/discussions/new?category=ideas + about: Make a feature request or enhancement for Craft Commerce + - name: "Bug Report: Craft CMS" + url: https://github.com/craftcms/cms/issues/new/choose + about: Create a bug report for Craft CMS + - name: "Bug Report: Craft Console / Plugin Store" + url: https://github.com/craftcms/console/issues/new/choose + about: Create a bug report for Craft Console or the Plugin Store + - name: "Bug Report: Craft Cloud" + url: https://craftcms.com/contact + about: Create a bug report for Craft Cloud + - name: "Bug Report: Craft Commerce" + url: https://github.com/craftcms/commerce/issues/new/choose + about: Create a bug report for Craft Commerce \ No newline at end of file From a98e62dffcf3216dc2734c49ba6ae418a62e0a26 Mon Sep 17 00:00:00 2001 From: Brad Bell Date: Tue, 13 Feb 2024 15:04:39 -0800 Subject: [PATCH 5/6] Update issue template --- .github/ISSUE_TEMPLATE/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 04ba033481b..4a4e1930de6 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -12,8 +12,8 @@ contact_links: - name: Craft Discord url: https://craftcms.com/discord about: Meet the community - - name: Stack Exchange - url: http://craftcms.stackexchange.com/ + - name: Craft Stack Exchange + url: https://craftcms.stackexchange.com/ about: Get help and help others - name: "Feature Request: Craft CMS" url: https://github.com/craftcms/cms/discussions/new?category=ideas From 1ea6c83e3de24f35f9442d4077e90deaee2ded85 Mon Sep 17 00:00:00 2001 From: brandonkelly Date: Tue, 13 Feb 2024 15:17:37 -0800 Subject: [PATCH 6/6] Release note [ci skip] --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d6792c47df5..2d52c8be0b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - Fixed a bug where GraphQL schema edit pages could include empty category headings. - Fixed a bug where asset slideouts weren’t showing validation errors on the Filename field. ([#14329](https://github.com/craftcms/cms/issues/14329)) - Fixed a bug where element slideouts would open when long-pressing on an element’s “Remove” button within an element select input. +- Fixed a bug where relations weren’t getting deleted when an element was deleted for a site. ([#14347](https://github.com/craftcms/cms/issues/14347)) ## 4.7.2.1 - 2024-02-08