- Issue created by @codebymikey
- @codebymikey opened merge request.
- Status changed to Needs review
over 1 year ago 10:42am 24 July 2023 - 🇧🇬Bulgaria pfrenssen Sofia
Can you give some context about the changes made in the MR? It seems there are unrelated changes included which are not necessary to fix the bug. This is increasing the time and mental load needed to review the patch, so it would be beneficial to explain why they are included.
- I understand that the settings file export is adhering to the updated format of the
symfony/yaml
component. This is out of scope but a good improvement. - The config values are being cast to strings every time they are read. This looks like a valid fix but it also looks brittle - developers need to be told somehow that they are not to read this config value without always casting it to a string. I am wondering if it would be better to declare that the field is not nullable and provide an update hook to update existing config from NULL to an empty string? Then we do not need to forcefully cast it every time it is read.
- Is the replacing of
\r\n
line endings with\n
a fix for another known issue?
- I understand that the settings file export is adhering to the updated format of the
- Status changed to RTBC
about 1 year ago 2:42pm 31 October 2023 - 🇧🇬Bulgaria pfrenssen Sofia
To answer my own questions: the casting of "\r\n" to "\n" is to ensure the descriptions can be saved in config in the new YAML format and can be edited through the settings form without causing a change in the line endings.
After a more in-depth review I'm also OK with the casting to strings now. The global password is optional, so it would not be right to set it to be non-nullable. Casting to a string is a bit "dirty", but cleaner solutions like using null coalescing operators are PHP 8 only and the module still officially supports Drupal 8.8 (and that means it should run on PHP 7.4). The proposed solution in the MR with casting to strings is fully compatible with PHP 7 and PHP 8.