Skip to content

Use the target site's default status when propagating to a new site - #1788

Open
mnlmaier wants to merge 1 commit into
craftcms:6.xfrom
mnlmaier:bugfix/custom-propagation-default-status
Open

mnlmaier wants to merge 1 commit into
craftcms:6.xfrom
mnlmaier:bugfix/custom-propagation-default-status

Conversation

@mnlmaier

@mnlmaier mnlmaier commented Nov 6, 2026

Copy link
Copy Markdown

Description

When an entry is matched on another site, Entry::checkPropagation() gives it a status for the feed's target site, so the custom propagation method treats that site as supported. Until now that status was copied from the site the entry was found on.

It now uses the section's Default Status for the target site, the same way setModel() does for new entries. If there are no site settings for the target site, it falls back to the previous behavior. A mapped status still overrides it afterwards, so this only changes imports where the status is set to "Don't import".

This changes behavior: imports that relied on the copied status will now get the target site's Default Status instead. To keep entries enabled, map the status or turn on Default Status for that site.

Tests: added a test to ProcessTest covering both Default Status values for the target site.

Commerce products

CommerceProduct::checkPropagation() uses the same pattern ($existingElement->getEnabledForSite()), so products matched on another site probably end up with that site's status on the target site too. Product types also have a per-site Default Status (ProductTypeSite::$enabledByDefault), which CommerceProduct::setModel() already uses for new products, so the same change would likely apply there. I left it out of this PR because I couldn't test it, since Commerce isn't a dev dependency.

Related issues

Fixes #1787
Related: #1279, #1292

@mnlmaier
mnlmaier requested a review from angrybrad as a code owner November 6, 2026 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Entries matched on another site get that site's status when added to the target site (custom propagation)

1 participant