Quellcode durchsuchen

Show an error message when changing an issue's project fails due to errors in child issues (#23888).

git-svn-id: http://svn.redmine.org/redmine/trunk@16089 e93f8b46-1217-0410-a6f0-8f06a7374b81
tags/3.4.0
Jean-Philippe Lang vor 7 Jahren
Ursprung
Commit
3b7da88a83
5 geänderte Dateien mit 16 neuen und 0 gelöschten Zeilen
  1. 1
    0
      app/models/issue.rb
  2. 1
    0
      config/locales/de.yml
  3. 1
    0
      config/locales/en.yml
  4. 1
    0
      config/locales/fr.yml
  5. 12
    0
      test/unit/issue_test.rb

+ 1
- 0
app/models/issue.rb Datei anzeigen

@@ -1471,6 +1471,7 @@ class Issue < ActiveRecord::Base
# Change project and keep project
child.send :project=, project, true
unless child.save
errors.add :base, l(:error_move_of_child_not_possible, :child => "##{child.id}", :errors => child.errors.full_messages.join(", "))
raise ActiveRecord::Rollback
end
end

+ 1
- 0
config/locales/de.yml Datei anzeigen

@@ -270,6 +270,7 @@ de:
error_unable_to_connect: Fehler beim Verbinden (%{value})
error_workflow_copy_source: Bitte wählen Sie einen Quell-Tracker und eine Quell-Rolle.
error_workflow_copy_target: Bitte wählen Sie die Ziel-Tracker und -Rollen.
error_move_of_child_not_possible: "Unteraufgabe %{child} nicht in das neue Projekt verschoben werden konnten: %{errors}"

field_account: Konto
field_active: Aktiv

+ 1
- 0
config/locales/en.yml Datei anzeigen

@@ -216,6 +216,7 @@ en:
error_ldap_bind_credentials: "Invalid LDAP Account/Password"
error_no_tracker_allowed_for_new_issue_in_project: "The project doesn't have any trackers for which you can create an issue"
error_no_projects_with_tracker_allowed_for_new_issue: "There are no projects with trackers for which you can create an issue"
error_move_of_child_not_possible: "Subtask %{child} could not be moved to the new project: %{errors}"

mail_subject_lost_password: "Your %{value} password"
mail_body_lost_password: 'To change your password, click on the following link:'

+ 1
- 0
config/locales/fr.yml Datei anzeigen

@@ -236,6 +236,7 @@ fr:
error_ldap_bind_credentials: "Identifiant ou mot de passe LDAP incorrect"
error_no_tracker_allowed_for_new_issue_in_project: "Le projet ne dispose d'aucun tracker sur lequel vous pouvez créer une demande"
error_no_projects_with_tracker_allowed_for_new_issue: "Aucun projet ne dispose d'un tracker sur lequel vous pouvez créer une demande"
error_move_of_child_not_possible: "La sous-tâche %{child} n'a pas pu être déplacée dans le nouveau projet : %{errors}"

mail_subject_lost_password: "Votre mot de passe %{value}"
mail_body_lost_password: 'Pour changer votre mot de passe, cliquez sur le lien suivant :'

+ 12
- 0
test/unit/issue_test.rb Datei anzeigen

@@ -1709,6 +1709,18 @@ class IssueTest < ActiveSupport::TestCase
assert_equal 3, issue.tracker_id
end

def test_move_to_another_project_should_set_error_message_on_child_failure
parent = Issue.generate!
child = Issue.generate!(:parent_issue_id => parent.id, :tracker_id => 2)
project = Project.generate!(:tracker_ids => [1])

parent.reload
parent.project_id = project.id
assert !parent.save
assert_include "Subtask ##{child.id} could not be moved to the new project: Tracker is not included in the list",
parent.errors[:base]
end

def test_copy_to_the_same_project
issue = Issue.find(1)
copy = issue.copy

Laden…
Abbrechen
Speichern