-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support json for system:config:set #32512
Conversation
@@ -162,6 +162,16 @@ protected function castValue($value, $type) { | |||
'readable-value' => ($value === '') ? 'empty string' : 'string ' . $value, | |||
]; | |||
|
|||
case 'json': | |||
$decodedJson = \json_decode($value, true); | |||
if ($decodedJson == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
json_decode
will also return null
when a value is empty
Please add a test covering the empty parts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be ====
or is there a reason why not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will fix.
695d252
to
68b532c
Compare
Codecov Report
@@ Coverage Diff @@
## master #32512 +/- ##
============================================
+ Coverage 64.12% 64.12% +<.01%
- Complexity 18643 18645 +2
============================================
Files 1176 1176
Lines 70189 70195 +6
Branches 1270 1270
============================================
+ Hits 45007 45013 +6
Misses 24812 24812
Partials 370 370
Continue to review full report at Codecov.
|
Fixed up to have |
This is an enhancement to the |
Just thinking of the other way around - what should ( note I realize that these questions do not address the PR directly, but was wondering about the mechanisms in general ) |
worked for me to remove entry 1, and leave behind entry 0.
and
That works out nicely. The output of those is the JSON that I fed to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - rest needs to be decided by other maintainers
👍 |
@PVince81 if you have a moment this afternoon/evening, can you comment if this seems a good idea? If it is, then I would like to make use of it in some acceptance test code. So I am happy to have it merged. Then backport can be merged and I will write a doc issue and PR for 10.0.10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice addition 👍
Doc issue owncloud-archive/documentation#4404 raised. |
@phil-davis please backport |
Backport |
Description
Add support for
--type json
to theocc config:system:set
command.See commands below for examples of the type of things that can be done.
This allows configuring multi-key system config options in a single command, avoiding catch-22's.
Related Issue
Motivation and Context
In acceptance tests I want to be able to clear any
apps_paths
settings and then set upapps_paths
in different ways for the tests. To do that I can get the testing app to runocc config:system:set
but I need to be able to do it in a singleocc
command, to avoid the catch-22 in the referenced issue.I noticed this challenge today when looking at how to get the
appmanagement.feature
acceptance tests to setup their environment via the testing app. (At present they "cheat" and directly callsetSystemValue()
in the backend - which will not work for proper blackbox testing).How Has This Been Tested?
Manual
occ
commands like:or
and inspecting the result in
config.php
Types of changes
Checklist:
(documentation needed)
Open tasks: