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]: First save of a multisite entry with Matrix blocks orphans the blocks from the primary site #13155

Closed
aaronbushnell opened this issue May 3, 2023 · 6 comments
Assignees

Comments

@aaronbushnell
Copy link
Contributor

What happened?

I'm seeing an issue on a Craft site where a handful of Matrix blocks are being orphaned in the database and lost on my primary site when saving the "Home" single in my newly created site.

Here are the steps I'm performing:

1. Add a new Site

Screenshot 2023-05-03 at 9 49 34 AM

2. Change my Matrix field's "Propagation Method" so blocks are only on the site they were created in

Screenshot 2023-05-03 at 9 53 05 AM

3. Enable the Home single for the Spanish site

Screenshot 2023-05-03 at 9 56 33 AM

4. Visit the Spanish version of the Home single and then save it

Note: It appears that the primary site's blocks are in this view already. I thought this would normally be empty because of step 2, but I could be mistaken.

Screenshot 2023-05-03 at 9 59 37 AM

5. The primary site Home single has had all but one block removed

Screenshot 2023-05-03 at 10 00 57 AM

Database note

I've attached a screenshot of the blocks with the ownerId of 4 (the Home single) before I saved the Home single and after (step 4). You can see that a number of these drop off.

Screenshot 2023-05-03 at 10 05 13 AM

I was able to find one of the blocks that had dropped off to see where it went and here's what I found. It looks like that block was assigned a new ownerId and it points to a draft entry.

Screenshot 2023-05-03 at 10 11 04 AM

Let me know if you need me to send anything!

Craft CMS version

Craft Pro 4.4.8

PHP version

8.1.17

Operating system and version

Darwin 22.4.0

Database type and version

MySQL 5.7.41

Image driver and version

GD 8.1.17

Installed plugins and versions

  • Amazon S3: 2.0.3
  • Blitz: 4.4.4
  • Calendar: 4.0.9
  • Design Tokens: 1.0.3
  • Feed Me: 5.1.3
  • Formie: 2.0.28
  • Navigation: 2.0.17
  • Palette: 3.1.3
  • Ray: 2.0
  • Redactor: 3.0.4
  • Retour: 4.1.12
  • SEOmatic: 4.0.24
  • Sprig: 2.6.2
  • Super Table: 3.0.8.1
  • Typed link field: 2.1.5
  • UI Element fields: 2.0.3
@brandonkelly
Copy link
Member

After creating the new site, did you wait until the “Applying new propagation method to [section name] entries” queue job had completed before editing the entry?

@aaronbushnell
Copy link
Contributor Author

I did! When I saw that pop in I made sure to let that process entirely before proceeding

@brandonkelly
Copy link
Member

Quick update – I was able to reproduce this today, and looking into it.

@brandonkelly brandonkelly self-assigned this May 5, 2023
@brandonkelly
Copy link
Member

Got to the bottom of it, and this is now fixed for the next release!

@aaronbushnell
Copy link
Contributor Author

Thanks, @brandonkelly!

@brandonkelly
Copy link
Member

brandonkelly commented May 9, 2023

Craft 4.4.10 is out now with that fix.

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

2 participants