Time Formatting does not apply to CSV exports
When you export time report to CSV, formatting does not apply on hours field.
Attached patch can fixed it.
#1 Updated by Mischa The Evil 2 months ago
- File #35726.patch added
- Subject changed from Time Formatting does not apply in time reports export to Time Formatting does not apply to CSV exports
- Category deleted (
- Status changed from New to Confirmed
- Affected version changed from 4.2.2 to 3.4.0
- timelog details;
- issue lists.
- the OP's initial changes, in a correct format;
- an additional change of
QueriesHelper#csv_valueto fix the issue for CSV exports of timelog details and issue lists.
I'll set the category to 'none' because it applies not only to 'Time tracking' and we don't have a CSV export category yet (and I don't want [to consider] to create it now).
I'll set the affected version to '3.4.0' because the issue was introduced with #23996. The fixes have to be back-ported to all supported Redmine branches.
I think that before this is being committed additional test coverage should be added for the fixed cases.
#3 Updated by Holger Just 2 months ago
I don't think we should backport this to older versions.
The CSV export emits a technical format which is usually consumed by spreadsheet software, or custom reporting tools. ere, it is important not to change the output format without consideration. As the output of the hours have always been floats here, consuming software likely expects this. Changing this in a patch update will likely break the assumptions of these tools unexpectedly.
As such, I believe we may ship this in 5.0.0 as a potentially breaking change and not backport it.
#4 Updated by Mischa The Evil 2 months ago
Good point. Fair enough. FYI, I'm also ok with no back-ports like you propose. My comment was more about the Redmine releases that are affected by this defect, and as such can be qualified as eligible for receiving the back-ports.
Nonetheless, I don't think that back-porting the fixes would become troublesome for the users in this case because:
Holger Just wrote:
[...] As the output of the hours have always been floats here, consuming software likely expects this. Changing this in a patch update will likely break the assumptions of these tools unexpectedly.
... this is not what these fixes would actually do IMHO. They don't change the output format of hours. Instead, slightly more subtle, they change the applicability of the setting that should determine the desired output format of the hours values.
Now, given that the default value of the setting is (still) to output floats (i.e. 'decimal'), nothing would change unless the administrator itself explicitly configured the Redmine instance to do so (i.e. by changing the setting to 'minutes'). And in that case it is/would be an anomaly to detect that only the CSV exports don't obey this setting (given that #23996 states: "a setting to also display such values in this way throughout the app"). And by then we can "argue" over whether "throughout the app" actually applies to CSV exports created by 'the app'... :lol: I'd say it does... :grin: