Project

General

Profile

Actions

Patch #25526

closed

Revert API change in spent_hours field in issue#show

Added by Holger Just about 7 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Normal
Category:
REST API
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

When preloading the spent_hours of issues (as e.g. done for #20661, they default to 0 instead of the previous default 0.0. This results in a change of the issue#show API which now also returns an Integer instead of a Float. Previously (in Redmine 3.2), the API used to return the data the following way:

{
  "issue": {
    "id": 15,
    ...
    "spent_hours": 0.0,
    ...
  }
}

While later versions (including the current trunk) return them as follows:

{
  "issue": {
    "id": 15,
    ...
    "spent_hours": 0,
    ...
  }
}

This appears to break strict API clients which expect a float there. In our tests, this change appears to break the current Android version of RedminePM, probably due to some internal type exceptions. The attached patch was extracted from Planio and fixes this behavior. With it, we follow the previous behavior of always sending Floats.


Files


Related issues

Related to Redmine - Patch #20661: Show visible spent time link for users allowed to view time entries.ClosedJean-Philippe Lang

Actions
Actions #1

Updated by Jean-Philippe Lang about 7 years ago

  • Status changed from New to Closed
  • Assignee set to Jean-Philippe Lang

Patch committed with an API test, thanks.

Actions #2

Updated by Jean-Philippe Lang about 7 years ago

  • Related to Patch #20661: Show visible spent time link for users allowed to view time entries. added
Actions #3

Updated by Go MAEDA about 7 years ago

  • Target version set to 3.2.6
Actions #4

Updated by Toshi MARUYAMA almost 7 years ago

  • Description updated (diff)
Actions

Also available in: Atom PDF