Repository navigation
fix: apply the share with subsites setting when a network snippet is saved - #590
Closed
TallblokeUK wants to merge 2 commits into
Closed
TallblokeUK wants to merge 2 commits into
TallblokeUK wants to merge 2 commits into
Conversation
Contributor
Author
|
Superseded by #598, which carries the same commits into |
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.
On multisite, the "share with subsites" setting on a network snippet was never applied.
save_snippet()reads the snippet back from the database and uses that copy from then on, but whether a snippet is shared is not a column: it is derived from the list of shared IDs, so the copy carried the old setting and the requested one was discarded. Sharing could not be switched on for a new or an existing snippet, nor switched off.Reported, with the cause and a suggested fix, at https://wordpress.org/support/topic/thanks-to-claude-this-plugin-finally-works-bugfix-for-you/
Changes
Verification
WP_TESTS_MULTISITE=1: all ten pass, and seven fail without the change. With only the first two changes, the test for the site the request ends on fails (site 4 rather than site 1).Uninstaller_Test::test_complete_uninstall_removes_stats_chart_view_preferences, which fails the same way oncore-betawithout this change.lint:phppasses.No changelog entry is included, as there is no open section after 4.0.0.