Shopware 6 is an open commerce platform based on Symfony Framework and Vue and supported by a worldwide community and more than 1.500 community extensions
When attempting to save and publish a draft in the Publisher , we are encountering a {{foreign key constraint violation}} error. This error is thrown when {{cms_block}} entries reference a {{cms_section}} with {{cms_section_id}} and {{cms_section_version_id}} that do not match any existing entries in the {{cms_section}} table. The issue appears to be related to how version contexts are handled across draft and merge operations.
h3. Steps to Reproduce:
Create or edit a draft using the CMS (shop page, sidebar).
Fill it with content, save it as a draft, add more content (sections, blocks, slots)
When attempting to save and publish a draft in the Publisher , we are encountering a {{foreign key constraint violation}} error. This error is thrown when {{cms_block}} entries reference a {{cms_section}} with {{cms_section_id}} and {{cms_section_version_id}} that do not match any existing entries in the {{cms_section}} table. The issue appears to be related to how version contexts are handled across draft and merge operations.
h3. Steps to Reproduce:
Create or edit a draft using the CMS (shop page, sidebar).
Fill it with content, save it as a draft, add more content (sections, blocks, slots)
Delete some blocks, save
Publish the draft