fix: network admin Automatic mode always resets to manual (CMS-1503)#369
Merged
Merged
Conversation
network_settings_save() was hardcoding 'manual' to sitemeta on every save, making it impossible for network admins to set Automatic mode. Also restores the cookie-blocking-mode UI in both network settings views (was commented out due to unescaped apostrophes in PHP strings).
Review Summary by QodoFix network admin Automatic mode always resetting to Manual
WalkthroughsDescription• Fix network admin Automatic mode silently reverting to Manual on save • Read cookie-blocking-mode from POST with validation instead of hardcoding • Uncomment and fix cookie-blocking UI in both network settings views • Escape apostrophes in PHP strings to prevent parse errors Diagramflowchart LR
A["Network Settings Save Handler"] -->|Previously hardcoded 'manual'| B["Sitemeta always set to Manual"]
A -->|Now reads from POST| C["Validate against allowlist"]
C -->|Valid value| D["Sitemeta preserves user selection"]
C -->|Invalid value| E["Default to Manual"]
F["Uncommented UI Sections"] -->|Fixed escaped apostrophes| G["Cookie-blocking mode UI enabled"]
File Changes1. src/settings/Network_Menu_Settings.php
|
Code Review by Qodo
1. Cookie-blocking text translation break
|
|
apinto-uc
approved these changes
May 4, 2026
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.



Fixes CMS-1503 — on WordPress multisite, switching to Automatic mode in the network admin and saving would silently revert to Manual on every save.
Root cause:
network_settings_save()hardcoded'manual'as the value forcookiebot-cookie-blocking-modein sitemeta regardless of what the user selected. Every other field in the same handler correctly reads from$_POST; this one did not.Secondary issue: The cookie-blocking-mode UI section in both
cb_frameanduc_framenetwork settings views was commented out. The strings inside contained unescaped apostrophes in PHP single-quoted strings (won't,user's,website's,'strictly necessary'), which caused a parse error when uncommented. This explains why it was disabled in the first place.Changes:
Network_Menu_Settings.php— readcookiebot-cookie-blocking-modefrom$_POSTwith allowlist validation, defaulting to'manual'uc_frame/network-settings-page.php— uncommented cookie-blocking UI, escaped apostrophes in three stringscb_frame/network-settings-page.php— sameTested locally with wp-env + Playwright on a multisite install: confirmed bug before fix (sitemeta
auto→manualafter save), confirmed both Automatic and "Choose per subsite" persist correctly after fix.