Defect #16260

Add Subtask does not work correctly from tasks with Parent Task field disabled

Added by Domingo Galdos about 3 years ago. Updated 15 days ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Issues
Target version:3.4.0
Resolution:Fixed Affected version:

Description

It's desirable sometimes to make a certain tracker designated for having child tasks only, but not having parents (a "top level" task)

Unfortunately, if you do this (by disabling "parent" field for the tracker the top-level task tracker) you lose the ability to usefully use the Add Subtask link for those issues. This is because Add Subtask currently defaults to the same tracker as the parent tracker for the child. Since the tracker does not allow the Parent task field, the linkage gets lost (even if the user manually selects another tracker -- which they will have to do anyway) and has to be re-added manually. This makes the Add Subtask link useless in this case, making it slightly less useful than just clicking New Issue.

A simple fix is to change how the default tracker is chosen after clicking Add Subtask. If the tracker that would have been chosen doesn't support being a subtask (no Parent task field) then pick another one.

The attached patch does this by sticking with the same tracker as current if it supports subtasking. If the same tracker doesn't, it picks the highest-priority (as in ORDER BY trackers.position) tracker enabled for that project that does support being a subtask.

This patch is based on 2.4.1.stable. If I am missing anything else needed to consider this patch for merging please let me know. Thanks!

parent_task.patch Magnifier - This patch is based on 2.4.1.stable. (872 Bytes) Domingo Galdos, 2014-03-06 19:57

16260-parent_task-v2.diff Magnifier - patch against 3.3.2.devel.16240 (803 Bytes) Go MAEDA, 2017-01-22 06:10

16260-parent_task-r16340.diff Magnifier - Patch for 3.3.2.devel.16340 (835 Bytes) Go MAEDA, 2017-02-25 07:30


Related issues

Related to Redmine - Patch #22345: Trackers that have parent_issue_id in their disabled_core... Closed

Associated revisions

Revision 16383
Added by Jean-Philippe Lang 15 days ago

Adding a subtask should default to a tracker without disabled parent field (#16260).

History

#1 Updated by Michael Sanders almost 3 years ago

Thank you for this! I've been searching high and low for a solution, and didn't even know the cause of the problem!
+1 for this being implemented as a fix. This is clearly a defect.

#2 Updated by Toshi MARUYAMA over 2 years ago

  • Tracker changed from Patch to Defect

#3 Updated by Edosoft Factory over 2 years ago

A related plugin that modifies that method is Subtasks Inherited Fields Plugin. Checkout at https://github.com/edosoft/redmine-inherit-fields-plugin

#4 Updated by Domingo Galdos over 2 years ago

Is there anything I can do to move this patch forward?

#5 Updated by Hal Glenn 8 months ago

Still relevant and helpful on 3.2, thanks for the patch!

#6 Updated by Go MAEDA 2 months ago

  • Related to Patch #22345: Trackers that have parent_issue_id in their disabled_core_fields should not be selectable for new child issues added

#7 Updated by Go MAEDA 2 months ago

This problem have been partially fixed by #22345 (Redmine 3.3.0), but still remains when "Parent task" field of the topmost tracker is disabled.
("topmost tracker" means the tracker which has smallest position value)

I have updated the patch by Domingo Galdos for the current trunk (3.3.2.devel.16240).

#8 Updated by Go MAEDA 27 days ago

Updated Domingo Galdos's patch for the current trunk (r16340).

#9 Updated by Go MAEDA 27 days ago

  • Target version set to 3.4.0

#11 Updated by Jean-Philippe Lang 15 days ago

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

Fix in r16383 using a different approach in order to avoid to compute the default tracker each time the link to add a subtask is rendered. Thanks for pointing this out.

Also available in: Atom PDF