Repository navigation
Volume propagation methods - #20060
Open
brandonkelly wants to merge 9 commits into
Open
brandonkelly wants to merge 9 commits into
brandonkelly wants to merge 9 commits into
Conversation
brandonkelly
added a commit
that referenced
this pull request
Oct 21, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
brandonkelly
added a commit
that referenced
this pull request
Oct 22, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
brandonkelly
force-pushed
the
feature/volume-propagation-method
branch
from
October 22, 2026 04:39
e161324 to
e9bcbac
Compare
brandonkelly
added a commit
that referenced
this pull request
Oct 22, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
brandonkelly
force-pushed
the
feature/volume-propagation-method
branch
from
October 22, 2026 04:48
e9bcbac to
0e21caf
Compare
brandonkelly
added a commit
that referenced
this pull request
Oct 22, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
brandonkelly
force-pushed
the
feature/volume-propagation-method
branch
from
October 22, 2026 05:14
0e21caf to
4b6c894
Compare
brandonkelly
added a commit
that referenced
this pull request
Oct 22, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
brandonkelly
force-pushed
the
feature/volume-propagation-method
branch
from
October 22, 2026 05:34
4b6c894 to
f583eeb
Compare
Contributor
Volumes can now be set to let each asset choose which sites it should be saved to, rather than always saving assets to every site. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…all sites Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…new sites Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Assets can only be deleted for a site if they exist in another site as well, so their files never get deleted along with them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The UI only offers “Delete for site” for assets that exist in other sites, but if it's requested anyway, the asset is now deleted normally (soft-deleted) rather than hard-deleted, and normal delete permissions are required. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Elements that only exist in the site they're being deleted for are now soft-deleted, the same as a normal deletion, except for drafts (which are always hard-deleted) and nested elements (which get deleted for a site along with their owners, and couldn't be restored on their own). Also fixes deleteElementsForSite() treating every element as multi-site on single-site installs, where element queries ignore the siteId param. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s to custom propagation - Assets in volumes set to custom propagation return true from hasCustomPropagation(), so their Sites pane is shown even once they've been saved to all sites. - New volumes default to custom propagation. The migration sets existing volumes to custom on single-site installs, and keeps them at all on multi-site installs. - The temporary uploads volume keeps saving assets to all sites. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
brandonkelly
force-pushed
the
feature/volume-propagation-method
branch
from
October 22, 2026 05:38
f583eeb to
1516a88
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
This builds on #20061 (Sites pane), which should be merged first.
Adds a “Propagation Method” setting to asset volumes, similar to sections, with two options:
all)custom)New volumes default to
custom. Existing volumes are set tocustomon single-site installs (where nothing changes until a site is added), and keepallon multi-site installs, so new uploads there continue to be saved to all sites.With
custom, new assets are only saved to the site they were uploaded from, and can be added to other sites from the Sites pane on the asset’s edit page (from #20061). This avoids creatingelements_sites,assets_sites, and search index rows for every site when assets don’t need to exist in all of them.Related to #19761
Changes
craft\models\Volume::$propagationMethod, stored in project config and a newvolumes.propagationMethodcolumn. Onlyallandcustomare valid.customon single-site installs andallon multi-site installs, and records that in project config for any volumes that don’t have the setting yet. Volume configs without the setting are still treated asall, and the temporary uploads volume always usesall.customvolumes returntruefromhasCustomPropagation(), so their Sites pane is shown even once they’ve been saved to all sites.craft\elements\Asset::getSupportedSites()now follows the volume’s propagation method, mirroring how entries handlecustom.customtoall, its assets are resaved so they get propagated to all sites.craft\services\Assets::getAssetById()now falls back to other sites when no site ID is passed and the asset doesn’t exist in the current site.customvolumes have a “Delete for site” action (index action and edit page menu item), available to users who can delete the asset. The UI only offers it when the asset exists in another site as well. If it’s requested for an asset’s only site anyway, it gets soft-deleted like a normal asset deletion (requiring normal delete permissions). The asset’sassets_sitesrow for the deleted site is removed too.customvolumes.Elements::deleteElementsForSite()now soft-deletes elements that only exist in the site they’re being deleted for, the same as a normal deletion. Drafts (which are always hard-deleted) and nested elements are still hard-deleted. Nested elements were switched to hard deletion in eb17c70 (Feature/cms 1236 propagate element site deletions to nested elements #14154) when site deletions started cascading to them, since they get deleted along with their owner’s site content and couldn’t be restored on their own.Elements::deleteElementsForSite()treating every element as multi-site on single-site installs. Element queries ignore thesiteIdparam when there’s only one site, so the elements’ only site rows were removed without deleting the elements.🤖 Generated with Claude Code