Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
maikueo opened this issue Sep 6, 2024 · 2 comments
Assignees

Comments

@maikueo
Copy link

maikueo commented Sep 6, 2024

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"

@i-just
Copy link
Contributor

i-just commented Sep 6, 2024

Hi, thanks for reporting! I raised a PR for this.

@brandonkelly
Copy link
Member

Craft 4.12.1 and 5.4.2 are out with that fix. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants