diff --git a/lib/RT/Interface/Web.pm b/lib/RT/Interface/Web.pm index 7838f3e0a5a..0e50a3c5364 100644 --- a/lib/RT/Interface/Web.pm +++ b/lib/RT/Interface/Web.pm @@ -3171,6 +3171,115 @@ sub ProcessCustomFieldUpdates { return (@results); } +=head2 ProcessTemplateUpdate ( TemplateObj => $Template, ARGSRef => \%ARGS ); + +Returns an array of results messages. + +=cut + +sub ProcessTemplateUpdate { + my %args = ( + TemplateObj => undef, + ARGSRef => undef, + @_ + ); + + my @results; + my @FIELDS = qw( + PerlCode + Queue + Subject + Status + SLA + Due + Starts + Started + Resolved + Owner + Requestor + Cc + AdminCc + RequestorGroup + CcGroup + AdminCcGroup + TimeWorked + TimeEstimated + TimeLeft + InitialPriority + FinalPriority + Type + DependsOn + DependedOnBy + RefersTo + ReferredToBy + Members + MemberOf + CustomFields + Content + ContentType + UpdateType + SkipCreate + ); + + # ensure $args{ARGSRef}{CreateSectionName} is an array ref + # could be undefined (new template), scalar (single section), or an array ref (multiple sections) + if ( $args{ARGSRef}{CreateSectionName} ) { + $args{ARGSRef}{CreateSectionName} = [ $args{ARGSRef}{CreateSectionName} ] + unless ref $args{ARGSRef}{CreateSectionName}; + } + else { + $args{ARGSRef}{CreateSectionName} = []; + } + + push @{ $args{ARGSRef}{CreateSectionName} }, 'ADD-NEW-SECTION' + if $args{ARGSRef}{AddNewSectionName}; + + if ( @{ $args{ARGSRef}{CreateSectionName} } ) { + my $new_content = ''; + for my $name ( @{ $args{ARGSRef}{CreateSectionName} } ) { + my $template_name = $name eq 'ADD-NEW-SECTION' ? $args{ARGSRef}{AddNewSectionName} : $name; + $new_content .= "===Create-Ticket: $template_name\n"; + for my $field ( @FIELDS ) { + if ( $field eq "CustomFields" ) { + while ( my $cf_id = shift @{ $args{ARGSRef}{ $name . "-CustomField-id" } || [] } ) { + my $cf_val = shift @{ $args{ARGSRef}{ $name . "-CustomField-val" } || [] }; + $new_content .= "CustomField-$cf_id: $cf_val\n"; + } + } + else { + if ( my $val = $args{ARGSRef}{"$name-$field"} ) { + if ( $field eq 'PerlCode' ) { + # trim leading and trailing whitespace + $val =~ s/^\s+//; + $val =~ s/\s+$//; + $new_content .= "{\n$val\n}\n"; + } + elsif ( $field eq 'Content' ) { + $new_content .= "Content: $val\nENDOFCONTENT\n" + } + else { + $new_content .= "$field: $val\n"; + } + } + } + } + } + $args{ARGSRef}{Content} = $new_content; + } + + my @attribs = qw( Name Description Queue Type Content ); + my @aresults = UpdateRecordObject( + AttributesRef => \@attribs, + Object => $args{TemplateObj}, + ARGSRef => $args{ARGSRef} + ); + push @results, @aresults; + + my ( $ok, $msg ) = $args{TemplateObj}->CompileCheck; + push @results, $msg if !$ok; + + return ( @results ); +} =head2 ProcessTicketBasics ( TicketObj => $Ticket, ARGSRef => \%ARGS ); diff --git a/lib/RT/Interface/Web/MenuBuilder.pm b/lib/RT/Interface/Web/MenuBuilder.pm index 82f67b0018c..a5c6437ce17 100644 --- a/lib/RT/Interface/Web/MenuBuilder.pm +++ b/lib/RT/Interface/Web/MenuBuilder.pm @@ -1430,6 +1430,13 @@ sub _BuildAdminMenu { $templates->child( select => title => loc('Select'), path => "/Admin/Queues/Templates.html?id=".$id); $templates->child( create => title => loc('Create'), path => "/Admin/Queues/Template.html?Create=1;Queue=".$id); + if ( $HTML::Mason::Commands::m->request_args->{'Template'} && $HTML::Mason::Commands::m->request_args->{'Template'} =~ /^\d+$/ ) { + my $template_id = $HTML::Mason::Commands::m->request_args->{'Template'}; + $templates->child( basics => title => loc('Basics'), path => "/Admin/Queues/Template.html?Queue=$id&Template=$template_id" ); + $templates->child( content => title => loc('Content'), path => "/Admin/Queues/Template.html?Queue=$id&ContentTab=1&Template=$template_id" ); + $templates->child( advanced => title => loc('Advanced'), path => "/Admin/Queues/Template.html?Queue=$id&AdvancedTab=1&Template=$template_id" ); + } + my $scrips = $queue->child( scrips => title => loc('Scrips'), path => "/Admin/Queues/Scrips.html?id=" . $id); $scrips->child( select => title => loc('Select'), path => "/Admin/Queues/Scrips.html?id=" . $id ); $scrips->child( create => title => loc('Create'), path => "/Admin/Scrips/Create.html?Queue=" . $id); @@ -1655,8 +1662,21 @@ sub _BuildAdminMenu { } if ( $request_path =~ m{^/Admin/Global/Templates?\.html} ) { - $page->child( select => title => loc('Select'), path => "/Admin/Global/Templates.html" ); - $page->child( create => title => loc('Create'), path => "/Admin/Global/Template.html?Create=1" ); + if ( $HTML::Mason::Commands::m->request_args->{'Template'} && $HTML::Mason::Commands::m->request_args->{'Template'} =~ /^\d+$/ ) { + my $id = $HTML::Mason::Commands::m->request_args->{'Template'}; + my $queue = $HTML::Mason::Commands::m->request_args->{'Queue'} || 0; + my $templates = $page->child( select => title => loc('Templates'), + path => "/Admin/Global/Templates.html" ); + $templates->child( select => title => loc('Select'), path => "/Admin/Global/Templates.html" ); + $templates->child( create => title => loc('Create'), path => "/Admin/Global/Template.html?Create=1" ); + $page->child( basics => title => loc('Basics'), path => "/Admin/Global/Template.html?Queue=$queue&Template=$id" ); + $page->child( content => title => loc('Content'), path => "/Admin/Global/Template.html?Queue=$queue&ContentTab=1&Template=$id" ); + $page->child( advanced => title => loc('Advanced'), path => "/Admin/Global/Template.html?Queue=$queue&AdvancedTab=1&Template=$id" ); + } + else { + $page->child( select => title => loc('Select'), path => "/Admin/Global/Templates.html" ); + $page->child( create => title => loc('Create'), path => "/Admin/Global/Template.html?Create=1" ); + } } if ( $request_path =~ m{^/Admin/Articles/Classes/} ) { diff --git a/share/html/Admin/Elements/ModifyCreateTemplate b/share/html/Admin/Elements/ModifyCreateTemplate new file mode 100644 index 00000000000..38b129c60d9 --- /dev/null +++ b/share/html/Admin/Elements/ModifyCreateTemplate @@ -0,0 +1,528 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2023 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% if ( @sections ) { + +
+% for my $template ( @sections ) { +
{name} %>"> +<&| /Widgets/TitleBox, title => loc("Perl Code"), class=>'ticket-info-basics' &> +% if ( $template->{name} eq 'ADD-NEW-SECTION' ) { + <&| /Elements/LabeledValue, Label => loc('Section Name'), Class => 'edit-custom-field' &> +
+
+ +
+
+ +% } +% else { + +% } + + <&| /Elements/LabeledValue, Label => loc('Perl Code'), Class => 'edit-custom-field' &> +
+
+% my $perlcode = $template->{perlcode} || ''; +% $perlcode =~ s/^\s?{//; +% $perlcode =~ s/}\s?$//; + +
+
+ + + <&| /Elements/LabeledValue, Label => loc('Skip Create'), Class => 'edit-custom-field' &> +
+
+ +
+
+ + + +<&| /Widgets/TitleBox, title => loc("Content"), class=>'ticket-info-basics' &> + <&| /Elements/LabeledValue, Label => loc('Update Type'), Class => 'edit-custom-field' &> +
+
+ +
+
+ + + <&| /Elements/LabeledValue, Label => loc('Content Type'), Class => 'edit-custom-field' &> +
+
+ +
+
+ + + <&| /Elements/LabeledValue, Label => loc('Content'), Class => 'edit-custom-field' &> +
+
+ +
+
+ + + +
+
+<&| /Widgets/TitleBox, title => loc("The Basics"), class=>'ticket-info-basics' &> + <&| /Elements/LabeledValue, Label => loc('Type'), Class => 'edit-custom-field' &> +
+
+ +
+
+ + + <&| /Elements/LabeledValue, Label => loc('Subject'), Class => 'edit-custom-field' &> +
+
+ +
+
+ + + <&| /Elements/LabeledValue, Label => loc('Status'), Class => 'edit-custom-field' &> +
+
+ +
+
+ + + <&| /Elements/LabeledValue, Label => loc('Queue'), Class => 'edit-custom-field' &> +
+
+ +
+
+ + + <&| /Elements/LabeledValue, Label => loc('SLA'), Class => 'edit-custom-field' &> +
+
+ +
+
+ + + <&| /Elements/LabeledValue, Label => loc('Time Estimated'), Class => 'edit-custom-field' &> +
+
+ +
+
+ + + <&| /Elements/LabeledValue, Label => loc('Time Worked'), Class => 'edit-custom-field' &> +
+
+ +
+
+ + + <&| /Elements/LabeledValue, Label => loc('Time Left'), Class => 'edit-custom-field' &> +
+
+ +
+
+ + + <&| /Elements/LabeledValue, Label => loc('Initial Priority'), Class => 'edit-custom-field' &> +
+
+ +
+
+ + + <&| /Elements/LabeledValue, Label => loc('Final Priority'), Class => 'edit-custom-field' &> +
+
+ +
+
+ + + +<&| /Widgets/TitleBox, title => loc("People"), class=>'ticket-info-people' &> + <&| /Elements/LabeledValue, Label => loc('Owner'), Class => 'edit-custom-field' &> +
+
+ +
+
+ + + <&| /Elements/LabeledValue, Label => loc('Requestor'), Class => 'edit-custom-field' &> +
+
+ +
+
+ + + <&| /Elements/LabeledValue, Label => loc('Cc'), Class => 'edit-custom-field' &> +
+
+ +
+
+ + + <&| /Elements/LabeledValue, Label => loc('Admin Cc'), Class => 'edit-custom-field' &> +
+
+ +
+
+ + + <&| /Elements/LabeledValue, Label => loc('Requestor Group'), Class => 'edit-custom-field' &> +
+
+ +
+
+ + + <&| /Elements/LabeledValue, Label => loc('Cc Group'), Class => 'edit-custom-field' &> +
+
+ +
+
+ + + <&| /Elements/LabeledValue, Label => loc('Admin Cc Group'), Class => 'edit-custom-field' &> +
+
+ +
+
+ + +
+
+<&| /Widgets/TitleBox, title => loc("Dates"), class=>'ticket-info-dates' &> + <&| /Elements/LabeledValue, Label => loc('Starts'), Class => 'edit-custom-field' &> +
+
+ +
+
+ + + <&| /Elements/LabeledValue, Label => loc('Started'), Class => 'edit-custom-field' &> +
+
+ +
+
+ + + <&| /Elements/LabeledValue, Label => loc('Due'), Class => 'edit-custom-field' &> +
+
+ +
+
+ + + <&| /Elements/LabeledValue, Label => loc('Resolved'), Class => 'edit-custom-field' &> +
+
+ +
+
+ + + +<&| /Widgets/TitleBox, title => loc("Links"), class=>'ticket-info-links' &> + <&| /Elements/LabeledValue, Label => loc('Depends On'), Class => 'edit-custom-field' &> +
+
+ +
+
+ + + <&| /Elements/LabeledValue, Label => loc('Depended On By'), Class => 'edit-custom-field' &> +
+
+ +
+
+ + + <&| /Elements/LabeledValue, Label => loc('Refers To'), Class => 'edit-custom-field' &> +
+
+ +
+
+ + + <&| /Elements/LabeledValue, Label => loc('Referred To By'), Class => 'edit-custom-field' &> +
+
+ +
+
+ + + <&| /Elements/LabeledValue, Label => loc('Members (Children)'), Class => 'edit-custom-field' &> +
+
+ +
+
+ + + <&| /Elements/LabeledValue, Label => loc('Member Of (Parents)'), Class => 'edit-custom-field' &> +
+
+ +
+
+ + + +<&| /Widgets/TitleBox, title => loc("Custom Fields"), class=>'ticket-info-cfs' &> + <&| /Elements/LabeledValue, Label => loc('Custom Fields'), Class => 'edit-custom-field' &> +
+% foreach my $cf ( @{ $template->{CustomFields} || [] } ) { +% my ( $cf_id, $value ) = @$cf; +
+
+ +
+
+ +
+
+ +
+
+% } + +
+
+
+ " onclick="AddCustomField('<% $template->{name} %>'); return false;"> +
+
+ +
+
+% unless ( $template->{name} eq 'ADD-NEW-SECTION' ) { +
+ +
+% } +
+% } +
+% } + + +<%INIT> +my ( $template_object, @sections, $Template ); +if ( $TemplateObj && $TemplateObj->Id ) { + $template_object = RT::Template->new( RT->SystemUser ); + if ( $QueueObj ) { + $template_object->LoadQueueTemplate( Queue => $QueueObj->id, Name => $TemplateObj->Name ); + } + else { + $template_object->LoadGlobalTemplate( $TemplateObj->Name ); + } + + $Template = $template_object->Name; + + if ( $template_object->id ) { + my $content = $template_object->Content || ''; + if ( substr( $content, 0, 3 ) eq '===' ) { + + # parse the content and load gui controls + my ( $current_ticket, %current_section ); + my @lines = split /\n/, $content; + while ( my $line = shift @lines ) { + if ( $line =~ /^===(.*)-Ticket: (.*)$/ ) { + # TODO: do we need to do anything different for different ticket action? + # Create vs Update vs Base + my $ticket_action = $1; + my $ticket_name = $2; + + if ( ! $current_ticket ) { + # first ticket template + $current_ticket = $ticket_name; + $current_section{name} = $ticket_name; + $current_section{action} = $ticket_action; + $current_section{active} = 1; + } + elsif ( $ticket_name ne $current_ticket ) { + # new ticket template + push @sections, { %current_section }; + %current_section = (); + $current_ticket = $ticket_name; + $current_section{name} = $ticket_name; + $current_section{action} = $ticket_action; + } + } + elsif ( $line =~ /^===#.*$/ ) { # a comment + next; + } + elsif ( $line =~ /^(.*?):(?:\s+)(.*?)(?:\s*)$/ ) { + my $tag = $1; + my $val = $2; + + $tag =~ s/-//g; + # standardize on lc tag + $tag = lc $tag; + + if ( $tag eq 'content' ) { + while ( defined( my $l = shift @lines ) ) { + last if ( $l =~ /^ENDOFCONTENT\s*$/ ); + $val .= "\n" . $l; + } + $current_section{$tag} = $val; + } + elsif ( $tag =~ /(CustomField|CF)(.*)/i ) { + $current_section{CustomFields} = [] + unless $current_section{CustomFields}; + push @{ $current_section{CustomFields} }, [ $2, $val ]; + } + else { + $current_section{$tag} = $val; + } + } + else { + $current_section{perlcode} .= "$line\n"; + } + } + # push the last template on to array + push @sections, { %current_section }; + } + elsif ( $content ) { + RT->Logger->error( "'$Template' is not a Create Tickets template." ); + } + } + else { + RT->Logger->error( "Couldn't load template '$Template'" ); + + $template_object = undef; + } + + # add a blank section for new templates or for adding a new ticket section + push @sections, { name => 'ADD-NEW-SECTION', active => ( @sections ? 0 : 1 ) }; +} + +<%ARGS> +$TemplateObj => undef +$QueueObj => undef + diff --git a/share/html/Admin/Elements/ModifyTemplate b/share/html/Admin/Elements/ModifyTemplate index 53ddc794ccc..c50e191de49 100644 --- a/share/html/Admin/Elements/ModifyTemplate +++ b/share/html/Admin/Elements/ModifyTemplate @@ -46,63 +46,81 @@ %# %# END BPS TAGGED BLOCK }}} <&| /Widgets/TitleBox, class => 'template-info-basics', content_class => 'mx-auto width-lg' &> -
-
- <&|/l&>Name: -
-
- -
-
- -
-
- <&|/l&>Description: -
-
- +% if ( $BasicsTab ) { +
+
+ <&|/l&>Name: +
+
+ +
-
- -
-
- <&|/l&>Type: +
+
+ <&|/l&>Description: +
+
+ +
-
-
- > -
+
+
+ <&|/l&>Type:
-
- > -
+
+
+ > +
+
+
+ > +
+
+
+ > +
+
-
- +% } +% else { + + + +% }
+% if ( $ContentTab && ( $Type eq 'Create' ) ) { +
+ <& /Admin/Elements/ModifyCreateTemplate, + TemplateObj => $TemplateObj, + QueueObj => $QueueObj, + &> +
+% } +% elsif ( $ContentTab || $AdvancedTab ) {
<&|/l&>Content:
- +
+% }
- <%INIT> - unless ($Type) { $Type = $session{'CurrentUser'}->HasRight(Right => 'ExecuteCode', Object => $RT::System) ? 'Perl' : 'Simple'; } - +my $BasicsTab = ( $ContentTab || $AdvancedTab ) ? 0 : 1; - <%ARGS> $Name => '' $Description => '' $Content => '' $Type => '' +$TemplateObj => undef +$QueueObj => undef +$ContentTab => '' +$AdvancedTab => '' diff --git a/share/html/Admin/Global/Template.html b/share/html/Admin/Global/Template.html index dedc21cc024..8a5f1536d1c 100644 --- a/share/html/Admin/Global/Template.html +++ b/share/html/Admin/Global/Template.html @@ -56,13 +56,18 @@ % } -%# hang onto the queue id +%# hang onto the queue id and tab setting + + <& /Admin/Elements/ModifyTemplate, Name => $TemplateObj->Name // $ARGS{Name}, Description => $TemplateObj->Description // $ARGS{Description}, Content => $TemplateObj->Content // $ARGS{Content}, Type => $TemplateObj->Type // $ARGS{Type}, + TemplateObj => $TemplateObj, + ContentTab => $ContentTab, + AdvancedTab => $AdvancedTab, &>
@@ -86,15 +91,18 @@ } } -if ($TemplateObj->Id()) { - my @attribs = qw( Name Description Queue Type Content ); - my @aresults = UpdateRecordObject( AttributesRef => \@attribs, - Object => $TemplateObj, - ARGSRef => \%ARGS); - push @results, @aresults; +if ( $TemplateObj->Id() ) { + push @results, ProcessTemplateUpdate( TemplateObj => $TemplateObj, ARGSRef => \%ARGS ); - my ($ok, $msg) = $TemplateObj->CompileCheck; - push @results, $msg if !$ok; + # if this was a new template need to reload the page so the Basics, Content, and Advanced menu options show + if ( defined($Template) && $Template eq 'new' ) { + my $request_path = $HTML::Mason::Commands::r->path_info; + MaybeRedirectForResults( + Actions => \@results, + Path => $request_path, + Arguments => { Queue => 0, Template => $TemplateObj->Id, ContentTab => 1, }, + ); + } } else { $Create = 1; } @@ -113,6 +121,8 @@ $Queue => '' $Template => '' $Create => '' +$ContentTab => '' +$AdvancedTab => '' $Name => '' $Type => '' diff --git a/share/html/Admin/Global/Templates.html b/share/html/Admin/Global/Templates.html index 2e2a88ea086..4f00b597da0 100644 --- a/share/html/Admin/Global/Templates.html +++ b/share/html/Admin/Global/Templates.html @@ -48,7 +48,6 @@ <& /Admin/Elements/Header, Title => $title, FeedURI => 'templates' &> <& /Elements/Tabs &> <& /Admin/Elements/EditTemplates, title => $title, %ARGS &> - <%init> my $title = loc("Modify templates which apply to all queues"); my (@actions); diff --git a/share/html/Admin/Queues/Template.html b/share/html/Admin/Queues/Template.html index 86b17596342..e6941a6edf1 100644 --- a/share/html/Admin/Queues/Template.html +++ b/share/html/Admin/Queues/Template.html @@ -56,13 +56,19 @@ % } -%# hang onto the queue id +%# hang onto the queue id and tab setting + + <& /Admin/Elements/ModifyTemplate, Name => $TemplateObj->Name // $ARGS{Name}, Description => $TemplateObj->Description // $ARGS{Description}, Content => $TemplateObj->Content // $ARGS{Content}, Type => $TemplateObj->Type // $ARGS{Type}, + TemplateObj => $TemplateObj, + QueueObj => $QueueObj, + ContentTab => $ContentTab, + AdvancedTab => $AdvancedTab, &>
@@ -95,15 +101,17 @@ $Queue = $TemplateObj->Queue; $QueueObj = $TemplateObj->QueueObj; - my @attribs = qw( Name Description Queue Type Content ); - my @aresults = UpdateRecordObject( AttributesRef => \@attribs, - Object => $TemplateObj, - ARGSRef => \%ARGS - ); - push @results, @aresults; + push @results, ProcessTemplateUpdate( TemplateObj => $TemplateObj, ARGSRef => \%ARGS ); - my ( $ok, $msg ) = $TemplateObj->CompileCheck; - push @results, $msg if !$ok; + # if this was a new template need to reload the page so the Basics, Content, and Advanced menu options show + if ( $Template eq 'new' ) { + my $request_path = $HTML::Mason::Commands::r->path_info; + MaybeRedirectForResults( + Actions => \@results, + Path => $request_path, + Arguments => { Queue => $QueueObj->id, Template => $TemplateObj->Id, ContentTab => 1, }, + ); + } } else { $Create = 1; $QueueObj = RT::Queue->new( $session{'CurrentUser'} ); @@ -124,6 +132,8 @@ $Queue => '' $Template => '' $Create => undef +$ContentTab => '' +$AdvancedTab => '' $Name => undef $Type => undef diff --git a/t/web/html_template.t b/t/web/html_template.t index abb895c75a5..7d071da3702 100644 --- a/t/web/html_template.t +++ b/t/web/html_template.t @@ -15,6 +15,7 @@ my $content = Encode::decode("UTF-8", "测试"); { $m->follow_link_ok( { id => 'admin-global-templates' }, '-> Templates' ); $m->follow_link_ok( { text => 'Autoreply in HTML' }, '-> Autoreply in HTML' ); + $m->follow_link_ok( { text => 'Content' }, '-> Content' ); $m->submit_form( form_name => 'ModifyTemplate', diff --git a/t/web/template.t b/t/web/template.t index 4bca733c65b..69a570fef9b 100644 --- a/t/web/template.t +++ b/t/web/template.t @@ -60,10 +60,12 @@ $m->form_name('ModifyTemplate'); is($m->value('Type'), 'Perl', 'now that we have ExecuteCode we can update Type to Perl'); { # 21152: Each time you save a Template a newline is chopped off the front + # go to Content tab + $m->follow_link( text => 'Content' ); + $m->form_name('ModifyTemplate'); my $content; - TODO: { local $TODO = "WWW::Mechanize doesn't strip newline following