Defect #37102

Cannot 'move' ticket from one parent to another when the Parent tickets are related as Follows and Precedes

Added by Will M 5 months ago. Updated 5 months ago.

Status:ConfirmedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Issues planning
Target version:-
Resolution: Affected version:4.1.1

Description

As the title says, I have a subtask ticket under Parent 1.
When I try to change it to Parent 2, I get an error "Parent task is invalid."

If I first clear the Parent field and save, then I can set the Parent field to Parent ticket 2.

Yes, it certainly sounds like #13654, but I am are far past v3.3
I have: Redmine version: 4.1.1.stable

If Parent 1 and 2 are simply related, all is fine. It seems to be an issue with the Precedes and Follows relationship.
All three tickets are the same Project.
The Precedes and Follows relationship has no 'days' added, and none of the tickets have start or end dates.

Has someone else run in to such trouble? Maybe you have an idea?

History

#1 Updated by Bernhard Rohloff 5 months ago

  • Status changed from New to Confirmed

I've tested the steps with version 5.0.0 and can reproduce the issue.

#2 Updated by Mischa The Evil 5 months ago

I haven't looked deeply into this issue, but the following basic issue unit test demonstrates the reported behavior; the last assertion fails:

  def test_issue_37102
    set_language_if_valid 'en'
    parent1 = Issue.generate!
    parent2 = Issue.generate!
    child = Issue.generate!
    child.parent_issue_id = parent1.id
    assert_save child
    child.reload.parent_issue_id = parent2.id
    assert_save child
    relation = IssueRelation.create!(:issue_from => parent2, :issue_to => parent1, :relation_type => IssueRelation::TYPE_FOLLOWS)
    assert IssueRelation.exists?(relation.id)
    child.reload.parent_issue_id = nil
    assert_save child
    child.reload.parent_issue_id = parent1.id
    assert_save child 
    child.reload.parent_issue_id = parent2.id
    assert_save child
  end

This might be dependent on particular settings, but a quick look at changeset r15056 says to me this is currently likely the expected behavior (i.e. Issue#would_reschedule?() in r15056 doesn't check if start- and/or due-dates are actually set and the parent change could cause changes to both parents).

@Will M: could you also provide info about the specific issue relation direction(s) and the values of the 'Parent tasks attributes' settings?

#3 Updated by Bernhard Rohloff 5 months ago

Mischa The Evil wrote:

@Will M: could you also provide info about the specific issue relation direction(s) and the values of the 'Parent tasks attributes' settings?

May I write something about it? So reproducing is quite easy.

  1. Create three issues (Issue1, Issue2, Issue3)
  2. Set relationship (Issue2 to follow on Issue1)
  3. Set the parent task of Issue3 to either Issue1, or Issue2
  4. Try to switch the parent task field to the other issue

When hitting save on the last step the error message "Parent task is invalid" appears.

#4 Updated by Will M 5 months ago

Hi all,
Thank you for investigating this. We had a perfect plan for re-working our sub-tasks, and this problem makes our workflows a big pain because we have to remove the parent number from the sub-tasks first. And we're trying to do this as a bulk change. At least we can filter first, then bulk change two times.


@Misch The Evil
What can I provide that's helpful?
To isolate the bug from our specific system settings, we have a fresh install of Redmine 4.1.1 without any customization. Everything is 'default.'

Ticket 1 = Parent 1
  • Status: New
  • Priority: Normal
  • Assignee: Will
  • Start date: 05/12/2022
  • Due date:
  • % Done:
  • Estimated time: (Total: 0.00 h)
Ticket 2 = Parent 2
  • Status: New
  • Priority: Normal
  • Assignee: Will
  • Start date: 05/12/2022
  • Due date:
  • % Done:
  • Estimated time: (Total: 0.00 h)
Open Ticket 2 and read the related issues:
  • Follows Other Project - Feature #1: Parent 1
Next, make ticket #3 = Child, a sub-task
  • Open Ticket 3 and edit it.
  • Set it's parent as #1
  • Save
  • It works
  • Edit it again
  • Set it's parent as #2
  • Error: Parent task is invalid

I think this is why @Bernhard Rohloff says it's pretty easy to see the bug.
I really appreciate the help investigating.

Also available in: Atom PDF