Package: redmine
Version: 3.3.1-4

Redmine 3.3 allows closing issues despite the presence of unclosed subtasks;
this is a regression from previous versions of redmine, and has been fixed
upstream in the next minor-version release, redmine 3.4.0; see:

        http://www.redmine.org/issues/10989

Should backport this to the stable release; otherwise it's just going to make
later upgrades harder for people who accumulate broken parent/subtask relations
in the interim.

The changeset from upstream *almost* applied cleanly; it required very minor 
changes
to deal with the slight different context.
Index: redmine-3.3.1/app/models/issue.rb
===================================================================
--- redmine-3.3.1.orig/app/models/issue.rb
+++ redmine-3.3.1/app/models/issue.rb
@@ -713,6 +713,9 @@ class Issue < ActiveRecord::Base
           @parent_issue.self_and_ancestors.any? {|a| a.relations_from.any? {|r| r.relation_type == IssueRelation::TYPE_PRECEDES && r.issue_to.would_reschedule?(self)}}
         )
         errors.add :parent_issue_id, :invalid
+      elsif !closed? && @parent_issue.closed?
+        # cannot attach an open issue to a closed parent
+        errors.add :base, :open_issue_with_closed_parent
       elsif !new_record?
         # moving an existing issue
         if move_possible?(@parent_issue)
@@ -931,9 +934,14 @@ class Issue < ActiveRecord::Base
       statuses << initial_status unless statuses.empty?
       statuses << default_status if include_default || (new_record? && statuses.empty?)
       statuses = statuses.compact.uniq.sort
-      if blocked?
+      if blocked? || descendants.open.any?
+        # cannot close a blocked issue or a parent with open subtasks
         statuses.reject!(&:is_closed?)
       end
+      if ancestors.open(false).any?
+        # cannot reopen a subtask of a closed parent
+        statuses.select!(&:is_closed?)
+      end
       statuses
     end
   end
Index: redmine-3.3.1/config/locales/ar.yml
===================================================================
--- redmine-3.3.1.orig/config/locales/ar.yml
+++ redmine-3.3.1/config/locales/ar.yml
@@ -129,6 +129,7 @@ ar:
         circular_dependency: "هذه العلاقة سوف تخلق علاقة تبعية دائرية"
         cant_link_an_issue_with_a_descendant: "لا يمكن ان تكون المشكلة مرتبطة بواحدة من المهام الفرعية"
         earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
+        open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
 
   actionview_instancetag_blank_option: الرجاء التحديد
 
Index: redmine-3.3.1/config/locales/az.yml
===================================================================
--- redmine-3.3.1.orig/config/locales/az.yml
+++ redmine-3.3.1/config/locales/az.yml
@@ -197,6 +197,7 @@ az:
         circular_dependency: "Belə əlaqə dövri asılılığa gətirib çıxaracaq"
         cant_link_an_issue_with_a_descendant: "Tapşırıq özünün alt tapşırığı ilə əlaqəli ola bilməz"
         earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
+        open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
 
   support:
     array:
Index: redmine-3.3.1/config/locales/bg.yml
===================================================================
--- redmine-3.3.1.orig/config/locales/bg.yml
+++ redmine-3.3.1/config/locales/bg.yml
@@ -131,6 +131,7 @@ bg:
         circular_dependency: "Тази релация ще доведе до безкрайна зависимост"
         cant_link_an_issue_with_a_descendant: "Една задача не може да бъде свързвана към своя подзадача"
         earlier_than_minimum_start_date: "не може да бъде по-рано от %{date} поради предхождащи задачи"
+        open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
 
   actionview_instancetag_blank_option: Изберете
 
Index: redmine-3.3.1/config/locales/bs.yml
===================================================================
--- redmine-3.3.1.orig/config/locales/bs.yml
+++ redmine-3.3.1/config/locales/bs.yml
@@ -141,6 +141,7 @@ bs:
         circular_dependency: "Ova relacija stvar cirkularnu zavisnost"
         cant_link_an_issue_with_a_descendant: "An issue can not be linked to one of its subtasks"
         earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
+        open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
 
   actionview_instancetag_blank_option: Molimo odaberite
 
Index: redmine-3.3.1/config/locales/ca.yml
===================================================================
--- redmine-3.3.1.orig/config/locales/ca.yml
+++ redmine-3.3.1/config/locales/ca.yml
@@ -134,6 +134,7 @@ ca:
         circular_dependency: "Aquesta relació crearia una dependència circular"
         cant_link_an_issue_with_a_descendant: "Un assumpte no es pot enllaçar a una de les seves subtasques"
         earlier_than_minimum_start_date: "no pot ser anterior a %{date} derivat a les peticions precedents"
+        open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
 
   actionview_instancetag_blank_option: "Seleccionar"
 
Index: redmine-3.3.1/config/locales/cs.yml
===================================================================
--- redmine-3.3.1.orig/config/locales/cs.yml
+++ redmine-3.3.1/config/locales/cs.yml
@@ -135,6 +135,7 @@ cs:
         circular_dependency: "Tento vztah by vytvořil cyklickou závislost"
         cant_link_an_issue_with_a_descendant: "Úkol nemůže být spojen s jedním z jeho dílčích úkolů"
         earlier_than_minimum_start_date: "nemůže být dříve než %{date} kvůli předřazeným úkolům"
+        open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
 
   actionview_instancetag_blank_option: Prosím vyberte
 
Index: redmine-3.3.1/config/locales/da.yml
===================================================================
--- redmine-3.3.1.orig/config/locales/da.yml
+++ redmine-3.3.1/config/locales/da.yml
@@ -142,6 +142,7 @@ da:
         circular_dependency: "Denne relation vil skabe et afhængighedsforhold"
         cant_link_an_issue_with_a_descendant: "En sag kan ikke relateres til en af dens underopgaver"
         earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
+        open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
 
       template:
         header:
Index: redmine-3.3.1/config/locales/de.yml
===================================================================
--- redmine-3.3.1.orig/config/locales/de.yml
+++ redmine-3.3.1/config/locales/de.yml
@@ -146,6 +146,7 @@ de:
         circular_dependency: "Diese Beziehung würde eine zyklische Abhängigkeit erzeugen"
         cant_link_an_issue_with_a_descendant: "Ein Ticket kann nicht mit einer Ihrer Unteraufgaben verlinkt werden"
         earlier_than_minimum_start_date: "kann wegen eines Vorgängertickets nicht vor %{date} liegen"
+        open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
 
   actionview_instancetag_blank_option: Bitte auswählen
 
Index: redmine-3.3.1/config/locales/el.yml
===================================================================
--- redmine-3.3.1.orig/config/locales/el.yml
+++ redmine-3.3.1/config/locales/el.yml
@@ -131,6 +131,7 @@ el:
         circular_dependency: "Αυτή η σχέση θα δημιουργήσει κυκλικές εξαρτήσεις"
         cant_link_an_issue_with_a_descendant: "An issue can not be linked to one of its subtasks"
         earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
+        open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
 
   actionview_instancetag_blank_option: Παρακαλώ επιλέξτε
 
Index: redmine-3.3.1/config/locales/en-GB.yml
===================================================================
--- redmine-3.3.1.orig/config/locales/en-GB.yml
+++ redmine-3.3.1/config/locales/en-GB.yml
@@ -134,6 +134,7 @@ en-GB:
         circular_dependency: "This relation would create a circular dependency"
         cant_link_an_issue_with_a_descendant: "An issue cannot be linked to one of its subtasks"
         earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
+        open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
 
   actionview_instancetag_blank_option: Please select
 
Index: redmine-3.3.1/config/locales/en.yml
===================================================================
--- redmine-3.3.1.orig/config/locales/en.yml
+++ redmine-3.3.1/config/locales/en.yml
@@ -130,6 +130,7 @@ en:
         circular_dependency: "This relation would create a circular dependency"
         cant_link_an_issue_with_a_descendant: "An issue cannot be linked to one of its subtasks"
         earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
+        open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
 
   actionview_instancetag_blank_option: Please select
 
Index: redmine-3.3.1/config/locales/es-PA.yml
===================================================================
--- redmine-3.3.1.orig/config/locales/es-PA.yml
+++ redmine-3.3.1/config/locales/es-PA.yml
@@ -140,6 +140,7 @@ es-PA:
         circular_dependency: "Esta relación podría crear una dependencia circular"
         cant_link_an_issue_with_a_descendant: "Esta incidencia no puede ser ligada a una de estas tareas"
         earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
+        open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
 
         # Append your own errors here or at the model/attributes scope.
 
Index: redmine-3.3.1/config/locales/es.yml
===================================================================
--- redmine-3.3.1.orig/config/locales/es.yml
+++ redmine-3.3.1/config/locales/es.yml
@@ -138,6 +138,7 @@ es:
         circular_dependency: "Esta relación podría crear una dependencia circular"
         cant_link_an_issue_with_a_descendant: "Esta petición no puede ser ligada a una de estas tareas"
         earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
+        open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
 
         # Append your own errors here or at the model/attributes scope.
 
Index: redmine-3.3.1/config/locales/et.yml
===================================================================
--- redmine-3.3.1.orig/config/locales/et.yml
+++ redmine-3.3.1/config/locales/et.yml
@@ -147,6 +147,7 @@ et:
         circular_dependency: "See suhe looks vastastikuse sõltuvuse"
         cant_link_an_issue_with_a_descendant: "Teemat ei saa sidustada tema enda alamteemaga"
         earlier_than_minimum_start_date: "Tähtpäev ei saa olla varasem kui %{date} eelnevate teemade tähtpäevade tõttu"
+        open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
 
   actionview_instancetag_blank_option: "Palun vali"
 
Index: redmine-3.3.1/config/locales/eu.yml
===================================================================
--- redmine-3.3.1.orig/config/locales/eu.yml
+++ redmine-3.3.1/config/locales/eu.yml
@@ -132,6 +132,7 @@ eu:
         circular_dependency: "Erlazio honek mendekotasun zirkular bat sortuko luke"
         cant_link_an_issue_with_a_descendant: "Zeregin bat ezin da bere azpiataza batekin estekatu."
         earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
+        open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
 
   actionview_instancetag_blank_option: Hautatu mesedez
 
Index: redmine-3.3.1/config/locales/fa.yml
===================================================================
--- redmine-3.3.1.orig/config/locales/fa.yml
+++ redmine-3.3.1/config/locales/fa.yml
@@ -130,6 +130,7 @@ fa:
         circular_dependency: "این وابستگی یک وابستگی دایره وار خواهد ساخت"
         cant_link_an_issue_with_a_descendant: "یک مورد نمی‌تواند به یکی از زیر کارهایش پیوند بخورد"
         earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
+        open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
 
   actionview_instancetag_blank_option: گزینش کنید
 
Index: redmine-3.3.1/config/locales/fi.yml
===================================================================
--- redmine-3.3.1.orig/config/locales/fi.yml
+++ redmine-3.3.1/config/locales/fi.yml
@@ -155,6 +155,7 @@ fi:
         circular_dependency: "Tämä suhde loisi kehän."
         cant_link_an_issue_with_a_descendant: "An issue can not be linked to one of its subtasks"
         earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
+        open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
 
   actionview_instancetag_blank_option: Valitse, ole hyvä
 
Index: redmine-3.3.1/config/locales/fr.yml
===================================================================
--- redmine-3.3.1.orig/config/locales/fr.yml
+++ redmine-3.3.1/config/locales/fr.yml
@@ -150,6 +150,7 @@ fr:
         circular_dependency: "Cette relation créerait une dépendance circulaire"
         cant_link_an_issue_with_a_descendant: "Une demande ne peut pas être liée à l'une de ses sous-tâches"
         earlier_than_minimum_start_date: "ne peut pas être antérieure au %{date} à cause des demandes qui précèdent"
+        open_issue_with_closed_parent: "Une demande ouverte ne peut pas être rattachée à une demande fermée"
 
   actionview_instancetag_blank_option: Choisir
 
Index: redmine-3.3.1/config/locales/gl.yml
===================================================================
--- redmine-3.3.1.orig/config/locales/gl.yml
+++ redmine-3.3.1/config/locales/gl.yml
@@ -159,6 +159,7 @@ gl:
         circular_dependency: "Esta relación podería crear unha dependencia circular"
         cant_link_an_issue_with_a_descendant: "As peticións non poden estar ligadas coas súas subtarefas"
         earlier_than_minimum_start_date: "Non pode ser antes de %{date} por mor de peticións anteriores"
+        open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
 
   actionview_instancetag_blank_option: Por favor seleccione
 
Index: redmine-3.3.1/config/locales/he.yml
===================================================================
--- redmine-3.3.1.orig/config/locales/he.yml
+++ redmine-3.3.1/config/locales/he.yml
@@ -135,6 +135,7 @@ he:
         circular_dependency: "קשר זה יצור תלות מעגלית"
         cant_link_an_issue_with_a_descendant: "לא ניתן לקשר נושא לתת־משימה שלו"
         earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
+        open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
 
   actionview_instancetag_blank_option: בחר בבקשה
 
Index: redmine-3.3.1/config/locales/hr.yml
===================================================================
--- redmine-3.3.1.orig/config/locales/hr.yml
+++ redmine-3.3.1/config/locales/hr.yml
@@ -125,6 +125,7 @@ hr:
         circular_dependency: "Ovaj relacija stvara kružnu ovisnost"
         cant_link_an_issue_with_a_descendant: "An issue can not be linked to one of its subtasks"
         earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
+        open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
 
   actionview_instancetag_blank_option: Molimo odaberite
 
Index: redmine-3.3.1/config/locales/hu.yml
===================================================================
--- redmine-3.3.1.orig/config/locales/hu.yml
+++ redmine-3.3.1/config/locales/hu.yml
@@ -151,6 +151,7 @@
         circular_dependency: "Ez a kapcsolat egy körkörös függőséget eredményez"
         cant_link_an_issue_with_a_descendant: "An issue can not be linked to one of its subtasks"
         earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
+        open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
 
   actionview_instancetag_blank_option: Kérem válasszon
 
Index: redmine-3.3.1/config/locales/id.yml
===================================================================
--- redmine-3.3.1.orig/config/locales/id.yml
+++ redmine-3.3.1/config/locales/id.yml
@@ -130,6 +130,7 @@ id:
         circular_dependency: "kaitan ini akan menghasilkan circular dependency"
         cant_link_an_issue_with_a_descendant: "An issue can not be linked to one of its subtasks"
         earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
+        open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
 
   actionview_instancetag_blank_option: Silakan pilih
 
Index: redmine-3.3.1/config/locales/it.yml
===================================================================
--- redmine-3.3.1.orig/config/locales/it.yml
+++ redmine-3.3.1/config/locales/it.yml
@@ -135,6 +135,7 @@ it:
         circular_dependency: "Questa relazione creerebbe una dipendenza circolare"
         cant_link_an_issue_with_a_descendant: "Una segnalazione non può essere collegata a una delle sue discendenti"
         earlier_than_minimum_start_date: "non può essere precedente a %{date} a causa di una precedente segnalazione"
+        open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
 
   actionview_instancetag_blank_option: Scegli
 
Index: redmine-3.3.1/config/locales/ja.yml
===================================================================
--- redmine-3.3.1.orig/config/locales/ja.yml
+++ redmine-3.3.1/config/locales/ja.yml
@@ -151,6 +151,7 @@ ja:
         circular_dependency: "この関係では、循環依存になります"
         cant_link_an_issue_with_a_descendant: "親子関係にあるチケット間での関連の設定はできません"
         earlier_than_minimum_start_date: "を%{date}より前にすることはできません。先行するチケットがあります"
+        open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
 
   actionview_instancetag_blank_option: 選んでください
 
Index: redmine-3.3.1/config/locales/ko.yml
===================================================================
--- redmine-3.3.1.orig/config/locales/ko.yml
+++ redmine-3.3.1/config/locales/ko.yml
@@ -177,6 +177,7 @@ ko:
         circular_dependency: "이 관계는 순환 의존관계를 만들 수 있습니다"
         cant_link_an_issue_with_a_descendant: "일감은 하위 일감과 연결할 수 없습니다."
         earlier_than_minimum_start_date: "시작날짜 %{date}보다 앞선 시간으로 설정할 수 없습니다."
+        open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
 
   actionview_instancetag_blank_option: 선택하세요
 
Index: redmine-3.3.1/config/locales/lt.yml
===================================================================
--- redmine-3.3.1.orig/config/locales/lt.yml
+++ redmine-3.3.1/config/locales/lt.yml
@@ -134,6 +134,7 @@ lt:
         circular_dependency: "Šis ryšys sukurtų ciklinę priklausomybę"
         cant_link_an_issue_with_a_descendant: "Darbas negali būti susietas su viena iš savo darbo dalių"
         earlier_than_minimum_start_date: "negali būti anksčiau už %{date} dėl ankstesnių darbų"
+        open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
 
   actionview_instancetag_blank_option: Prašom parinkti
 
Index: redmine-3.3.1/config/locales/lv.yml
===================================================================
--- redmine-3.3.1.orig/config/locales/lv.yml
+++ redmine-3.3.1/config/locales/lv.yml
@@ -124,6 +124,7 @@ lv:
         circular_dependency: "Šī relācija radītu ciklisku atkarību"
         cant_link_an_issue_with_a_descendant: "An issue can not be linked to one of its subtasks"
         earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
+        open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
 
   actionview_instancetag_blank_option: Izvēlieties
 
Index: redmine-3.3.1/config/locales/mk.yml
===================================================================
--- redmine-3.3.1.orig/config/locales/mk.yml
+++ redmine-3.3.1/config/locales/mk.yml
@@ -131,6 +131,7 @@ mk:
         circular_dependency: "Оваа врска ќе креира кружна зависност"
         cant_link_an_issue_with_a_descendant: "Задача неможе да се поврзе со една од нејзините подзадачи"
         earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
+        open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
 
   actionview_instancetag_blank_option: Изберете
 
Index: redmine-3.3.1/config/locales/mn.yml
===================================================================
--- redmine-3.3.1.orig/config/locales/mn.yml
+++ redmine-3.3.1/config/locales/mn.yml
@@ -130,6 +130,7 @@ mn:
         circular_dependency: "Энэ харьцаа нь гинжин(рекурсив) харьцаа үүсгэх юм байна"
         cant_link_an_issue_with_a_descendant: "An issue can not be linked to one of its subtasks"
         earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
+        open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
 
   actionview_instancetag_blank_option: Сонгоно уу
 
Index: redmine-3.3.1/config/locales/nl.yml
===================================================================
--- redmine-3.3.1.orig/config/locales/nl.yml
+++ redmine-3.3.1/config/locales/nl.yml
@@ -128,6 +128,7 @@ nl:
         circular_dependency: "Deze relatie zou een circulaire afhankelijkheid tot gevolg hebben"
         cant_link_an_issue_with_a_descendant: "Een issue kan niet gelinked worden met een subtask"
         earlier_than_minimum_start_date: "kan niet eerder zijn dan %{date} wegens voorafgaande issues"
+        open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
 
   actionview_instancetag_blank_option: Selecteer
 
Index: redmine-3.3.1/config/locales/no.yml
===================================================================
--- redmine-3.3.1.orig/config/locales/no.yml
+++ redmine-3.3.1/config/locales/no.yml
@@ -119,6 +119,7 @@
         circular_dependency: "Denne relasjonen ville lagd en sirkulær avhengighet"
         cant_link_an_issue_with_a_descendant: "En sak kan ikke kobles mot en av sine undersaker"
         earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
+        open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
 
 
   actionview_instancetag_blank_option: Vennligst velg
Index: redmine-3.3.1/config/locales/pl.yml
===================================================================
--- redmine-3.3.1.orig/config/locales/pl.yml
+++ redmine-3.3.1/config/locales/pl.yml
@@ -138,6 +138,7 @@ pl:
         circular_dependency: "Ta relacja może wytworzyć zapętloną zależność"
         cant_link_an_issue_with_a_descendant: "Zagadnienie nie może zostać powiązane z jednym z własnych podzagadnień"
         earlier_than_minimum_start_date: "nie może być wcześniej niż %{date} z powodu poprzedających zagadnień"
+        open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
 
   support:
     array:
Index: redmine-3.3.1/config/locales/pt-BR.yml
===================================================================
--- redmine-3.3.1.orig/config/locales/pt-BR.yml
+++ redmine-3.3.1/config/locales/pt-BR.yml
@@ -150,6 +150,7 @@ pt-BR:
         circular_dependency: "Esta relação geraria uma dependência circular"
         cant_link_an_issue_with_a_descendant: "Uma tarefa não pode ser relaciona a uma de suas subtarefas"
         earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
+        open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
 
   actionview_instancetag_blank_option: Selecione
 
Index: redmine-3.3.1/config/locales/pt.yml
===================================================================
--- redmine-3.3.1.orig/config/locales/pt.yml
+++ redmine-3.3.1/config/locales/pt.yml
@@ -139,6 +139,7 @@ pt:
         circular_dependency: "Esta relação iria criar uma dependência circular"
         cant_link_an_issue_with_a_descendant: "Não é possível ligar uma tarefa a uma sub-tarefa que lhe é pertencente"
         earlier_than_minimum_start_date: "não pode ser antes de %{date} devido a tarefas precedentes"
+        open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
 
   
   actionview_instancetag_blank_option: Selecione
Index: redmine-3.3.1/config/locales/ro.yml
===================================================================
--- redmine-3.3.1.orig/config/locales/ro.yml
+++ redmine-3.3.1/config/locales/ro.yml
@@ -125,6 +125,7 @@ ro:
         circular_dependency: "Această relație ar crea o dependență circulară"
         cant_link_an_issue_with_a_descendant: "An issue can not be linked to one of its subtasks"
         earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
+        open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
 
   actionview_instancetag_blank_option: Selectați
 
Index: redmine-3.3.1/config/locales/ru.yml
===================================================================
--- redmine-3.3.1.orig/config/locales/ru.yml
+++ redmine-3.3.1/config/locales/ru.yml
@@ -207,6 +207,7 @@ ru:
         circular_dependency: "Такая связь приведет к циклической зависимости"
         cant_link_an_issue_with_a_descendant: "Задача не может быть связана со своей подзадачей"
         earlier_than_minimum_start_date: "не может быть раньше %{date} из-за предыдущих задач"
+        open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
 
   support:
     array:
Index: redmine-3.3.1/config/locales/sk.yml
===================================================================
--- redmine-3.3.1.orig/config/locales/sk.yml
+++ redmine-3.3.1/config/locales/sk.yml
@@ -129,6 +129,7 @@ sk:
         circular_dependency: "Tento vzťah by vytvoril cyklickú závislosť"
         cant_link_an_issue_with_a_descendant: "Nemožno prepojiť úlohu s niektorou z podúloh"
         earlier_than_minimum_start_date: "nemôže byť skorší ako %{date} z dôvodu nadväznosti na predchádzajúce úlohy"
+        open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
 
   actionview_instancetag_blank_option: Vyberte
 
Index: redmine-3.3.1/config/locales/sl.yml
===================================================================
--- redmine-3.3.1.orig/config/locales/sl.yml
+++ redmine-3.3.1/config/locales/sl.yml
@@ -129,6 +129,7 @@ sl:
         circular_dependency: "Ta odnos bi povzročil krožno odvisnost"
         cant_link_an_issue_with_a_descendant: "Zahtevek ne more biti povezan s svojo podnalogo"
         earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
+        open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
 
   actionview_instancetag_blank_option: Prosimo izberite
 
Index: redmine-3.3.1/config/locales/sq.yml
===================================================================
--- redmine-3.3.1.orig/config/locales/sq.yml
+++ redmine-3.3.1/config/locales/sq.yml
@@ -130,6 +130,7 @@ sq:
         circular_dependency: "Ky relacion do te krijoje nje varesi ciklike (circular dependency)"
         cant_link_an_issue_with_a_descendant: "Nje ceshtje nuk mund te lidhet me nenceshtje"
         earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
+        open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
 
   actionview_instancetag_blank_option: Zgjidhni
 
Index: redmine-3.3.1/config/locales/sr-YU.yml
===================================================================
--- redmine-3.3.1.orig/config/locales/sr-YU.yml
+++ redmine-3.3.1/config/locales/sr-YU.yml
@@ -133,6 +133,7 @@ sr-YU:
         circular_dependency: "Ova veza će stvoriti kružnu referencu"
         cant_link_an_issue_with_a_descendant: "Problem ne može biti povezan sa jednim od svojih podzadataka"
         earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
+        open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
 
   actionview_instancetag_blank_option: Molim odaberite
 
Index: redmine-3.3.1/config/locales/sr.yml
===================================================================
--- redmine-3.3.1.orig/config/locales/sr.yml
+++ redmine-3.3.1/config/locales/sr.yml
@@ -131,6 +131,7 @@ sr:
         circular_dependency: "Ова веза ће створити кружну референцу"
         cant_link_an_issue_with_a_descendant: "Проблем не може бити повезан са једним од својих подзадатака"
         earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
+        open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
 
   actionview_instancetag_blank_option: Молим одаберите
 
Index: redmine-3.3.1/config/locales/sv.yml
===================================================================
--- redmine-3.3.1.orig/config/locales/sv.yml
+++ redmine-3.3.1/config/locales/sv.yml
@@ -135,6 +135,7 @@ sv:
         circular_dependency: "Denna relation skulle skapa ett cirkulärt beroende"
         cant_link_an_issue_with_a_descendant: "Ett ärende kan inte länkas till ett av dess underärenden"
         earlier_than_minimum_start_date: "kan inte vara tidigare än% {datum} på grund av föregående ärenden"        
+        open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
 
   direction: ltr
   date:
Index: redmine-3.3.1/config/locales/th.yml
===================================================================
--- redmine-3.3.1.orig/config/locales/th.yml
+++ redmine-3.3.1/config/locales/th.yml
@@ -128,6 +128,7 @@ th:
         circular_dependency: "ความสัมพันธ์อ้างอิงเป็นวงกลม"
         cant_link_an_issue_with_a_descendant: "An issue can not be linked to one of its subtasks"
         earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
+        open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
 
   actionview_instancetag_blank_option: กรุณาเลือก
 
Index: redmine-3.3.1/config/locales/tr.yml
===================================================================
--- redmine-3.3.1.orig/config/locales/tr.yml
+++ redmine-3.3.1/config/locales/tr.yml
@@ -144,6 +144,7 @@ tr:
         circular_dependency: "Bu ilişki döngüsel bağımlılık meydana getirecektir"
         cant_link_an_issue_with_a_descendant: "Bir iş, alt işlerinden birine bağlanamaz"
         earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
+        open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
       models:
 
   actionview_instancetag_blank_option: Lütfen Seçin
Index: redmine-3.3.1/config/locales/uk.yml
===================================================================
--- redmine-3.3.1.orig/config/locales/uk.yml
+++ redmine-3.3.1/config/locales/uk.yml
@@ -128,6 +128,7 @@ uk:
         circular_dependency: "Такий зв'язок приведе до циклічної залежності"
         cant_link_an_issue_with_a_descendant: "An issue can not be linked to one of its subtasks"
         earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
+        open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
 
   actionview_instancetag_blank_option: Оберіть
 
Index: redmine-3.3.1/config/locales/vi.yml
===================================================================
--- redmine-3.3.1.orig/config/locales/vi.yml
+++ redmine-3.3.1/config/locales/vi.yml
@@ -145,6 +145,7 @@ vi:
         circular_dependency: "quan hệ có thể gây ra lặp vô tận"
         cant_link_an_issue_with_a_descendant: "Một vấn đề không thể liên kết tới một trong số những tác vụ con của nó"
         earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
+        open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
 
   direction: ltr
   date:
Index: redmine-3.3.1/config/locales/zh-TW.yml
===================================================================
--- redmine-3.3.1.orig/config/locales/zh-TW.yml
+++ redmine-3.3.1/config/locales/zh-TW.yml
@@ -187,6 +187,7 @@
         circular_dependency: "這個關聯會導致環狀相依"
         cant_link_an_issue_with_a_descendant: "議題無法被連結至自己的子任務"
         earlier_than_minimum_start_date: "不能早於 %{date} 因為有前置議題"
+        open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
 
       # You can define own errors for models or model attributes.
       # The values :model, :attribute and :value are always available for interpolation.
Index: redmine-3.3.1/config/locales/zh.yml
===================================================================
--- redmine-3.3.1.orig/config/locales/zh.yml
+++ redmine-3.3.1/config/locales/zh.yml
@@ -134,6 +134,7 @@ zh:
         circular_dependency: "此关联将导致循环依赖"
         cant_link_an_issue_with_a_descendant: "问题不能关联到它的子任务"
         earlier_than_minimum_start_date: "不能早于 %{date} 由于有前置问题"
+        open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
 
   actionview_instancetag_blank_option: 请选择
 
Index: redmine-3.3.1/test/unit/issue_subtasking_test.rb
===================================================================
--- redmine-3.3.1.orig/test/unit/issue_subtasking_test.rb
+++ redmine-3.3.1/test/unit/issue_subtasking_test.rb
@@ -310,4 +310,13 @@ class IssueSubtaskingTest < ActiveSuppor
     parent.generate_child!(:estimated_hours => 7)
     assert_equal 12, parent.reload.total_estimated_hours
   end
+
+  def test_open_issue_with_closed_parent_should_not_validate
+    parent = Issue.generate!(:status_id => 5)
+    child = Issue.generate!
+
+    child.parent_issue_id = parent.id
+    assert !child.save
+    assert_include I18n.t("activerecord.errors.messages.open_issue_with_closed_parent"), child.errors.full_messages
+  end
 end
Index: redmine-3.3.1/test/unit/issue_test.rb
===================================================================
--- redmine-3.3.1.orig/test/unit/issue_test.rb
+++ redmine-3.3.1/test/unit/issue_test.rb
@@ -1948,6 +1948,24 @@ class IssueTest < ActiveSupport::TestCas
     assert !closed_statuses.empty?
   end
 
+  def test_parent_issues_with_open_subtask_dont_allow_closed_statuses
+    parent = Issue.generate!
+    child = Issue.generate!(:parent_issue_id => parent.id)
+
+    allowed_statuses = parent.reload.new_statuses_allowed_to(users(:users_002))
+    assert allowed_statuses.any?
+    assert_equal [], allowed_statuses.select(&:is_closed?)
+  end
+
+  def test_parent_issues_with_closed_subtask_allow_closed_statuses
+    parent = Issue.generate!
+    child = Issue.generate!(:parent_issue_id => parent.id, :status_id => 5)
+
+    allowed_statuses = parent.reload.new_statuses_allowed_to(users(:users_002))
+    assert allowed_statuses.any?
+    assert allowed_statuses.select(&:is_closed?).any?
+  end
+
   def test_reschedule_an_issue_without_dates
     with_settings :non_working_week_days => [] do
       issue = Issue.new(:start_date => nil, :due_date => nil)

Reply via email to