Defect #35726
openTime Formatting does not apply to CSV exports
Added by salman mp about 3 years ago. Updated 9 months ago.
0%
Description
When you export time report to CSV, formatting does not apply on hours field.
Attached patch can fixed it.
Files
timelog_helper.patch (1.27 KB) timelog_helper.patch | salman mp, 2021-08-09 18:25 | ||
#35726.patch (1.66 KB) #35726.patch | Patch against trunk @ r21131 | Mischa The Evil, 2021-08-09 21:33 |
Related issues
Updated by Mischa The Evil about 3 years ago
- File #35726.patch #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 (
Time tracking) - 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_value
to 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.
Updated by Mischa The Evil about 3 years ago
- Related to Feature #23996: Introduce a setting to change the display format of timespans to HH:MM added
Updated by Holger Just about 3 years 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.
Updated by Mischa The Evil about 3 years 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:
Updated by Go MAEDA over 2 years ago
- Related to Defect #31637: CSV and PDF export don't respect Time span format added
Updated by Mischa The Evil 9 months ago
- Target version set to 6.0.0
This might be the time to schedule this (and by extension #31637).