プロジェクト

全般

プロフィール

Vote #78673

完了

Blank "Issue" field on the "Log time" from the "Spent time - Details" page for an issue

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Time tracking_13
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
13
version_id:
133
issue_org_id:
26520
author_id:
304477
assigned_to_id:
1
comments:
7
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
132
ステータス-->[Closed]

説明

When I tried to log time from a "Spent time - Details" page (like https://example.com/projects/project-identifier/time_entries?issue_id=%7E12345 ), I clicked the "Log time" link, and I saw an entry form for spent time with blank "issue" field and an orphan time entry was created unexpectedly.

Steps to reproduce:

  1. Visit a list of issues under any project. (/projects/project-identifier/issues)
  2. Visit an issue.
  3. Click the "Log time" link.
  4. Fill "Hours" field with a value 1.
  5. Choose any activity.
  6. Click the "Create" button.
  7. Then you'll see a list of spent time under the project.
  8. Back to the issue.
  9. Then you'll see a link like "Spent time: 1.00h".
  10. Click the "Spent time: 1.00h" link.
  11. Then you'll see a list of spent time for the issue. (/projects/project-identifier/time_entries?issue_id=%7E123)
    1. Click the "Log time" link in the page.

Expected result:

An entry form is shown with a "Issue" field filled with a value like 123 (or any issue number.)

Actual result:

An entry form is shown with a blank "Issue" field. There is no issue number.

Confrimed versions with unexpected behavior:

  • Redmine 3.4.2
  • Redmine 3.4.1
  • Redmine 3.3.0

At the step 12, the link URL is generated for the project itself, like: /projects/project-identifier/time_entries/new.

Confirmed versions with expected behavior:

  • Redmine 3.2.0

At the step 12, the link URL is generated for the project itself, like: /issues/123/time_entries/new.


journals

> Confirmed versions with expected behavior:
>
> Redmine 3.2.0
>
> At the step 12, the link URL is generated for the project itself, like: `/issues/123/time_entries/new`.

Oops, the description is wrong. Correct:

> At the step 12, the link URL is generated for the issue itself, like: `/issues/123/time_entries/new`.

--------------------------------------------------------------------------------
The link URL is generated by the `_new_time_entry_path` helper method, but no issue id is given to the method even if there is the `issue_id` parameter. As the result, the method calls `new_project_time_entry_path` internally instead of `new_issue_time_entry_path`.
--------------------------------------------------------------------------------
Workaround:

<pre><code class="diff">
$ svn diff
Index: app/controllers/timelog_controller.rb
===================================================================
--- app/controllers/timelog_controller.rb (revision 16854)
+++ app/controllers/timelog_controller.rb (working copy)
@@ -40,6 +40,7 @@
include QueriesHelper

def index
+ @issue = params[:issue_id]
retrieve_time_entry_query
scope = time_entry_scope.
preload(:issue => [:project, :tracker, :status, :assigned_to, :priority]).
</code></pre>
--------------------------------------------------------------------------------
Thank you for the workaround. I was looking into this literally at the same time :). This change is the culprit - r15644 .
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Fixed in r16924, thanks for pointing this out.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

Admin Redmine さんが3年以上前に更新

  • カテゴリTime tracking_13 にセット
  • 対象バージョン3.4.3_133 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0