Skip to content

[4.x]: Multisite: Reverting to revision before a translation was created results in an Integrity Constraint Violation #15679

@maikueo

Description

@maikueo

What happened?

Description

On a multisite, on a section set to "Let each entry choose which sites it should be saved to", if you first fill out a content in 1 language, then enable the second language to begin translation, if you revert to a revision before the translation was created it results in an Integrity Constraint Violation error.
This happens in all craftcms versions from 4.11.0 to the latest version of 4.12, and does not happen between 4.8.x to 4.10.x
Tried on a fresh install with no plugins.

image

Steps to reproduce

  1. On an install above 4.11, create an install with at least 2 sites, e.g. EN, DE.
  2. Create a section e.g. "pages" which is set to "Let each entry choose which sites it should be saved to"
  3. Create an entry in EN, give it a title and save
  4. Edit the entry and save again to create a revision or two
  5. Use the sidebar to enable the entry in DE to begin translation
  6. Create a revision for the DE entry
  7. Switch back to the EN entry and select Revision 1 (or any revision before the DE entry was created)
  8. Click on the "Revert content from this revision"

Expected behavior

It should work as it did on 4.10.x and below: No error should be displayed and the EN entry should be reverted to the selected revision.

Actual behavior

An Integrity Constraint Violation error is displayed

Craft CMS version

4.11.0 - 4.12.0

PHP version

8.1.22

Operating system and version

Linux 5.15.49-linuxkit

Database type and version

MySQL 8.0.33

Image driver and version

Imagick 3.7.0 (ImageMagick 6.9.11-60)

Installed plugins and versions

"craftcms/cms": "4.12.0",
"vlucas/phpdotenv": "^5.4.0"

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions