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: diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 4703d4c8f3f..4a4e1930de6 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,20 +1,41 @@ 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/ + url: https://craftcms.com/docs about: Read the official documentation - name: Knowledge Base url: https://craftcms.com/knowledge-base - about: Find answers to common problems + 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 + - 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 + 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 diff --git a/CHANGELOG.md b/CHANGELOG.md index a7e32973c12..17fceaac70a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,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)) ## 5.0.0-beta.1 - 2024-02-08 diff --git a/src/fields/BaseRelationField.php b/src/fields/BaseRelationField.php index b9c5a80c742..9ed49321eb7 100644 --- a/src/fields/BaseRelationField.php +++ b/src/fields/BaseRelationField.php @@ -1056,6 +1056,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. *