Skip to content

[4.x]: Relations not being removed when a site is being delete for a single site #14347

@MoritzLost

Description

@MoritzLost

What happened?

Description

When using the Delete for site action, the relations table is not updated to remove relations for that particular site. This is the case when Manage relations on a per-site basis is activated (haven't checked if this also happens without this setting). This is causing problems, because the relations are "leaking" to other sites in some cases – I'll open a separate issue for that.

Steps to reproduce

  1. Create an entry in a section with custom propagation and propagate it to multiple sites.
  2. In an entries field with the option mentioned above turned on, select some entries (in every site the entry is propagated to).
  3. Use the Delete entry for this site action to delete the entry in some sites (but not all of them).
  4. Check the relations table in the database. It will still contain the relations for the deleted sites.

Expected behavior

Deleting a propagated entry for a single site should remove all its relations from the relations table, so they can't interfere with entry queries.

Actual behavior

Relations for deleted propagated entries are remaining the relations table and causing problems.

Related to #13956

Craft CMS version

4.7.2.1

PHP version

8.2

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions