From 163f3de2fa57b95759d42cf8cfbc962a972ac49b Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 19 Mar 2009 15:41:33 +0000 Subject: [PATCH] * Urgh. `-' had special significance in HTML form parameters... --- src/lib/Hydra/Controller/Project.pm | 4 ++-- src/root/project.tt | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/lib/Hydra/Controller/Project.pm b/src/lib/Hydra/Controller/Project.pm index 74fea6e9..d3490636 100644 --- a/src/lib/Hydra/Controller/Project.pm +++ b/src/lib/Hydra/Controller/Project.pm @@ -151,8 +151,8 @@ sub updateProject { , nixexprinput => $nixExprInput }); } else { # it's an existing jobset - $jobset = ($project->jobsets->search({name => $baseName}))[0]; - die unless defined $jobset; + my $oldName = trim $c->request->params->{"jobset-$baseName-oldName"}; + $jobset = ($project->jobsets->search({name => $oldName}))[0] or die; $jobset->update( { name => $jobsetName, description => $description , nixexprpath => $nixExprPath, nixexprinput => $nixExprInput }); diff --git a/src/root/project.tt b/src/root/project.tt index 0537043d..e30927ba 100644 --- a/src/root/project.tt +++ b/src/root/project.tt @@ -67,6 +67,8 @@
+ "jobset-$baseName-oldName", value => jobset.name) %] /> +

[% IF edit %][% END %] [% IF jobset %]Jobset [% jobset.name %][% ELSE %]New jobset[% END %] @@ -250,8 +252,8 @@ [% END %] - [% FOREACH jobset IN project.jobsets -%] - [% INCLUDE renderJobset jobset=jobset baseName=jobset.name %] + [% n = 0; FOREACH jobset IN project.jobsets -%] + [% INCLUDE renderJobset jobset=jobset baseName="e$n"; n = n + 1 %] [% END -%] [% ELSE %]