CLI - Use the right data type when saving global configuration values #47055
Replies: 5 comments
-
|
Maybe I am testing this wrong but when I tried to use config:set to change the smtpport ONLY that field was changed from an integer to string. No other values were changed. Changing massmailoff from true to false didnt change to a boolean |
Beta Was this translation helpful? Give feedback.
-
|
Hmm, but the code which does that is still here: https://github.com/joomla/joomla-cms/blob/5.3-dev/libraries/src/Console/SetConfigurationCommand.php#L445-L450 |
Beta Was this translation helpful? Give feedback.
-
|
As I said maybe my test is wrong
|
Beta Was this translation helpful? Give feedback.
-
|
@brianteeman Yes, the issue is vice versa. If you save a string value which has value That means: Test if you can save e.g. |
Beta Was this translation helpful? Give feedback.
-
|
now i am even more confused.
The only values that were changed were the values I instructed to be changed and yes the integers were changed to strings which i agree is wrong but the true/false did not change data type |
Beta Was this translation helpful? Give feedback.


Uh oh!
There was an error while loading. Please reload this page.
-
Is your feature request related to a problem? Please describe.
Currently the CLI command
config:setchanges all integer values to string values when saving changes, regardless whether these values were changed or not.Values which seem to be boolean because they have content "true" or "false" are saved as booleans, but that is not really safe.
See the comment here: #42618 (comment) .
Describe the solution you'd like
The CLI should save configuration in the same way as the administrator does, so the data types of the particular values are determined by the
administrator/components/com_config/forms/application.xmlfile or by the existingconfiguration.phpfile.The should not be a data type conversion based on the content of a value like it is currently done for boolean here https://github.com/joomla/joomla-cms/blob/5.0-dev/libraries/src/Console/SetConfigurationCommand.php#L445-L450 .
Additional context
See also issue #42612 and PR #42618 .
Beta Was this translation helpful? Give feedback.
All reactions