Repository navigation
Omit parameters from empty Remote Config parameter groups - #1165
Merged
jeromegamez merged 2 commits intoNov 17, 2026
Merged
Conversation
An empty parameter group was encoded with "parameters": [], a JSON list. The Remote Config API expects a map and rejects the template with "Cannot bind a list to map for field 'parameters'", so validate() and publish() failed for every template containing an empty parameter group.
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## 8.x #1165 +/- ##
=========================================
Coverage 88.88% 88.89%
- Complexity 1525 1526 +1
=========================================
Files 158 158
Lines 4275 4277 +2
=========================================
+ Hits 3800 3802 +2
Misses 475 475
*This pull request uses carry forward flags. Click here to find out more. |
jeromegamez
requested changes
Nov 16, 2026
jeromegamez
left a comment
Member
There was a problem hiding this comment.
Looking good! Just two changes, and we're good to merge!
The request body test in RemoteConfigTest is dropped, validate() and publish() serialize the group through ParameterGroup, which is tested.
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.
Resolves #1164
What this does
ParameterGroup::toArray()always returned aparameterskey. For a group without parameters, that was an empty PHP array, which is encoded as a JSON list. The Remote Config API expects a map there, soRemoteConfig::validate()andRemoteConfig::publish()failed for every template that contains an empty parameter group:toArray()now leavesparametersout when the group is empty, the same wayParameter::toArray()leaves out emptyconditionalValues. This is also how the API returns an empty group (#1132), so a fetched template is sent back the way it came in.Backward compatibility
Only the array/JSON of an empty group changes: it no longer has a
parameterskey.RemoteConfigParameterGroupShapealready declaresparametersas optional since #1133, and groups with parameters are serialized as before.composer test:bcreports no backwards-incompatible changes.Included
ParameterGroup::toArray()ParameterGroupTest::testAnEmptyGroupIsSerializedWithoutParameters: the JSON of an empty groupParameterGroupTest::testItCanBeCreatednow also checks the JSON of a group with parametersRemoteConfigTest::testValidateTemplateWithEmptyParameterGroup(integration): validates a template with an empty group against the live API, next totestValidateEmptyTemplateTests before and after the fix
With
src/RemoteConfig/ParameterGroup.phpfrom8.x, the empty group test fails and shows the"parameters":[]that is sent to the API:With the fix:
Checks
composer pre-push: Rector, PHP-CS-Fixer and composer-normalize clean, PHPStan no errors, unit tests OK (371 tests, 567 assertions), BC check "No backwards-incompatible changes detected"