[Rt-commit] rt branch, 4.6/article-refactor, created. rt-4.4.3-73-g930da784c

? sunnavy sunnavy at bestpractical.com
Tue Nov 6 17:22:19 EST 2018


The branch, 4.6/article-refactor has been created
        at  930da784cab2dc974a8295c51bd7493396c446a7 (commit)

- Log -----------------------------------------------------------------
commit cfb23fd157164583982daf30aa3a024ca3d8f073
Author: craig Kaiser <craig at bestpractical.com>
Date:   Wed Feb 21 14:35:54 2018 -0500

    Add default value for Articles in Queues
    
    Automatically add default article content to tickets on create for queue.

diff --git a/lib/RT/Queue.pm b/lib/RT/Queue.pm
index b9eaec302..5b1008bcf 100644
--- a/lib/RT/Queue.pm
+++ b/lib/RT/Queue.pm
@@ -1185,6 +1185,29 @@ sub SetDefaultValue {
         $new_value = $self->loc( '(no value)' );
     }
 
+    if ( $args{Name} eq 'Article' && $args{Value} ) {
+        my $article = RT::Article->new($self->CurrentUser);
+        my ($ret, $msg);
+        if ( $args{Value} =~ /^\d+$/ ) {
+            ($ret, $msg) = $article->Load( $args{Value} );
+        }
+        else {
+            ($ret, $msg) = $article->LoadByCols( Name => $args{Value} );
+        }
+        return ($ret, $msg ) unless $ret;
+
+        $args{Value} = $article->Id;
+        $new_value = $article->Name;
+    }
+
+    if ( $args{Name} eq 'Article' && $old_value =~ /^\d+$/ ) {
+        my $article = RT::Article->new($self->CurrentUser);
+        my ($ret, $msg) = $article->Load( $old_value );
+        if ($ret) {
+            $old_value = $article->Name;
+        }
+    }
+
     return 1 if $new_value eq $old_value;
 
     my ($ret, $msg) = $self->SetAttribute(
diff --git a/share/html/Admin/Queues/DefaultValues.html b/share/html/Admin/Queues/DefaultValues.html
index 636be3ea7..e13367e58 100644
--- a/share/html/Admin/Queues/DefaultValues.html
+++ b/share/html/Admin/Queues/DefaultValues.html
@@ -71,6 +71,11 @@
         Grouping => 'Basics',
         InTable => 1,
     &>
+
+    <tr><td class="label"><&|/l&>Article</&>:</td>
+        <td><& /Elements/SelectArticle, QueueObj => $queue, Default => $queue->DefaultValue('Article'), Name => 'Article' &>
+    </td></tr>
+
     </table>
     </&>
 </div>
@@ -149,7 +154,7 @@ if ( $ARGS{Reset} ) {
     }
 }
 elsif ( $ARGS{Update} ) {
-    for my $field ( qw/InitialPriority FinalPriority Starts Due/ ) {
+    for my $field ( qw/InitialPriority FinalPriority Starts Due Article/ ) {
         my ($ret, $msg) = $queue->SetDefaultValue(
             Name => $field,
             Value => $ARGS{$field},
diff --git a/share/html/Articles/Elements/IncludeArticle b/share/html/Articles/Elements/IncludeArticle
index 0d217ee51..d69ddce7a 100644
--- a/share/html/Articles/Elements/IncludeArticle
+++ b/share/html/Articles/Elements/IncludeArticle
@@ -48,6 +48,7 @@
 <%INIT>
 
 my $parent_args = $m->caller_args(-1);
+my @articles;
 
 my $name_prefix = '';
 $name_prefix = $ARGS{'Name'} .'-'
@@ -55,18 +56,18 @@ $name_prefix = $ARGS{'Name'} .'-'
     && grep rindex($_, "$ARGS{'Name'}-Articles-", 0) == 0,
         keys %$parent_args;
 
+my $Ticket = $ARGS{Ticket};
+if ( !$Ticket and $parent_args->{id} and $parent_args->{id} ne 'new' ) {
+    $Ticket = RT::Ticket->new($session{'CurrentUser'});
+    $Ticket->Load($parent_args->{id});
+    unless ( $Ticket->id ) {
+        $RT::Logger->error("Couldn't load ticket ". $parent_args->{id} )
+    }
+}
+
 foreach my $arg ( keys %$parent_args ) {
     next if $name_prefix && substr($arg, 0, length($name_prefix)) ne $name_prefix;
 
-    my $Ticket = $ARGS{Ticket};
-    if ( !$Ticket and $parent_args->{id} and $parent_args->{id} ne 'new' ) {
-        $Ticket = RT::Ticket->new($session{'CurrentUser'});
-        $Ticket->Load($parent_args->{id});
-        unless ( $Ticket->id ) {
-            $RT::Logger->error("Couldn't load ticket ". $parent_args->{id} )
-        }
-    }
-
     my $Queue = RT::Queue->new($session{CurrentUser});
     if ($Ticket && $Ticket->Id) {
         $Queue = $Ticket->QueueObj;
@@ -79,7 +80,26 @@ foreach my $arg ( keys %$parent_args ) {
         Queue => $Queue->Id,
     );
     next unless $article && $article->id;
+    push (@articles, $article);
+}
+
+if ( !@articles && ( !$parent_args->{id} || $parent_args->{id} eq 'new' ) && $parent_args->{'Queue'} ) {
+    my $queue_id = $parent_args->{'Queue'};
+    my $QueueObj = RT::Queue->new($session{'CurrentUser'});
+    my ($ret, $msg) = $QueueObj->Load( $queue_id );
+    $RT::Logger->error($msg) unless ($ret);
+
+    if ( $QueueObj->id && $QueueObj->DefaultValue('Article') ) {
+        my $article = RT::Article->new($session{'CurrentUser'});
+        my ($ret, $msg) = $article->Load( $QueueObj->DefaultValue('Article') );
+        $RT::Logger->error($msg) unless ($ret);
+        if ($ret) {
+            push (@articles, $article);
+        }
+    }
+}
 
+foreach my $article (@articles) {
     my $formatted_article = $m->scomp('/Articles/Article/Elements/Preformatted',
         Article => $article, Ticket => $Ticket
     );
diff --git a/share/html/Articles/Elements/IncludeArticle b/share/html/Elements/SelectArticle
similarity index 56%
copy from share/html/Articles/Elements/IncludeArticle
copy to share/html/Elements/SelectArticle
index 0d217ee51..0354837a8 100644
--- a/share/html/Articles/Elements/IncludeArticle
+++ b/share/html/Elements/SelectArticle
@@ -45,55 +45,43 @@
 %# those contributions and any derivatives thereof.
 %#
 %# END BPS TAGGED BLOCK }}}
-<%INIT>
-
-my $parent_args = $m->caller_args(-1);
-
-my $name_prefix = '';
-$name_prefix = $ARGS{'Name'} .'-'
-    if $ARGS{'Name'}
-    && grep rindex($_, "$ARGS{'Name'}-Articles-", 0) == 0,
-        keys %$parent_args;
 
-foreach my $arg ( keys %$parent_args ) {
-    next if $name_prefix && substr($arg, 0, length($name_prefix)) ne $name_prefix;
+<select name="<% $Name %>">
+<option value="">-</option>
+% while (my $article = $articles->Next) {
+<option <% ( $article->Name eq $Default) ? qq[ selected="selected"] : '' |n %>
+    value="<%$article->Id%>"
+><% $article->Name %></option>
+% }
+</select>
 
-    my $Ticket = $ARGS{Ticket};
-    if ( !$Ticket and $parent_args->{id} and $parent_args->{id} ne 'new' ) {
-        $Ticket = RT::Ticket->new($session{'CurrentUser'});
-        $Ticket->Load($parent_args->{id});
-        unless ( $Ticket->id ) {
-            $RT::Logger->error("Couldn't load ticket ". $parent_args->{id} )
-        }
-    }
-
-    my $Queue = RT::Queue->new($session{CurrentUser});
-    if ($Ticket && $Ticket->Id) {
-        $Queue = $Ticket->QueueObj;
-    }
+<%INIT>
+my $articles = RT::Articles->new( $session{'CurrentUser'} );
+$articles->LimitAppliedClasses( Queue => $QueueObj );
 
-    my $article = RT::Article->new($session{'CurrentUser'});
-    $article->LoadByInclude(
-        Field => substr($arg, length($name_prefix)),
-        Value => $parent_args->{$arg},
-        Queue => $Queue->Id,
-    );
-    next unless $article && $article->id;
+my $dropdown_limit = RT->Config->Get( 'DropdownMenuLimit' ) || 50;
+$m->callback( CallbackName => 'ModifyDropdownLimit', DropdownLimit => \$dropdown_limit );
 
-    my $formatted_article = $m->scomp('/Articles/Article/Elements/Preformatted',
-        Article => $article, Ticket => $Ticket
-    );
+my $autocomplete =  $articles->Count > $dropdown_limit ? 1 : 0;
 
-    $m->callback( Article => $article, Ticket => $Ticket, formatted_article => \$formatted_article );
+if ( $Default and $Default =~ /^\d+$/ ){
+    # We got an id, look up the name
+    my $default_article = RT::Article->new($session{'CurrentUser'});
+    my ($ret, $msg) = $default_article->Load( $Default );
 
-    if (RT->Config->Get('MessageBoxRichText',  $session{'CurrentUser'})) {
-        $formatted_article =~ s/>/>/g;
-        $formatted_article =~ s/</</g;
-        $formatted_article =~ s/&/&/g;
-        $formatted_article =~ s/\n/\n<br \/>/g;
+    if ($ret) {
+         $Default = $default_article->Name;
+    }
+    else {
+        RT::Logger->error("Unable to load article $Default: $msg");
     }
-    $m->print($formatted_article);
-
 }
-return;
+
+$Default //= '';
 </%INIT>
+
+<%ARGS>
+$QueueObj
+$Name => 'Article'
+$Default => ''
+</%ARGS>

commit a287e701f9d45681244b7cbd123ebd38720608fe
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Sun Jun 24 12:14:00 2018 -0400

    Add autocomplete for articles

diff --git a/share/html/Elements/SelectArticle b/share/html/Elements/SelectArticle
index 0354837a8..b65116f7b 100644
--- a/share/html/Elements/SelectArticle
+++ b/share/html/Elements/SelectArticle
@@ -46,6 +46,9 @@
 %#
 %# END BPS TAGGED BLOCK }}}
 
+% if ( $autocomplete ) {
+<& "SelectArticleAutocomplete", QueueObj => $QueueObj, Default => $Default, Name => $Name &>
+% } else {
 <select name="<% $Name %>">
 <option value="">-</option>
 % while (my $article = $articles->Next) {
@@ -54,6 +57,7 @@
 ><% $article->Name %></option>
 % }
 </select>
+% }
 
 <%INIT>
 my $articles = RT::Articles->new( $session{'CurrentUser'} );
diff --git a/share/html/Elements/SelectArticle b/share/html/Elements/SelectArticleAutocomplete
similarity index 67%
copy from share/html/Elements/SelectArticle
copy to share/html/Elements/SelectArticleAutocomplete
index 0354837a8..6b92e386e 100644
--- a/share/html/Elements/SelectArticle
+++ b/share/html/Elements/SelectArticleAutocomplete
@@ -45,43 +45,10 @@
 %# those contributions and any derivatives thereof.
 %#
 %# END BPS TAGGED BLOCK }}}
-
-<select name="<% $Name %>">
-<option value="">-</option>
-% while (my $article = $articles->Next) {
-<option <% ( $article->Name eq $Default) ? qq[ selected="selected"] : '' |n %>
-    value="<%$article->Id%>"
-><% $article->Name %></option>
-% }
-</select>
-
-<%INIT>
-my $articles = RT::Articles->new( $session{'CurrentUser'} );
-$articles->LimitAppliedClasses( Queue => $QueueObj );
-
-my $dropdown_limit = RT->Config->Get( 'DropdownMenuLimit' ) || 50;
-$m->callback( CallbackName => 'ModifyDropdownLimit', DropdownLimit => \$dropdown_limit );
-
-my $autocomplete =  $articles->Count > $dropdown_limit ? 1 : 0;
-
-if ( $Default and $Default =~ /^\d+$/ ){
-    # We got an id, look up the name
-    my $default_article = RT::Article->new($session{'CurrentUser'});
-    my ($ret, $msg) = $default_article->Load( $Default );
-
-    if ($ret) {
-         $Default = $default_article->Name;
-    }
-    else {
-        RT::Logger->error("Unable to load article $Default: $msg");
-    }
-}
-
-$Default //= '';
-</%INIT>
+<input data-autocomplete="Articles" <% $QueueObj && $QueueObj->id ? q{data-autocomplete-queue="} . $QueueObj->id . q{"} : '' |n %> data-autocomplete-return="Name" name="<% $Name %>" value="<% $Default %>">
 
 <%ARGS>
-$QueueObj
+$QueueObj => undef
+$Default => undef
 $Name => 'Article'
-$Default => ''
 </%ARGS>
diff --git a/share/html/Elements/SelectArticle b/share/html/Helpers/Autocomplete/Articles
similarity index 63%
copy from share/html/Elements/SelectArticle
copy to share/html/Helpers/Autocomplete/Articles
index 0354837a8..45da288b0 100644
--- a/share/html/Elements/SelectArticle
+++ b/share/html/Helpers/Autocomplete/Articles
@@ -45,43 +45,50 @@
 %# those contributions and any derivatives thereof.
 %#
 %# END BPS TAGGED BLOCK }}}
-
-<select name="<% $Name %>">
-<option value="">-</option>
-% while (my $article = $articles->Next) {
-<option <% ( $article->Name eq $Default) ? qq[ selected="selected"] : '' |n %>
-    value="<%$article->Id%>"
-><% $article->Name %></option>
-% }
-</select>
-
+% $r->content_type('application/json; charset=utf-8');
+<% JSON( \@suggestions ) |n %>
+% $m->abort;
+<%ARGS>
+$term       => undef
+$max        => 10
+$op         => 'STARTSWITH'
+$right      => undef
+$return     => 'Name'
+$queue      => undef
+</%ARGS>
 <%INIT>
-my $articles = RT::Articles->new( $session{'CurrentUser'} );
-$articles->LimitAppliedClasses( Queue => $QueueObj );
+# Only allow certain return fields
+$return = 'Name'
+    unless $return =~ /^(?:id|Name)$/;
 
-my $dropdown_limit = RT->Config->Get( 'DropdownMenuLimit' ) || 50;
-$m->callback( CallbackName => 'ModifyDropdownLimit', DropdownLimit => \$dropdown_limit );
+$m->abort unless defined $return
+             and defined $term
+             and length $term;
 
-my $autocomplete =  $articles->Count > $dropdown_limit ? 1 : 0;
+# Sanity check the operator
+$op = 'STARTSWITH' unless $op =~ /^(?:LIKE|(?:START|END)SWITH|=|!=)$/i;
 
-if ( $Default and $Default =~ /^\d+$/ ){
-    # We got an id, look up the name
-    my $default_article = RT::Article->new($session{'CurrentUser'});
-    my ($ret, $msg) = $default_article->Load( $Default );
+$m->callback( CallbackName => 'ModifyMaxResults', max => \$max );
 
-    if ($ret) {
-         $Default = $default_article->Name;
-    }
-    else {
-        RT::Logger->error("Unable to load article $Default: $msg");
-    }
+my $articles = RT::Articles->new( $session{CurrentUser} );
+if( $queue ) {
+    $articles->LimitAppliedClasses( Queue => $queue );
 }
 
-$Default //= '';
-</%INIT>
+$articles->RowsPerPage( $max );
+$articles->Limit(
+    FIELD           => 'Name',
+    OPERATOR        => $op,
+    VALUE           => $term,
+    ENTRYAGGREGATOR => 'OR',
+    CASESENSITIVE   => 0,
+);
 
-<%ARGS>
-$QueueObj
-$Name => 'Article'
-$Default => ''
-</%ARGS>
+my @suggestions;
+while (my $a = $articles->Next) {
+    next if $right and not $a->CurrentUserHasRight($right);
+    my $value = $a->$return;
+    push @suggestions, { label => $a->Name, value => $value };
+    $m->callback( CallbackName => "ModifySuggestion", suggestions => @suggestions, label => $a );
+}
+</%INIT>
diff --git a/share/static/js/autocomplete.js b/share/static/js/autocomplete.js
index cd8ab2b0d..c4362edb1 100644
--- a/share/static/js/autocomplete.js
+++ b/share/static/js/autocomplete.js
@@ -5,7 +5,8 @@ window.RT.Autocomplete.Classes = {
     Users: 'user',
     Groups: 'group',
     Tickets: 'tickets',
-    Queues: 'queues'
+    Queues: 'queues',
+    Articles: 'articles'
 };
 
 window.RT.Autocomplete.bind = function(from) {
@@ -84,6 +85,9 @@ window.RT.Autocomplete.bind = function(from) {
             };
         }
 
+        var queue = input.attr("data-autocomplete-queue");
+        if (queue) queryargs.push("queue=" + queue);
+
         var checkRight = input.attr("data-autocomplete-checkright");
         if (checkRight) queryargs.push("right=" + checkRight);
 

commit da505e97e3d3c8f70e6950fcefb045e0ea8332d8
Author: craig Kaiser <craig at bestpractical.com>
Date:   Wed Feb 21 14:43:41 2018 -0500

    Test default article content on ticket create

diff --git a/t/web/ticket-create-utf8.t b/t/web/ticket-create-utf8.t
index ebb2d5eab..76a7360b7 100644
--- a/t/web/ticket-create-utf8.t
+++ b/t/web/ticket-create-utf8.t
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 43;
+use RT::Test tests => 49;
 
 my $ru_test = "\x{442}\x{435}\x{441}\x{442}";
 my $ru_support = "\x{43f}\x{43e}\x{434}\x{434}\x{435}\x{440}\x{436}\x{43a}\x{430}";
@@ -86,3 +86,23 @@ foreach my $test_str ( $ru_test, $l1_test ) {
     }
 }
 
+my $article = RT::Article->new($RT::SystemUser);
+my ( $id, $msg ) = $article->Create(
+    Class   => 'General',
+    Name    => 'My Article',
+    'CustomField-Content' => 'My Article Test Content',
+);
+ok( $id, $msg );
+(my $ret, $msg) = $article->Load(1);
+ok ($ret, $msg);
+
+my $queue = RT::Queue->new(RT->SystemUser);
+$queue->Load('General');
+ok( $queue, 'Loaded General Queue' );
+($ret, $msg) = $queue->SetDefaultValue( Name => 'Article', Value => $article->Id);
+ok( $ret, $msg );
+
+ok $m->login(root => 'password'), "logged in";
+$m->goto_create_ticket('General');
+$m->scraped_id_is('Content', '#1: My Article <br />-------------- <br />Content: <br />------- <br />My Article Test Content <br />');
+

commit b37c9676071dc8bd1095cde37e82a71a872a257a
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Fri Jun 22 13:26:20 2018 -0400

    Push default article loading toward create

diff --git a/share/html/Elements/MessageBox b/share/html/Elements/MessageBox
index fb966c8e6..c2727e22b 100644
--- a/share/html/Elements/MessageBox
+++ b/share/html/Elements/MessageBox
@@ -46,7 +46,7 @@
 %#
 %# END BPS TAGGED BLOCK }}}
 <textarea autocomplete="off" class="messagebox <% $Type eq 'text/html' ? 'richtext' : '' %>" <% $width_attr %>="<% $Width %>" rows="<% $Height %>" <% $wrap_type |n %> name="<% $Name %>" id="<% $Name %>" placeholder="<% $Placeholder %>">
-% $m->comp('/Articles/Elements/IncludeArticle', %ARGS) if $IncludeArticle;
+% $m->comp('/Articles/Elements/IncludeArticle', %ARGS, ArticleId => $article_id) if $IncludeArticle;
 % $m->callback( %ARGS, SignatureRef => \$signature, DefaultRef => \$Default, MessageRef => \$message );
 % if (RT->Config->Get("SignatureAboveQuote", $session{'CurrentUser'})) {
 <% $Default || '' %><% $signature %><% $message %></textarea>
@@ -101,6 +101,11 @@ if ( $IncludeSignature and $signature =~ /\S/ ) {
     $signature = '';
 }
 
+my $article_id;
+if ( $IncludeDefaultArticle && defined $QueueObj && $QueueObj->Id ) {
+    $article_id = $QueueObj->DefaultValue('Article') if $QueueObj->DefaultValue('Article');
+}
+
 # wrap="something" seems to really break IE + richtext
 my $wrap_type = $Type eq 'text/html' ? '' : 'wrap="soft"';
 
@@ -125,4 +130,6 @@ $IncludeArticle            => 1;
 $Type                      => RT->Config->Get('MessageBoxRichText',  $session{'CurrentUser'}) ? 'text/html' : 'text/plain';
 $SuppressAttachmentWarning => 0
 $Placeholder               => ''
+$IncludeDefaultArticle            => 0  # Preload a default article based on queue settings
+$QueueObj                  => undef
 </%ARGS>
diff --git a/share/html/Ticket/Create.html b/share/html/Ticket/Create.html
index c8b73f4e1..79116f682 100644
--- a/share/html/Ticket/Create.html
+++ b/share/html/Ticket/Create.html
@@ -240,9 +240,11 @@
 % }
 % $m->callback( %ARGS, QueueObj => $QueueObj, CallbackName => 'BeforeMessageBox' );
 % if (exists $ARGS{Content}) {
-<& /Elements/MessageBox, Default => $ARGS{Content}, IncludeSignature => 0 &>
+<& /Elements/MessageBox, Default => $ARGS{Content}, IncludeSignature => 0, IncludeDefaultArticle => 0 &>
+% } elsif ( $QuoteTransaction ) {
+<& /Elements/MessageBox, QuoteTransaction => $QuoteTransaction, IncludeDefaultArticle => 0 &>
 % } else {
-<& /Elements/MessageBox, QuoteTransaction => $QuoteTransaction &>
+<& /Elements/MessageBox, QueueObj => $QueueObj, IncludeDefaultArticle => 1 &>
 %}
 % $m->callback( %ARGS, QueueObj => $QueueObj, CallbackName => 'AfterMessageBox' );
 

commit e8893c27b49cb387bce877b1f8cf8f78adf31cf7
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Sun Jun 24 12:16:44 2018 -0400

    Refactor ticket create and update to use new SelectArticle
    
    Remove multiple article selection options from the ticket update
    page and replace with a single article selection control. This
    new article selector is a dropdown like the former hotlist,
    but converts to an autocomplete when the number of items in the list
    exceeds the DropdownLimit configuration.
    
    This change removes some extra code that worked to load a ticket
    object in IncludeArticle. The template no longer needs it, but
    it was also passed to a callback. Extensions that use this
    callback may need to make changes to handle receiving an empty
    ticket object.

diff --git a/share/html/Articles/Elements/BeforeMessageBox b/share/html/Articles/Elements/BeforeMessageBox
index 8c84eb102..a238cb359 100644
--- a/share/html/Articles/Elements/BeforeMessageBox
+++ b/share/html/Articles/Elements/BeforeMessageBox
@@ -52,43 +52,8 @@
 <table class="articles-select-article">
 % unless (RT->Config->Get('HideArticleSearchOnReplyCreate')) {
 <tr>
-<td><&|/l&>Search for Articles matching</&></td>
-<td><input size=20 name="<% $name_prefix %>Articles_Content" /></td>
-</tr>
-<tr>
 <td><&|/l&>Include Article:</&></td>
-<td><input size=20 name="<% $name_prefix %>Articles-Include-Article-Named" /></td>
-<td><input type="submit" name="Go" value="Go" /></td>
-</tr>
-% }
-% if ($hotlist->Count) {
-<tr>
-<td><&|/l&>Select an Article to include</&></td>
-<td><select name="<% $name_prefix %>Articles-Include-Article-Named-Hotlist" onchange="this.form.submit()">
-<option value="" selected><&|/l&>-</&></option>
-% while (my $article = $hotlist->Next) {
-<option value="<% $article->Id %>"><%$article->Name|| loc('(no name)')%>: <%$article->Summary || ''%></option>
-% }
-</select>
-</td>
-<td><input type="submit" name="Go" value="Go" /></td>
-</tr>
-% }
-% my %dedupe_articles;
-% while (my $article = $articles_content->Next) {
-%   $dedupe_articles{$article->Id}++;
-<tr>
-<td> </td>
-<td><%$article->Name|| loc('(no name)')%>: <%$article->Summary%></td>
-<td><input type="submit" name="<% $name_prefix %>Articles-Include-Article-<%$article->Id%>" value="Go" /></td>
-</tr>
-% }
-% while (my $article = $articles_basics->Next) {
-%   next if $dedupe_articles{$article->Id};
-<tr>
-<td> </td>
-<td><%$article->Name || loc('(no name)')%>: <%$article->Summary || ''%></td>
-<td><input type="submit" name="<% $name_prefix %>Articles-Include-Article-<%$article->Id%>" value="Go" /></td>
+<td><& /Elements/SelectArticle, QueueObj => $QueueObj, AutoSubmit => 1 &></td>
 </tr>
 % }
 % if ( @$topics ) {
@@ -114,7 +79,7 @@
 <&|/l, $included_topic->Name &>Select an Article from [_1]</&>
 </td>
 <td>
-<select name="<% $name_prefix %>Articles-Include-Article" onchange="this.form.submit()">
+<select name="IncludeArticleId" onchange="this.form.submit()">
 <option value="" selected>-</option>
 % while ( my $art = $topic_articles->Next ) {
 <option value="<% $art->id %>"><%$art->Name||loc('(no name)')%>: <%$art->Summary%></option>
diff --git a/share/html/Articles/Elements/IncludeArticle b/share/html/Articles/Elements/IncludeArticle
index d69ddce7a..eb6e50348 100644
--- a/share/html/Articles/Elements/IncludeArticle
+++ b/share/html/Articles/Elements/IncludeArticle
@@ -46,65 +46,21 @@
 %#
 %# END BPS TAGGED BLOCK }}}
 <%INIT>
+# Nothing to do if we don't get an article id
+$IncludeArticleId //= $DECODED_ARGS->{'IncludeArticleId'};
+return unless $IncludeArticleId;
 
-my $parent_args = $m->caller_args(-1);
-my @articles;
+my $article = RT::Article->new($session{'CurrentUser'});
+my ($ret, $msg) = $article->Load($IncludeArticleId);
 
-my $name_prefix = '';
-$name_prefix = $ARGS{'Name'} .'-'
-    if $ARGS{'Name'}
-    && grep rindex($_, "$ARGS{'Name'}-Articles-", 0) == 0,
-        keys %$parent_args;
-
-my $Ticket = $ARGS{Ticket};
-if ( !$Ticket and $parent_args->{id} and $parent_args->{id} ne 'new' ) {
-    $Ticket = RT::Ticket->new($session{'CurrentUser'});
-    $Ticket->Load($parent_args->{id});
-    unless ( $Ticket->id ) {
-        $RT::Logger->error("Couldn't load ticket ". $parent_args->{id} )
-    }
-}
-
-foreach my $arg ( keys %$parent_args ) {
-    next if $name_prefix && substr($arg, 0, length($name_prefix)) ne $name_prefix;
-
-    my $Queue = RT::Queue->new($session{CurrentUser});
-    if ($Ticket && $Ticket->Id) {
-        $Queue = $Ticket->QueueObj;
-    }
-
-    my $article = RT::Article->new($session{'CurrentUser'});
-    $article->LoadByInclude(
-        Field => substr($arg, length($name_prefix)),
-        Value => $parent_args->{$arg},
-        Queue => $Queue->Id,
-    );
-    next unless $article && $article->id;
-    push (@articles, $article);
-}
-
-if ( !@articles && ( !$parent_args->{id} || $parent_args->{id} eq 'new' ) && $parent_args->{'Queue'} ) {
-    my $queue_id = $parent_args->{'Queue'};
-    my $QueueObj = RT::Queue->new($session{'CurrentUser'});
-    my ($ret, $msg) = $QueueObj->Load( $queue_id );
-    $RT::Logger->error($msg) unless ($ret);
-
-    if ( $QueueObj->id && $QueueObj->DefaultValue('Article') ) {
-        my $article = RT::Article->new($session{'CurrentUser'});
-        my ($ret, $msg) = $article->Load( $QueueObj->DefaultValue('Article') );
-        $RT::Logger->error($msg) unless ($ret);
-        if ($ret) {
-            push (@articles, $article);
-        }
-    }
-}
-
-foreach my $article (@articles) {
+if ( $ret && $article->Id ){
     my $formatted_article = $m->scomp('/Articles/Article/Elements/Preformatted',
-        Article => $article, Ticket => $Ticket
+        Article => $article
     );
 
-    $m->callback( Article => $article, Ticket => $Ticket, formatted_article => \$formatted_article );
+    # Ticket is provided in this callback for backward compatibility.
+    # However, after refactoring, less work is done to make sure a Ticket is available
+    $m->callback( Article => $article, Ticket => $ARGS{'Ticket'}, formatted_article => \$formatted_article );
 
     if (RT->Config->Get('MessageBoxRichText',  $session{'CurrentUser'})) {
         $formatted_article =~ s/>/>/g;
@@ -113,7 +69,11 @@ foreach my $article (@articles) {
         $formatted_article =~ s/\n/\n<br \/>/g;
     }
     $m->print($formatted_article);
-
 }
-return;
+else {
+    RT::Logger->error("Unable to load article $IncludeArticleId: $msg");
+}
 </%INIT>
+<%ARGS>
+$IncludeArticleId => undef
+</%ARGS>
diff --git a/share/html/Elements/MessageBox b/share/html/Elements/MessageBox
index c2727e22b..c85d38861 100644
--- a/share/html/Elements/MessageBox
+++ b/share/html/Elements/MessageBox
@@ -46,7 +46,7 @@
 %#
 %# END BPS TAGGED BLOCK }}}
 <textarea autocomplete="off" class="messagebox <% $Type eq 'text/html' ? 'richtext' : '' %>" <% $width_attr %>="<% $Width %>" rows="<% $Height %>" <% $wrap_type |n %> name="<% $Name %>" id="<% $Name %>" placeholder="<% $Placeholder %>">
-% $m->comp('/Articles/Elements/IncludeArticle', %ARGS, ArticleId => $article_id) if $IncludeArticle;
+% $m->comp('/Articles/Elements/IncludeArticle', %ARGS, IncludeArticleId => $article_id) if $IncludeArticle;
 % $m->callback( %ARGS, SignatureRef => \$signature, DefaultRef => \$Default, MessageRef => \$message );
 % if (RT->Config->Get("SignatureAboveQuote", $session{'CurrentUser'})) {
 <% $Default || '' %><% $signature %><% $message %></textarea>
@@ -103,8 +103,13 @@ if ( $IncludeSignature and $signature =~ /\S/ ) {
 
 my $article_id;
 if ( $IncludeDefaultArticle && defined $QueueObj && $QueueObj->Id ) {
+    # Load a default article
     $article_id = $QueueObj->DefaultValue('Article') if $QueueObj->DefaultValue('Article');
 }
+else {
+    # Load from the page, if provided
+    $article_id = $ARGS{'IncludeArticleId'} if $ARGS{'IncludeArticleId'};
+}
 
 # wrap="something" seems to really break IE + richtext
 my $wrap_type = $Type eq 'text/html' ? '' : 'wrap="soft"';
@@ -130,6 +135,6 @@ $IncludeArticle            => 1;
 $Type                      => RT->Config->Get('MessageBoxRichText',  $session{'CurrentUser'}) ? 'text/html' : 'text/plain';
 $SuppressAttachmentWarning => 0
 $Placeholder               => ''
-$IncludeDefaultArticle            => 0  # Preload a default article based on queue settings
+$IncludeDefaultArticle     => 0  # Preload a default article based on queue settings
 $QueueObj                  => undef
 </%ARGS>
diff --git a/share/html/Elements/SelectArticle b/share/html/Elements/SelectArticle
index b65116f7b..c143ddc1b 100644
--- a/share/html/Elements/SelectArticle
+++ b/share/html/Elements/SelectArticle
@@ -49,12 +49,13 @@
 % if ( $autocomplete ) {
 <& "SelectArticleAutocomplete", QueueObj => $QueueObj, Default => $Default, Name => $Name &>
 % } else {
-<select name="<% $Name %>">
+<select name="<% $Name %>" <% $AutoSubmit ? 'onchange="this.form.submit()"' : '' |n%>>
 <option value="">-</option>
 % while (my $article = $articles->Next) {
 <option <% ( $article->Name eq $Default) ? qq[ selected="selected"] : '' |n %>
-    value="<%$article->Id%>"
-><% $article->Name %></option>
+    value="<%$article->Id%>">
+<%$article->Name || loc('(no name)')%><% $IncludeSummary ? ': ' . $article->Summary || '' : '' %>
+</option>
 % }
 </select>
 % }
@@ -86,6 +87,8 @@ $Default //= '';
 
 <%ARGS>
 $QueueObj
-$Name => 'Article'
-$Default => ''
+$Name           => 'IncludeArticleId'
+$Default        => ''
+$AutoSubmit     => 0
+$IncludeSummary => 1
 </%ARGS>
diff --git a/share/html/Elements/SelectArticleAutocomplete b/share/html/Elements/SelectArticleAutocomplete
index 6b92e386e..703da0c6c 100644
--- a/share/html/Elements/SelectArticleAutocomplete
+++ b/share/html/Elements/SelectArticleAutocomplete
@@ -45,10 +45,12 @@
 %# those contributions and any derivatives thereof.
 %#
 %# END BPS TAGGED BLOCK }}}
-<input data-autocomplete="Articles" <% $QueueObj && $QueueObj->id ? q{data-autocomplete-queue="} . $QueueObj->id . q{"} : '' |n %> data-autocomplete-return="Name" name="<% $Name %>" value="<% $Default %>">
+<input data-autocomplete="Articles" <% $QueueObj && $QueueObj->id ? q{data-autocomplete-queue="} . $QueueObj->id . q{"} : '' |n %> data-autocomplete-return="id" name="<% $Name %>" value="<% $Default %>"
+<% $AutoSubmit ? 'data-autocomplete-autosubmit=1' : '' %>>
 
 <%ARGS>
 $QueueObj => undef
 $Default => undef
 $Name => 'Article'
+$AutoSubmit => 1
 </%ARGS>
diff --git a/t/articles/queue-specific-class.t b/t/articles/queue-specific-class.t
index 5cd042910..1ae8205c4 100644
--- a/t/articles/queue-specific-class.t
+++ b/t/articles/queue-specific-class.t
@@ -2,9 +2,10 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 56;
+use RT::Test tests => undef;
 
 my ( $url, $m ) = RT::Test->started_ok;
+diag "Running server at: $url";
 $m->login;
 
 my %class = map { $_ => '' } qw/foo bar/;
@@ -73,36 +74,8 @@ diag "update ticket to see if there is article foo"
 {
     $m->get_ok( '/Ticket/Update.html?Action=Comment&id=' . $ticket_id,
         'ticket update page' );
-    $m->content_contains( 'article foo:', 'got article foo in hotlist' );
-    $m->content_lacks( 'article bar:', 'no article bar in hotlist' );
-
-    $m->submit_form(
-        form_number => 3,
-        fields      => { 'Articles_Content' => 'article' },
-        button      => 'Go',
-    );
-    $m->content_like( qr/article foo.*article foo/s, 'selected article foo' );
-    $m->content_lacks( 'article bar', 'no article bar' );
-
-    $m->get_ok( '/Ticket/Update.html?Action=Comment&id=' . $ticket_id,
-        'ticket update page' );
-    $m->submit_form(
-        form_number => 3,
-        fields      => { 'Articles-Include-Article-Named' => 'article foo' },
-        button      => 'Go',
-    );
-    $m->content_like( qr/article foo.*article foo/s, 'selected article foo' );
-    $m->content_lacks( 'article bar', 'no article bar' );
-
-    $m->get_ok( '/Ticket/Update.html?Action=Comment&id=' . $ticket_id,
-        'ticket update page' );
-    $m->submit_form(
-        form_number => 3,
-        fields      => { 'Articles-Include-Article-Named' => 'articlei bar' },
-        button      => 'Go',
-    );
-    $m->content_unlike( qr/article foo.*article foo/s, 'no article foo' );
-    $m->content_lacks( 'article bar', 'no article bar' );
+    $m->content_contains( 'article foo:', 'got article foo in dropdown' );
+    $m->content_lacks( 'article bar:', 'no article bar in dropdown' );
 }
 
 diag "apply bar to globally" if $ENV{TEST_VERBOSE};
@@ -123,36 +96,14 @@ diag "update ticket to see if there are both article foo and bar"
 {
     $m->get_ok( '/Ticket/Update.html?Action=Comment&id=' . $ticket_id,
         'ticket update page' );
-    $m->content_contains( 'article foo:', 'got article foo in hotlist' );
-    $m->content_contains( 'article bar:', 'got article bar in hotlist' );
-
-    $m->submit_form(
-        form_number => 3,
-        fields      => { 'Articles_Content' => 'article' },
-        button      => 'Go',
-    );
-    $m->content_like( qr/article foo.*article foo/s, 'selected article foo' );
-    $m->content_like( qr/article bar.*article bar/s, 'selected article bar' );
+    $m->content_contains( 'article foo:', 'got article foo in dropdown' );
+    $m->content_contains( 'article bar:', 'got article bar in dropdown' );
 
-    $m->get_ok( '/Ticket/Update.html?Action=Comment&id=' . $ticket_id,
-        'ticket update page' );
     $m->submit_form(
         form_number => 3,
-        fields      => { 'Articles-Include-Article-Named' => 'article foo' },
-        button      => 'Go',
+        fields      => { 'IncludeArticleId' => '1' },
     );
     $m->content_like( qr/article foo.*article foo/s, 'selected article foo' );
-    $m->content_unlike( qr/article bar.*article bar/s, 'no article bar' );
-
-    $m->get_ok( '/Ticket/Update.html?Action=Comment&id=' . $ticket_id,
-        'ticket update page' );
-    $m->submit_form(
-        form_number => 3,
-        fields      => { 'Articles-Include-Article-Named' => 'article bar' },
-        button      => 'Go',
-    );
-    $m->content_like( qr/article bar.*article bar/s, 'selected article bar' );
-    $m->content_unlike( qr/article foo.*article foo/s, 'no article foo' );
 }
 
 
@@ -174,7 +125,7 @@ diag "remove both foo and bar" if $ENV{TEST_VERBOSE};
         fields      => { 'RemoveClass-' . $class{bar} => 0 },
         button      => 'UpdateObjs',
     );
-    $m->content_contains( 'Object deleted', 'remoked bar' );
+    $m->content_contains( 'Object deleted', 'removed bar' );
 }
 
 diag "update ticket to see if there are both article foo and bar"
@@ -189,7 +140,6 @@ diag "update ticket to see if there are both article foo and bar"
     $m->submit_form(
         form_number => 3,
         fields      => { 'Articles_Content' => 'article' },
-        button      => 'Go',
     );
     $m->content_lacks( 'article foo', 'no article foo' );
     $m->content_lacks( 'article bar', 'no article bar' );
@@ -199,7 +149,6 @@ diag "update ticket to see if there are both article foo and bar"
     $m->submit_form(
         form_number => 3,
         fields      => { 'Articles-Include-Article-Named' => 'article foo' },
-        button      => 'Go',
     );
     $m->content_lacks( 'article foo', 'no article foo' );
     $m->content_lacks( 'article bar', 'no article bar' );
@@ -209,9 +158,9 @@ diag "update ticket to see if there are both article foo and bar"
     $m->submit_form(
         form_number => 3,
         fields      => { 'Articles-Include-Article-Named' => 'article bar' },
-        button      => 'Go',
     );
     $m->content_lacks( 'article foo', 'no article foo' );
     $m->content_lacks( 'article bar', 'no article bar' );
 }
 
+done_testing();
diff --git a/t/articles/set-subject.t b/t/articles/set-subject.t
index 5ba1af845..04124da31 100644
--- a/t/articles/set-subject.t
+++ b/t/articles/set-subject.t
@@ -85,7 +85,6 @@ is($m->form_number(3)->find_input('UpdateSubject')->value,$ticket->Subject,'Tick
 $m->submit_form(
     form_number => 3,
     fields      => { 'Articles-Include-Article-Named' => $article->Id },
-    button      => 'Go',
 );
 is($m->form_number(3)->find_input('UpdateSubject')->value,$ticket->Subject,'Ticket Subject Not Clobbered');
 
@@ -103,7 +102,6 @@ is($m->form_number(3)->find_input('UpdateSubject')->value,$ticket->Subject,'Tick
 $m->submit_form(
     form_number => 3,
     fields      => { 'Articles-Include-Article-Named' => $article->Name },
-    button      => 'Go',
 );
 is($m->form_number(3)->find_input('UpdateSubject')->value,$article->FirstCustomFieldValue("Subject-$$"),'Ticket Subject Clobbered');
 

commit 3e142bfc1730b0e83ee9130cb361945ad64894a1
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Sun Jun 24 13:13:10 2018 -0400

    Add articles notes to upgrading docs

diff --git a/devel/docs/UPGRADING-4.6 b/devel/docs/UPGRADING-4.6
new file mode 100644
index 000000000..747e45e3d
--- /dev/null
+++ b/devel/docs/UPGRADING-4.6
@@ -0,0 +1,17 @@
+=head1 UPGRADING FROM RT 4.4.0 and greater
+
+This documentation notes internals changes between the 4.4 and 4.6
+series that are primarily of interest to developers writing extensions
+or local customizations.  It is not an exhaustive list.
+
+=over
+
+=item *
+
+The default callback in C<Articles/Elements/IncludeArticle> provides a ticket
+object. However, the template itself does not need this ticket object, so it
+is no longer guaranteed to be loaded when it is passed.
+
+=back
+
+=cut
diff --git a/docs/UPGRADING-4.6 b/docs/UPGRADING-4.6
index 6755ffa17..54a97f9fc 100644
--- a/docs/UPGRADING-4.6
+++ b/docs/UPGRADING-4.6
@@ -18,6 +18,12 @@ The variables which alter the set of HTML elements allowed in HTML
 scrubbing have moved; they have been renamed, and are now found under
 L<RT::Interface::Web::Scrubber>.
 
+=item *
+
+The articles interface on tickets has been simplified, now showing only
+a dropdown for selecting articles. This dropdown converts to an autocomplete
+box when the dropdown contains more than C<$DropdownMenuLimit> items.
+
 =back
 
 =cut

commit 4b01497201a8b2adb551686218bb62e20853e529
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Sun Jun 24 15:42:01 2018 -0400

    Remove article loading now handled in SelectArticle

diff --git a/share/html/Articles/Elements/BeforeMessageBox b/share/html/Articles/Elements/BeforeMessageBox
index a238cb359..c6c56a95e 100644
--- a/share/html/Articles/Elements/BeforeMessageBox
+++ b/share/html/Articles/Elements/BeforeMessageBox
@@ -112,11 +112,6 @@ if ( $ARGS{'MessageBoxName'} ) {
     $name_prefix = $ARGS{'MessageBoxName'} .'-';
 }
 
-# convert Articles-Include-Article => $id to Articles-Include-Article-$id
-if ( my $tmp = $ARGS{$name_prefix ."Articles-Include-Article"} ) {
-    $ARGS{$name_prefix ."Articles-Include-Article-$tmp"}++;
-}
-
 my %uri;
 if ( $ARGS{id} && $ARGS{id} ne 'new' ) {
     $uri{$_}++ for split ' ', ($ARGS{$ARGS{'id'}.'-RefersTo'} || '');
@@ -135,34 +130,6 @@ if ( $ARGS{id} && $ARGS{id} ne 'new' ) {
     }
 }
 
-use RT::Articles;
-
-my $articles_content =
-  RT::Articles->new( $session{'CurrentUser'} );
-my $articles_basics = RT::Articles->new( $session{'CurrentUser'} );
-if ( my $tmp = $ARGS{ $name_prefix ."Articles_Content" } ) {
-    $articles_content->LimitCustomField(
-        VALUE => $tmp, OPERATOR => 'LIKE'
-    );
-    $articles_content->LimitAppliedClasses( Queue => $QueueObj );
-
-    $articles_basics->Limit( SUBCLAUSE       => 'all',
-                             FIELD           => 'Name',
-                             OPERATOR        => 'LIKE',
-                             VALUE           => $tmp,
-                             ENTRYAGGREGATOR => "OR" );
-    $articles_basics->Limit( SUBCLAUSE       => 'all',
-                             FIELD           => 'Summary',
-                             OPERATOR        => 'LIKE',
-                             VALUE           => $tmp,
-                             ENTRYAGGREGATOR => "OR" );
-    $articles_basics->LimitAppliedClasses( Queue => $QueueObj );
-}
-
-my $hotlist = RT::Articles->new( $session{'CurrentUser'} );
-$hotlist->LimitHotlistClasses;
-$hotlist->LimitAppliedClasses( Queue => $QueueObj );
-
 my ( $topic_articles, $topics, $included_topic );
 $topic_articles = RT::Articles->new( $session{CurrentUser} );
 $topics = [];

commit 5652cbd63cebe726c0ddf3f07187c8cc99fc722e
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Sun Jun 24 15:45:37 2018 -0400

    Update article to ticket linking with new args

diff --git a/share/html/Articles/Elements/BeforeMessageBox b/share/html/Articles/Elements/BeforeMessageBox
index c6c56a95e..36f2af3a8 100644
--- a/share/html/Articles/Elements/BeforeMessageBox
+++ b/share/html/Articles/Elements/BeforeMessageBox
@@ -116,17 +116,11 @@ my %uri;
 if ( $ARGS{id} && $ARGS{id} ne 'new' ) {
     $uri{$_}++ for split ' ', ($ARGS{$ARGS{'id'}.'-RefersTo'} || '');
 
-    foreach my $arg (keys %ARGS) {
-        next if $name_prefix && substr($arg, 0, length($name_prefix)) ne $name_prefix;
-
-        my $article = RT::Article->new($session{'CurrentUser'});
-        $article->LoadByInclude(
-            Field => substr($arg, length($name_prefix)),
-            Value => $ARGS{$arg},
-        );
-        if ($article->Id) {
-            $uri{$article->URI}++;
-        }
+    my $article = RT::Article->new($session{'CurrentUser'});
+    my ($ret, $msg) = $article->Load($ARGS{'IncludeArticleId'});
+
+    if ($ret && $article->Id) {
+        $uri{$article->URI}++;
     }
 }
 

commit fc6a8f84f06bb5651319f71b8b7bbb69bcd311e3
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Sun Jun 24 15:31:31 2018 -0400

    Update tests for new articles configuration

diff --git a/t/articles/queue-specific-class.t b/t/articles/queue-specific-class.t
index 1ae8205c4..770e73711 100644
--- a/t/articles/queue-specific-class.t
+++ b/t/articles/queue-specific-class.t
@@ -36,7 +36,9 @@ for my $name ( keys %class ) {
 
     $m->submit_form(
         form_number => 2,
-        fields      => { Name => "article $name" }
+        fields      => { Name => "article $name",
+                         'Summary' => "$name summary",
+                         'Object-RT::Article--CustomField-1-Values' => "$name content"}
     );
 
     $m->content_like( qr/Article \d+ created/, "created article $name" );
@@ -103,7 +105,7 @@ diag "update ticket to see if there are both article foo and bar"
         form_number => 3,
         fields      => { 'IncludeArticleId' => '1' },
     );
-    $m->content_like( qr/article foo.*article foo/s, 'selected article foo' );
+    $m->content_like( qr/foo summary/s, 'article included' );
 }
 
 
diff --git a/t/web/articles-links.t b/t/web/articles-links.t
index 4aa8f9133..018f71c0b 100644
--- a/t/web/articles-links.t
+++ b/t/web/articles-links.t
@@ -29,7 +29,7 @@ $m->goto_ticket($ticket->id);
 $m->follow_link_ok({text => 'Reply'});
 
 $m->form_name('TicketUpdate');
-$m->field('Articles-Include-Article-Named' => $article->Name);
+$m->field('IncludeArticleId' => $article->Id);
 $m->submit;
 
 $m->content_contains('instance of ticket #17421', 'got the name of the article in the ticket');

commit 06480e7031d9abde460b575c838f304e040a6832
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Sat Nov 3 02:49:28 2018 +0800

    Drop the hacky hidden "SubmitTicket" input on ticket create page
    
    Previously we added the hidden "SubmitTicket" input so user could create
    tickets by clicking "Enter" on input fields like "Subject". This is not
    compatible with the new article selection UI: when user selects an
    article, the auto-submitted form will create a ticket instead of
    updating the message box.
    
    Since the article "Go" button has been removed, "SubmitTicket" button
    becomes the first button of the form in most cases, so user still could
    quick create tickets by clicking "Enter".

diff --git a/lib/RT/Test/GnuPG.pm b/lib/RT/Test/GnuPG.pm
index b4bbb71a0..774a71e8d 100644
--- a/lib/RT/Test/GnuPG.pm
+++ b/lib/RT/Test/GnuPG.pm
@@ -132,7 +132,7 @@ sub create_a_ticket {
         }
     }
 
-    $m->submit;
+    $m->click( 'SubmitTicket' );
     is $m->status, 200, "request successful";
 
     $m->content_lacks("unable to sign outgoing email messages");
diff --git a/share/html/Ticket/Create.html b/share/html/Ticket/Create.html
index 79116f682..2488540a3 100644
--- a/share/html/Ticket/Create.html
+++ b/share/html/Ticket/Create.html
@@ -53,7 +53,6 @@
 <& /Elements/ListActions, actions => \@results &>
 
 <form action="<% RT->Config->Get('WebPath') %>/Ticket/Create.html" method="post" enctype="multipart/form-data" name="TicketCreate">
-  <input type="submit" name="SubmitTicket" value="Create" style="display:none">
   <input type="hidden" class="hidden" name="id" value="new" />
   <input type="hidden" class="hidden" name="Token" value="<% $ARGS{'Token'} %>" />
   
@@ -255,7 +254,7 @@
         <& /Ticket/Elements/AddAttachments, %ARGS, QueueObj => $QueueObj &>
       </table>
     </&>
-    <& /Elements/Submit, Label => loc("Create"), id => 'SubmitTicket' &>
+    <& /Elements/Submit, Label => loc("Create"), id => 'SubmitTicket', Name => 'SubmitTicket' &>
   </div>
 </div>
 
@@ -507,7 +506,7 @@ $m->callback( CallbackName => 'BeforeCreate', ARGSRef => \%ARGS, skip_create =>
 $m->comp( '/Articles/Elements/CheckSkipCreate', ARGSRef => \%ARGS, skip_create => \$skip_create,
               checks_failure => $checks_failure, results => \@results );
 
-if ((!exists $ARGS{'AddMoreAttach'}) and (!exists $ARGS{'Go'}) and (defined($ARGS{'id'}) and $ARGS{'id'} eq 'new')) { # new ticket?
+if (exists $ARGS{'SubmitTicket'} and (!exists $ARGS{'AddMoreAttach'}) and (defined($ARGS{'id'}) and $ARGS{'id'} eq 'new')) { # new ticket?
     if ( !$checks_failure && !$skip_create ) {
         $m->comp('Display.html', %ARGS);
         $RT::Logger->crit("After display call; error is $@");
diff --git a/t/articles/queue-specific-class.t b/t/articles/queue-specific-class.t
index 770e73711..7bc985eb7 100644
--- a/t/articles/queue-specific-class.t
+++ b/t/articles/queue-specific-class.t
@@ -65,6 +65,7 @@ diag "create ticket in General" if $ENV{TEST_VERBOSE};
     $m->submit_form(
         form_number => 3,
         fields => { 'Subject' => 'test article', Content => 'test article' },
+        button => 'SubmitTicket',
     );
     ($ticket_id) = ( $m->content =~ /Ticket \d+ created/ );
     ok( $ticket_id, "id of ticket: $ticket_id" );
diff --git a/t/customfields/access_via_queue.t b/t/customfields/access_via_queue.t
index 300e777b8..d8f54c505 100644
--- a/t/customfields/access_via_queue.t
+++ b/t/customfields/access_via_queue.t
@@ -108,6 +108,7 @@ diag "check that we don't have the cf on create";
     $m->submit_form(
         form_name => "TicketCreate",
         fields => { Subject => 'test' },
+        button => 'SubmitTicket',
     );
     my ($tid) = ($m->content =~ /Ticket (\d+) created/i);
     ok $tid, "created a ticket succesfully";
diff --git a/t/customfields/ip.t b/t/customfields/ip.t
index 96da6c3ab..8f2071a7e 100644
--- a/t/customfields/ip.t
+++ b/t/customfields/ip.t
@@ -53,7 +53,8 @@ diag "create a ticket via web and set IP" if $ENV{'TEST_VERBOSE'};
         fields    => {
             Subject   => 'test ip',
             $cf_field => $val,
-        }
+        },
+        button    => 'SubmitTicket',
     );
 
     $agent->content_contains( $val, "IP on the page" );
@@ -73,7 +74,8 @@ diag "create a ticket and edit IP field using Edit page"
     ok $agent->goto_create_ticket($q), "go to create ticket";
     $agent->submit_form(
         form_name => 'TicketCreate',
-        fields    => { Subject => 'test ip', }
+        fields    => { Subject => 'test ip', },
+        button    => 'SubmitTicket',
     );
 
     my ($id) = $agent->content =~ /Ticket (\d+) created/;
@@ -124,7 +126,8 @@ diag "check that we parse correct IPs only" if $ENV{'TEST_VERBOSE'};
             fields    => {
                 Subject   => 'test ip',
                 $cf_field => $valid,
-            }
+            },
+            button    => 'SubmitTicket',
         );
 
         my ($id) = $agent->content =~ /Ticket (\d+) created/;
@@ -144,7 +147,8 @@ diag "check that we parse correct IPs only" if $ENV{'TEST_VERBOSE'};
             fields    => {
                 Subject   => 'test ip',
                 $cf_field => $invalid,
-            }
+            },
+            button    => 'SubmitTicket',
         );
 
         $agent->content_contains( 'is not a valid IP address',
@@ -163,7 +167,8 @@ diag "search tickets by IP" if $ENV{'TEST_VERBOSE'};
         fields    => {
             Subject   => 'test ip',
             $cf_field => $val,
-        }
+        },
+        button    => 'SubmitTicket',
     );
 
     my ($id) = $agent->content =~ /Ticket (\d+) created/;
@@ -188,7 +193,8 @@ diag "create two tickets with different IPs and check several searches"
         fields    => {
             Subject   => 'test ip',
             $cf_field => '192.168.21.10',
-        }
+        },
+        button    => 'SubmitTicket',
     );
 
     my ($id1) = $agent->content =~ /Ticket (\d+) created/;
@@ -200,7 +206,8 @@ diag "create two tickets with different IPs and check several searches"
         fields    => {
             Subject   => 'test ip',
             $cf_field => '192.168.22.10',
-        }
+        },
+        button    => 'SubmitTicket',
     );
 
     my ($id2) = $agent->content =~ /Ticket (\d+) created/;
@@ -258,7 +265,8 @@ diag "create a ticket with an IP of 10.0.0.1 and search for doesn't match '10.0.
         fields    => {
             Subject   => 'local',
             $cf_field => '10.0.0.1',
-        }
+        },
+        button    => 'SubmitTicket',
     );
 
     my ($id) = $agent->content =~ /Ticket (\d+) created/;
diff --git a/t/customfields/iprange.t b/t/customfields/iprange.t
index 2a323a352..73a03ff55 100644
--- a/t/customfields/iprange.t
+++ b/t/customfields/iprange.t
@@ -48,7 +48,8 @@ diag "create a ticket via web and set IP" if $ENV{'TEST_VERBOSE'};
         fields    => {
             Subject                                       => 'test ip',
             $cf_field => $val,
-        }
+        },
+        button    => 'SubmitTicket',
     );
 
     $agent->content_like( qr/\Q$val/, "IP on the page" );
@@ -71,7 +72,8 @@ diag "create a ticket via web with CIDR" if $ENV{'TEST_VERBOSE'};
         fields    => {
             Subject                                       => 'test ip',
             $cf_field => $val,
-        }
+        },
+        button    => 'SubmitTicket',
     );
 
     my ($id) = $agent->content =~ /Ticket (\d+) created/;
@@ -89,7 +91,8 @@ diag "create a ticket and edit IP field using Edit page" if $ENV{'TEST_VERBOSE'}
     ok $agent->goto_create_ticket($q), "go to create ticket";
     $agent->submit_form(
         form_name => 'TicketCreate',
-        fields    => { Subject => 'test ip', }
+        fields    => { Subject => 'test ip', },
+        button    => 'SubmitTicket',
     );
 
     my ($id) = $agent->content =~ /Ticket (\d+) created/;
@@ -175,7 +178,8 @@ diag "check that we parse correct IPs only" if $ENV{'TEST_VERBOSE'};
             fields    => {
                 Subject   => 'test ip',
                 $cf_field => $valid,
-            }
+            },
+            button    => 'SubmitTicket',
         );
 
         my ($id) = $agent->content =~ /Ticket (\d+) created/;
@@ -194,7 +198,8 @@ diag "check that we parse correct IPs only" if $ENV{'TEST_VERBOSE'};
             fields    => {
                 Subject   => 'test ip',
                 $cf_field => $invalid,
-            }
+            },
+            button    => 'SubmitTicket',
         );
 
         $agent->content_like( qr/is not a valid IP address range/, 'ticket fails to create' );
@@ -212,7 +217,8 @@ diag "search tickets by IP" if $ENV{'TEST_VERBOSE'};
         fields    => {
             Subject   => 'test ip',
             $cf_field => $val,
-        }
+        },
+        button    => 'SubmitTicket',
     );
 
     my ($id) = $agent->content =~ /Ticket (\d+) created/;
@@ -240,7 +246,8 @@ diag "search tickets by IP range" if $ENV{'TEST_VERBOSE'};
         fields    => {
             Subject   => 'test ip',
             $cf_field => $val,
-        }
+        },
+        button    => 'SubmitTicket',
     );
 
     my ($id) = $agent->content =~ /Ticket (\d+) created/;
@@ -267,7 +274,8 @@ diag "create two tickets with different IPs and check several searches" if $ENV{
         fields    => {
             Subject   => 'test ip',
             $cf_field => '192.168.21.10',
-        }
+        },
+        button    => 'SubmitTicket',
     );
 
     my ($id1) = $agent->content =~ /Ticket (\d+) created/;
@@ -279,7 +287,8 @@ diag "create two tickets with different IPs and check several searches" if $ENV{
         fields    => {
             Subject   => 'test ip',
             $cf_field => '192.168.22.10',
-        }
+        },
+        button    => 'SubmitTicket',
     );
 
     my ($id2) = $agent->content =~ /Ticket (\d+) created/;
@@ -365,7 +374,8 @@ diag "create two tickets with different IP ranges and check several searches" if
         fields    => {
             Subject   => 'test ip',
             $cf_field => '192.168.21.0-192.168.21.127',
-        }
+        },
+        button    => 'SubmitTicket',
     );
 
     my ($id1) = $agent->content =~ /Ticket (\d+) created/;
@@ -377,7 +387,8 @@ diag "create two tickets with different IP ranges and check several searches" if
         fields    => {
             Subject   => 'test ip',
             $cf_field => '192.168.21.128-192.168.21.255',
-        }
+        },
+        button    => 'SubmitTicket',
     );
 
     my ($id2) = $agent->content =~ /Ticket (\d+) created/;
diff --git a/t/customfields/iprangev6.t b/t/customfields/iprangev6.t
index 896be528e..ed39ac671 100644
--- a/t/customfields/iprangev6.t
+++ b/t/customfields/iprangev6.t
@@ -59,7 +59,8 @@ diag "create a ticket via web and set IP" if $ENV{'TEST_VERBOSE'};
             fields    => {
                 Subject   => 'test ip',
                 $cf_field => $ip,
-            }
+            },
+            button    => 'SubmitTicket',
         );
 
         $agent->content_like( qr/$valid{$ip}/, "IP on the page" );
@@ -84,7 +85,8 @@ diag "create a ticket via web with CIDR" if $ENV{'TEST_VERBOSE'};
         fields    => {
             Subject                                       => 'test ip',
             $cf_field => $val,
-        }
+        },
+        button    => 'SubmitTicket',
     );
 
     my ($id) = $agent->content =~ /Ticket (\d+) created/;
@@ -106,7 +108,8 @@ diag "create a ticket and edit IP field using Edit page" if $ENV{'TEST_VERBOSE'}
     ok $agent->goto_create_ticket($q), "go to create ticket";
     $agent->submit_form(
         form_name => 'TicketCreate',
-        fields    => { Subject => 'test ip', }
+        fields    => { Subject => 'test ip', },
+        button    => 'SubmitTicket',
     );
 
     my ($id) = $agent->content =~ /Ticket (\d+) created/;
@@ -190,7 +193,8 @@ diag "check that we parse correct IPs only" if $ENV{'TEST_VERBOSE'};
             fields    => {
                 Subject   => 'test ip',
                 $cf_field => $invalid,
-            }
+            },
+            button    => 'SubmitTicket',
         );
 
         $agent->content_like( qr/is not a valid IP address range/,
@@ -209,7 +213,8 @@ diag "search tickets by IP" if $ENV{'TEST_VERBOSE'};
         fields    => {
             Subject   => 'test ip',
             $cf_field => $val,
-        }
+        },
+        button    => 'SubmitTicket',
     );
 
     my ($id) = $agent->content =~ /Ticket (\d+) created/;
@@ -239,7 +244,8 @@ diag "search tickets by IP range" if $ENV{'TEST_VERBOSE'};
         fields    => {
             Subject   => 'test ip',
             $cf_field => $val,
-        }
+        },
+        button    => 'SubmitTicket',
     );
 
     my ($id) = $agent->content =~ /Ticket (\d+) created/;
@@ -272,7 +278,8 @@ diag "create two tickets with different IPs and check several searches" if $ENV{
         fields    => {
             Subject   => 'test ip',
             $cf_field => $first_ip,
-        }
+        },
+        button    => 'SubmitTicket',
     );
 
     my ($id1) = $agent->content =~ /Ticket (\d+) created/;
@@ -284,7 +291,8 @@ diag "create two tickets with different IPs and check several searches" if $ENV{
         fields    => {
             Subject   => 'test ip',
             $cf_field => $second_ip,
-        }
+        },
+        button    => 'SubmitTicket',
     );
 
     my ($id2) = $agent->content =~ /Ticket (\d+) created/;
@@ -374,7 +382,8 @@ diag "create two tickets with different IP ranges and check several searches" if
         fields    => {
             Subject   => 'test ip',
             $cf_field => 'ddcd::/16',
-        }
+        },
+        button    => 'SubmitTicket',
     );
 
     my ($id1) = $agent->content =~ /Ticket (\d+) created/;
@@ -386,7 +395,8 @@ diag "create two tickets with different IP ranges and check several searches" if
         fields    => {
             Subject   => 'test ip',
             $cf_field => 'edcd::/16',
-        }
+        },
+        button    => 'SubmitTicket',
     );
 
     my ($id2) = $agent->content =~ /Ticket (\d+) created/;
diff --git a/t/customfields/ipv6.t b/t/customfields/ipv6.t
index fdfd49cad..04127a283 100644
--- a/t/customfields/ipv6.t
+++ b/t/customfields/ipv6.t
@@ -65,7 +65,8 @@ diag "create a ticket via web and set IP" if $ENV{'TEST_VERBOSE'};
             fields    => {
                 Subject   => 'test ip',
                 $cf_field => $ip,
-            }
+            },
+            button    => 'SubmitTicket',
         );
 
         $agent->content_contains( $valid{$ip}, "IP on the page" );
@@ -93,7 +94,8 @@ diag "create a ticket and edit IP field using Edit page"
     ok $agent->goto_create_ticket($q), "go to create ticket";
     $agent->submit_form(
         form_name => 'TicketCreate',
-        fields    => { Subject => 'test ip', }
+        fields    => { Subject => 'test ip', },
+        button    => 'SubmitTicket',
     );
 
     my ($id) = $agent->content =~ /Ticket (\d+) created/;
@@ -147,7 +149,8 @@ diag "check that we parse correct IPs only" if $ENV{'TEST_VERBOSE'};
             fields    => {
                 Subject   => 'test ip',
                 $cf_field => $invalid,
-            }
+            },
+            button    => 'SubmitTicket',
         );
 
         $agent->content_contains( 'is not a valid IP address',
@@ -165,7 +168,8 @@ diag "create two tickets with different IPs and check several searches"
         fields    => {
             Subject   => 'test ip',
             $cf_field => 'abcd::',
-        }
+        },
+        button    => 'SubmitTicket',
     );
 
     my ($id1) = $agent->content =~ /Ticket (\d+) created/;
@@ -177,7 +181,8 @@ diag "create two tickets with different IPs and check several searches"
         fields    => {
             Subject   => 'test ip',
             $cf_field => 'bbcd::',
-        }
+        },
+        button    => 'SubmitTicket',
     );
 
     my ($id2) = $agent->content =~ /Ticket (\d+) created/;
@@ -231,7 +236,8 @@ diag "create a ticket with an IP of abcd:23:: and search for doesn't match 'abcd
         fields    => {
             Subject   => 'local',
             $cf_field => 'abcd:23::',
-        }
+        },
+        button    => 'SubmitTicket',
     );
 
     my ($id) = $agent->content =~ /Ticket (\d+) created/;
diff --git a/t/customfields/sort_order.t b/t/customfields/sort_order.t
index 24e047ebf..77890cbd3 100644
--- a/t/customfields/sort_order.t
+++ b/t/customfields/sort_order.t
@@ -75,6 +75,7 @@ diag "check ticket create, display and edit pages";
     $m->submit_form(
         form_name => "TicketCreate",
         fields => { Subject => 'test' },
+        button => 'SubmitTicket',
     );
     my ($tid) = ($m->content =~ /Ticket (\d+) created/i);
     ok $tid, "created a ticket succesfully";
diff --git a/t/security/CVE-2011-2084-attach-tickets.t b/t/security/CVE-2011-2084-attach-tickets.t
index 6b1366a5f..ff8d56981 100644
--- a/t/security/CVE-2011-2084-attach-tickets.t
+++ b/t/security/CVE-2011-2084-attach-tickets.t
@@ -55,6 +55,7 @@ $m->submit_form_ok({
         Subject         => 'ticket C',
         AttachTickets   => $ticket_b->id,
     },
+    button => 'SubmitTicket',
 }, 'create a ticket');
 
 my @mail = RT::Test->fetch_caught_mails;
diff --git a/t/security/CVE-2012-4735-sign-any-key.t b/t/security/CVE-2012-4735-sign-any-key.t
index 248df9c55..1ea7dba40 100644
--- a/t/security/CVE-2012-4735-sign-any-key.t
+++ b/t/security/CVE-2012-4735-sign-any-key.t
@@ -50,7 +50,7 @@ sub create_signed {
     $m->field( Content    => 'Some content' );
     $m->tick( Sign => 1 );
     $m->field( SignUsing  => $key );
-    $m->submit;
+    $m->click('SubmitTicket');
 }
 
 create_signed( '' );
diff --git a/t/sla/web.t b/t/sla/web.t
index 2a9f27fd8..0eb0be8e8 100644
--- a/t/sla/web.t
+++ b/t/sla/web.t
@@ -51,7 +51,7 @@ ok $m->login( 'user', 'password' ), 'logged in as user';
     my $form = $m->form_name( 'TicketCreate' );
     my $sla  = $form->find_input( 'SLA' );
     is_deeply( [$sla->possible_values], [ 2, 4 ], 'possible sla' );
-    $m->submit_form( fields => { Subject => 'ticket foo with default sla' } );
+    $m->submit_form( fields => { Subject => 'ticket foo with default sla' }, button => 'SubmitTicket' );
 
     my $ticket = RT::Test->last_ticket;
     ok( $ticket->id, 'ticket is created' );
@@ -64,7 +64,7 @@ ok $m->login( 'user', 'password' ), 'logged in as user';
 {
     $m->goto_create_ticket( $queue->id );
     my $form = $m->form_name( 'TicketCreate' );
-    $m->submit_form( fields => { Subject => 'ticket foo with default sla', SLA => 4 } );
+    $m->submit_form( fields => { Subject => 'ticket foo with default sla', SLA => 4 }, button => 'SubmitTicket' );
 
     my $ticket = RT::Test->last_ticket;
     ok( $ticket->id, 'ticket is created' );
@@ -95,7 +95,7 @@ ok $m->login( 'user', 'password' ), 'logged in as user';
     $m->goto_create_ticket( $queue->id );
     my $form = $m->form_name( 'TicketCreate' );
     ok( !$form->find_input( 'SLA' ), 'no SLA input' );
-    $m->submit_form( fields => { Subject => 'ticket foo without sla' } );
+    $m->submit_form( fields => { Subject => 'ticket foo without sla' }, button => 'SubmitTicket' );
 
     my $ticket = RT::Test->last_ticket;
     ok( $ticket->id,               'ticket is created' );
diff --git a/t/ticket/scrips_batch.t b/t/ticket/scrips_batch.t
index 0a996ce45..ed65f93bd 100644
--- a/t/ticket/scrips_batch.t
+++ b/t/ticket/scrips_batch.t
@@ -66,7 +66,7 @@ END
 
     $m->goto_create_ticket( $queue );
     $m->form_name('TicketCreate');
-    $m->submit;
+    $m->click( 'SubmitTicket' );
 
     is_deeply parse_handle($tmp_fh), ['Create'], 'Create';
 
diff --git a/t/web/action-results.t b/t/web/action-results.t
index 1cd1b1f46..a68263a78 100644
--- a/t/web/action-results.t
+++ b/t/web/action-results.t
@@ -19,6 +19,7 @@ for my $quick (1, 0) {
             Subject => "The Plants",
             Content => "Please water them.",
         },
+        $quick ? () : ( button => 'SubmitTicket' ),
     }, "Submitted new ticket");
 
     my $id = RT::Test->last_ticket->id;
diff --git a/t/web/attach-from-txn.t b/t/web/attach-from-txn.t
index dd1ebda5c..8b59966c1 100644
--- a/t/web/attach-from-txn.t
+++ b/t/web/attach-from-txn.t
@@ -33,7 +33,7 @@ $m->content_contains("Create a new ticket", 'ticket create page');
 $m->form_name('TicketCreate');
 $m->field('Subject', 'Attachments test');
 $m->field('Content', 'Some content');
-$m->submit;
+$m->click('SubmitTicket');
 is($m->status, 200, "request successful");
 
 $m->content_contains('Attachments test', 'we have subject on the page');
diff --git a/t/web/attachment-with-name-0.t b/t/web/attachment-with-name-0.t
index 12a8dd548..9e3506831 100644
--- a/t/web/attachment-with-name-0.t
+++ b/t/web/attachment-with-name-0.t
@@ -17,6 +17,7 @@ $m->get_ok( '/Ticket/Create.html?Queue=1' );
 $m->submit_form(
     form_number => 3,
     fields => { Subject => 'test att 0', Content => 'test', Attach => $file },
+    button => 'SubmitTicket',
 );
 $m->content_like( qr/Ticket \d+ created/i, 'created the ticket' );
 $m->follow_link_ok( { text => 'Download 0' } );
diff --git a/t/web/attachment_dropping.t b/t/web/attachment_dropping.t
index 80a7c6f21..1345eb920 100644
--- a/t/web/attachment_dropping.t
+++ b/t/web/attachment_dropping.t
@@ -40,7 +40,7 @@ $m->field( 'Attach',  $path );
 $m->field( 'Content', 'Some content' );
 my $cf_content = 'cf' . 'a' x 998 . 'cfb';
 $m->field( "Object-RT::Ticket--CustomField-$cfid-Value", $cf_content );
-$m->submit;
+$m->click( 'SubmitTicket' );
 is( $m->status, 200, "request successful" );
 
 $m->content_contains( "File '$name' dropped because its size (1010 bytes) exceeded configured maximum size setting (1000 bytes).", 'dropped message' );
diff --git a/t/web/attachment_encoding.t b/t/web/attachment_encoding.t
index 3f7d6d1cf..05ed03bd3 100644
--- a/t/web/attachment_encoding.t
+++ b/t/web/attachment_encoding.t
@@ -21,6 +21,7 @@ diag 'test without attachments' if $ENV{TEST_VERBOSE};
     $m->submit_form(
         form_number => 3,
         fields      => { Subject => $subject, Content => $content },
+        button      => 'SubmitTicket',
     );
     $m->content_like( qr/Ticket \d+ created/i, 'created the ticket' );
     $m->follow_link_ok( { text => 'with headers' },
@@ -57,6 +58,7 @@ diag 'test with attachemnts' if $ENV{TEST_VERBOSE};
     $m->submit_form(
         form_number => 3,
         fields => { Subject => $subject, Content => $content, Attach => $file },
+        button      => 'SubmitTicket',
     );
     $m->content_like( qr/Ticket \d+ created/i, 'created the ticket' );
     $m->content_contains( $filename, 'attached filename' );
diff --git a/t/web/attachment_truncation.t b/t/web/attachment_truncation.t
index 1a2356bcb..1560aa7eb 100644
--- a/t/web/attachment_truncation.t
+++ b/t/web/attachment_truncation.t
@@ -39,7 +39,7 @@ $m->field( 'Attach',  $path );
 $m->field( 'Content', 'Some content' );
 my $cf_content = 'cf' . 'a' x 998 . 'cfb';
 $m->field( "Object-RT::Ticket--CustomField-$cfid-Value", $cf_content );
-$m->submit;
+$m->click( 'SubmitTicket' );
 is( $m->status, 200, "request successful" );
 
 $m->content_contains( "File '$name' truncated because its size (1010 bytes) exceeded configured maximum size setting (1000 bytes).", 'truncated message' );
diff --git a/t/web/attachments.t b/t/web/attachments.t
index d03d0a0b5..748916065 100644
--- a/t/web/attachments.t
+++ b/t/web/attachments.t
@@ -21,7 +21,7 @@ diag "w/o attachments";
 
     $m->form_name('TicketCreate');
     $m->content_contains("Create a new ticket", 'ticket create page');
-    $m->submit;
+    $m->click('SubmitTicket');
     is($m->status, 200, "request successful");
 }
 
@@ -34,7 +34,7 @@ diag "with one attachment";
     $m->field('Attach',  LogoFile);
     $m->field('Content', 'Some content');
 
-    $m->submit;
+    $m->click('SubmitTicket');
     is($m->status, 200, "request successful");
 
     $m->content_contains('Attachments test', 'we have subject on the page');
@@ -56,7 +56,7 @@ diag "with two attachments";
     $m->field('Subject', 'Attachments test');
     $m->field('Content', 'Some content');
 
-    $m->submit;
+    $m->click('SubmitTicket');
     is($m->status, 200, "request successful");
 
     $m->content_contains('Attachments test', 'we have subject on the page');
@@ -83,7 +83,7 @@ diag "with one attachment, but delete one along the way";
     $m->field('Subject', 'Attachments test');
     $m->field('Content', 'Some content');
 
-    $m->submit;
+    $m->click('SubmitTicket');
     is($m->status, 200, "request successful");
 
     $m->content_contains('Attachments test', 'we have subject on the page');
@@ -115,7 +115,7 @@ diag "with one attachment, but delete one along the way";
     $m->field('Subject', 'Attachments test');
     $m->field('Content', 'Some content');
 
-    $m->submit;
+    $m->click('SubmitTicket');
     is($m->status, 200, "request successful");
 
     $m->content_contains('Attachments test', 'we have subject on the page');
@@ -458,7 +458,7 @@ diag "check content type and content";
     $m->field('Subject', 'Attachments test');
     $m->field('Content', 'Some content');
 
-    $m->submit;
+    $m->click('SubmitTicket');
     is($m->status, 200, "request successful");
 
     $m->content_contains('Attachments test', 'we have subject on the page');
@@ -506,7 +506,7 @@ diag "update and create";
     $m->field('Attach',  FaviconFile);
     $m->field('Subject', 'Attachments test');
     $m->field('Content', 'Some content');
-    $m->submit;
+    $m->click('SubmitTicket');
     is($m->status, 200, "request successful");
 
     $m->content_lacks('Download bpslogo.png', 'page has file name');
diff --git a/t/web/basic.t b/t/web/basic.t
index 79c247d24..daf3743b8 100644
--- a/t/web/basic.t
+++ b/t/web/basic.t
@@ -29,7 +29,7 @@ my $url = $agent->rt_base_url;
     my $string = Encode::decode("UTF-8","I18N Web Testing æøå");
     $agent->field('Subject' => "Ticket with utf8 body");
     $agent->field('Content' => $string);
-    ok($agent->submit, "Created new ticket with $string as Content");
+    ok($agent->click('SubmitTicket'), "Created new ticket with $string as Content");
     $agent->content_contains($string, "Found the content");
     ok($agent->{redirected_uri}, "Did redirection");
 
@@ -51,7 +51,7 @@ my $url = $agent->rt_base_url;
     my $string = Encode::decode( "UTF-8","I18N Web Testing æøå");
     $agent->field('Subject' => $string);
     $agent->field('Content' => "Ticket with utf8 subject");
-    ok($agent->submit, "Created new ticket with $string as Content");
+    ok($agent->click('SubmitTicket'), "Created new ticket with $string as Content");
     $agent->content_contains($string, "Found the content");
     ok($agent->{redirected_uri}, "Did redirection");
 
diff --git a/t/web/cf_access.t b/t/web/cf_access.t
index aa707f5dc..5ac285c2e 100644
--- a/t/web/cf_access.t
+++ b/t/web/cf_access.t
@@ -139,6 +139,7 @@ diag "check that we have no the CF on the create"
     $m->submit_form(
         form_name => "TicketCreate",
         fields => { Subject => 'test' },
+        button => 'SubmitTicket',
     );
     $m->content_like(qr/Ticket \d+ created/, "a ticket is created succesfully");
 
@@ -169,6 +170,7 @@ diag "check that we have no the CF on the create"
     $m->submit_form(
         form_name => "TicketCreate",
         fields => { Subject => 'test' },
+        button => 'SubmitTicket',
     );
     $tid = $1 if $m->content =~ /Ticket (\d+) created/i;
     ok $tid, "a ticket is created succesfully";
@@ -203,6 +205,7 @@ diag "create a ticket with an image";
             $upload_field => ImageFile,
             Subject => 'testing img cf creation',
         },
+        button => 'SubmitTicket',
     );
 
     $m->content_like(qr/Ticket \d+ created/, "a ticket is created succesfully");
diff --git a/t/web/cf_date.t b/t/web/cf_date.t
index b3b7dcc28..82e44ba96 100644
--- a/t/web/cf_date.t
+++ b/t/web/cf_date.t
@@ -67,6 +67,7 @@ diag 'check valid inputs with various timezones in ticket create page';
             Content                                       => 'test',
             "Object-RT::Ticket--CustomField-$cfid-Values" => '2010-05-04',
         },
+        button => 'SubmitTicket',
     );
     ok( ($id) = $m->content =~ /Ticket (\d+) created/, "created ticket $id" );
 
@@ -178,6 +179,7 @@ diag 'check invalid inputs';
             Content                                       => 'test',
             "Object-RT::Ticket--CustomField-$cfid-Values" => 'foodate',
         },
+        button => 'SubmitTicket',
     );
     $m->content_like( qr/Ticket \d+ created/,
         "a ticket is created succesfully" );
@@ -238,7 +240,7 @@ diag 'retain values when adding attachments';
     is( $m->value( "Object-RT::Transaction--CustomField-$txn_cfid-Values" ),
         "2015-08-15", "txn cf date date value still on form" );
 
-    $m->submit_form();
+    $m->click('SubmitTicket');
     ok( ($id) = $m->content =~ /Ticket (\d+) created/, "created ticket $id" );
 
     $m->follow_link_ok( {text => 'Reply'} );
diff --git a/t/web/cf_datetime.t b/t/web/cf_datetime.t
index 044555358..5817c8f43 100644
--- a/t/web/cf_datetime.t
+++ b/t/web/cf_datetime.t
@@ -75,6 +75,7 @@ diag 'check valid inputs with various timezones in ticket create page';
             Content                                       => 'test',
             "Object-RT::Ticket--CustomField-$cfid-Values" => '2010-05-04 13:00:01',
         },
+        button    => 'SubmitTicket',
     );
     ok( ($id) = $m->content =~ /Ticket (\d+) created/,
         "created ticket $id" );
@@ -114,6 +115,7 @@ diag 'check valid inputs with various timezones in ticket create page';
             Content                                       => 'test',
             "Object-RT::Ticket--CustomField-$cfid-Values" => '2010-05-06 07:00:01',
         },
+        button    => 'SubmitTicket',
     );
     ok( ($id) = $m->content =~ /Ticket (\d+) created/,
         "created ticket $id" );
@@ -205,6 +207,7 @@ diag 'check invalid inputs';
             Content                                       => 'test',
             "Object-RT::Ticket--CustomField-$cfid-Values" => 'foodate',
         },
+        button    => 'SubmitTicket',
     );
     $m->content_like(qr/Ticket \d+ created/, "a ticket is created succesfully");
 
@@ -266,7 +269,7 @@ diag 'retain values when adding attachments';
         "2015-08-15 12:30:30", "txn cf date date value still on form" );
     $m->content_contains( "Aug 15 12:30:30 2015", 'date in parens' );
 
-    $m->submit_form();
+    $m->click( 'SubmitTicket' );
     ok( ($id) = $m->content =~ /Ticket (\d+) created/, "Created ticket $id" );
 
     $m->follow_link_ok( {text => 'Reply'} );
diff --git a/t/web/cf_groupings.t b/t/web/cf_groupings.t
index a872617c4..6a06efac2 100644
--- a/t/web/cf_groupings.t
+++ b/t/web/cf_groupings.t
@@ -52,7 +52,7 @@ my %location = (
         ok $dom->at(qq{$location{$grouping} input[name="$input_name"]}), "CF is in the right place";
         $m->field( $input_name, "Test" . $grouping . "Value" );
     }
-    $m->submit;
+    $m->click('SubmitTicket');
 }
 
 my $id = $m->get_ticket_id;
@@ -168,7 +168,7 @@ my $id = $m->get_ticket_id;
         ok $dom->at(qq{$location{$grouping} input[name="$input_name"]}), "CF is in the right place";
         $m->field( $input_name, "TestMoreValue" );
     }
-    $m->submit;
+    $m->click('SubmitTicket');
     $m->no_warnings_ok( "Submitting CF with two (identical) values had no warnings" );
 }
 
diff --git a/t/web/cf_image.t b/t/web/cf_image.t
index 7c294b847..c2c868bca 100644
--- a/t/web/cf_image.t
+++ b/t/web/cf_image.t
@@ -37,6 +37,7 @@ $m->submit_form_ok({
         Subject => 'Test ticket',
         Content => 'test',
     },
+    button    => 'SubmitTicket',
 });
 $m->content_like( qr/Ticket \d+ created/,
                   "a ticket is created succesfully" );
diff --git a/t/web/cf_pattern.t b/t/web/cf_pattern.t
index 95fae50b3..0f5863bfc 100644
--- a/t/web/cf_pattern.t
+++ b/t/web/cf_pattern.t
@@ -38,6 +38,7 @@ for my $page ("/Ticket/Create.html?Queue=1", "/Ticket/Modify.html?id=".$ticket->
             $cfinput            => "too many",
             "${cfinput}-Magic" => "1",
         },
+        $page =~ /Create/ ? ( button => 'SubmitTicket' ) : (),
     });
     $m->content_contains("Input must match [Digits]");
     $m->content_contains("cfinvalidfield");
@@ -47,6 +48,7 @@ for my $page ("/Ticket/Create.html?Queue=1", "/Ticket/Modify.html?id=".$ticket->
             $cfinput            => "42",
             "${cfinput}-Magic" => "1",
         },
+        $page =~ /Create/ ? ( button => 'SubmitTicket' ) : (),
     });
 
     if ($page =~ /Create/) {
diff --git a/t/web/cf_set_initial.t b/t/web/cf_set_initial.t
index 0cf4f68b3..845a6fb8b 100644
--- a/t/web/cf_set_initial.t
+++ b/t/web/cf_set_initial.t
@@ -47,6 +47,7 @@ diag "check that we have no CFs on the create"
     $m->submit_form(
         form_name => "TicketCreate",
         fields => { Subject => 'test' },
+        button => 'SubmitTicket',
     );
     $m->content_like(qr/Ticket \d+ created/, "a ticket is created succesfully");
 
@@ -86,6 +87,7 @@ diag "check that we have the CF on the create"
             $multi_field => 'hiro',
             Subject => 'test 2',
         },
+        button => 'SubmitTicket',
     );
     $m->content_like(qr/Ticket \d+ created/, "a ticket is created succesfully");
     if (my ($id) = $m->content =~ /Ticket (\d+) created/) {
diff --git a/t/web/crypt-gnupg.t b/t/web/crypt-gnupg.t
index 790225c88..fed621ce4 100644
--- a/t/web/crypt-gnupg.t
+++ b/t/web/crypt-gnupg.t
@@ -59,7 +59,7 @@ $m->field('Subject', 'Encryption test');
 $m->field('Content', 'Some content');
 ok($m->value('Encrypt', 2), "encrypt tick box is checked");
 ok(!$m->value('Sign', 2), "sign tick box is unchecked");
-$m->submit;
+$m->click('SubmitTicket');
 is($m->status, 200, "request successful");
 
 $m->get($baseurl); # ensure that the mail has been processed
@@ -128,7 +128,7 @@ $m->field('Subject', 'Signing test');
 $m->field('Content', 'Some other content');
 ok(!$m->value('Encrypt', 2), "encrypt tick box is unchecked");
 ok($m->value('Sign', 2), "sign tick box is checked");
-$m->submit;
+$m->click('SubmitTicket');
 is($m->status, 200, "request successful");
 
 $m->get($baseurl); # ensure that the mail has been processed
@@ -201,7 +201,7 @@ $m->field('Subject', 'Crypt+Sign test');
 $m->field('Content', 'Some final? content');
 ok($m->value('Encrypt', 2), "encrypt tick box is checked");
 ok($m->value('Sign', 2), "sign tick box is checked");
-$m->submit;
+$m->click('SubmitTicket');
 is($m->status, 200, "request successful");
 
 $m->get($baseurl); # ensure that the mail has been processed
@@ -267,7 +267,7 @@ $m->field('Content', 'Thought you had me figured out didya');
 $m->field(Encrypt => undef, 2); # turn off encryption
 ok(!$m->value('Encrypt', 2), "encrypt tick box is now unchecked");
 ok($m->value('Sign', 2), "sign tick box is still checked");
-$m->submit;
+$m->click('SubmitTicket');
 is($m->status, 200, "request successful");
 
 $m->get($baseurl); # ensure that the mail has been processed
diff --git a/t/web/csrf.t b/t/web/csrf.t
index bdd895d92..d95df8881 100644
--- a/t/web/csrf.t
+++ b/t/web/csrf.t
@@ -192,7 +192,7 @@ $m->field('Attach',  $logofile);
 
 # Lose the referer before the POST
 $m->add_header(Referer => undef);
-$m->submit;
+$m->click('SubmitTicket');
 $m->content_contains("Possible cross-site request forgery");
 $m->content_contains("If you really intended to visit <tt>$baseurl/Ticket/Create.html</tt>");
 $m->follow_link(text_regex => qr{resume your request});
diff --git a/t/web/gnupg-headers.t b/t/web/gnupg-headers.t
index 03e60901e..bcf69a593 100644
--- a/t/web/gnupg-headers.t
+++ b/t/web/gnupg-headers.t
@@ -31,7 +31,7 @@ $m->goto_create_ticket($queue);
 $m->form_name('TicketCreate');
 $m->field( 'Subject', 'Signing test' );
 $m->field( 'Content', 'Some other content' );
-$m->submit;
+$m->click( 'SubmitTicket' );
 $m->content_like( qr/Ticket \d+ created/i, 'created the ticket' );
 $m->follow_link_ok( { text => 'with headers' } );
 $m->content_contains('X-RT-Encrypt: 0');
@@ -45,7 +45,7 @@ $m->field( 'Subject', 'Signing test' );
 $m->field( 'Content', 'Some other content' );
 $m->tick( 'Encrypt', 1 );
 $m->tick( 'Sign',    1 );
-$m->submit;
+$m->click( 'SubmitTicket' );
 $m->content_like( qr/Ticket \d+ created/i, 'created the ticket' );
 $m->follow_link_ok( { text => 'with headers' } );
 $m->content_contains('X-RT-Encrypt: 1');
diff --git a/t/web/gnupg-select-keys-on-create.t b/t/web/gnupg-select-keys-on-create.t
index 2b9a68083..776fe7084 100644
--- a/t/web/gnupg-select-keys-on-create.t
+++ b/t/web/gnupg-select-keys-on-create.t
@@ -23,7 +23,7 @@ diag "check that signing doesn't work if there is no key";
     $m->tick( Sign => 1 );
     $m->field( Requestors => 'rt-test at example.com' );
     $m->field( Content => 'Some content' );
-    $m->submit;
+    $m->click( 'SubmitTicket' );
     $m->content_contains(
         'unable to sign outgoing email messages',
         'problems with passphrase'
@@ -50,7 +50,7 @@ diag "check that things don't work if there is no key";
     $m->tick( Encrypt => 1 );
     $m->field( Requestors => 'rt-test at example.com' );
     $m->field( Content => 'Some content' );
-    $m->submit;
+    $m->click( 'SubmitTicket' );
     $m->content_contains(
         'You are going to encrypt outgoing email messages',
         'problems with keys'
@@ -88,7 +88,7 @@ diag "check that things still doesn't work if key is not trusted";
     $m->tick( Encrypt => 1 );
     $m->field( Requestors => 'rt-test at example.com' );
     $m->field( Content => 'Some content' );
-    $m->submit;
+    $m->click( 'SubmitTicket' );
     $m->content_contains(
         'You are going to encrypt outgoing email messages',
         'problems with keys'
@@ -103,7 +103,7 @@ diag "check that things still doesn't work if key is not trusted";
     is scalar $input->possible_values, 1, 'one option';
 
     $m->select( 'UseKey-rt-test at example.com' => $fpr1 );
-    $m->submit;
+    $m->click( 'SubmitTicket' );
     $m->content_contains(
         'You are going to encrypt outgoing email messages',
         'problems with keys'
@@ -137,7 +137,7 @@ diag "check that things still doesn't work if two keys are not trusted";
     $m->tick( Encrypt => 1 );
     $m->field( Requestors => 'rt-test at example.com' );
     $m->field( Content => 'Some content' );
-    $m->submit;
+    $m->click( 'SubmitTicket' );
     $m->content_contains(
         'You are going to encrypt outgoing email messages',
         'problems with keys'
@@ -152,7 +152,7 @@ diag "check that things still doesn't work if two keys are not trusted";
     is scalar $input->possible_values, 2, 'two options';
 
     $m->select( 'UseKey-rt-test at example.com' => $fpr1 );
-    $m->submit;
+    $m->click( 'SubmitTicket' );
     $m->content_contains(
         'You are going to encrypt outgoing email messages',
         'problems with keys'
@@ -184,7 +184,7 @@ diag "check that we see key selector even if only one key is trusted but there a
     $m->tick( Encrypt => 1 );
     $m->field( Requestors => 'rt-test at example.com' );
     $m->field( Content => 'Some content' );
-    $m->submit;
+    $m->click( 'SubmitTicket' );
     $m->content_contains(
         'You are going to encrypt outgoing email messages',
         'problems with keys'
@@ -213,7 +213,7 @@ diag "check that key selector works and we can select trusted key";
     $m->tick( Encrypt => 1 );
     $m->field( Requestors => 'rt-test at example.com' );
     $m->field( Content => 'Some content' );
-    $m->submit;
+    $m->click( 'SubmitTicket' );
     $m->content_contains(
         'You are going to encrypt outgoing email messages',
         'problems with keys'
@@ -228,7 +228,7 @@ diag "check that key selector works and we can select trusted key";
     is scalar $input->possible_values, 2, 'two options';
 
     $m->select( 'UseKey-rt-test at example.com' => $fpr1 );
-    $m->submit;
+    $m->click( 'SubmitTicket' );
     $m->content_like( qr/Ticket \d+ created in queue/i, 'ticket created' );
 
     my @mail = RT::Test->fetch_caught_mails;
@@ -249,7 +249,7 @@ for my $encrypt (0, 1) {
     $m->field( Cc => 'rt-test at example.com' );
     $m->field( Content => 'Some content' );
     $m->field( Attach => $0 );
-    $m->submit;
+    $m->click( 'SubmitTicket' );
 
     if ($encrypt) {
         $m->content_contains(
@@ -266,7 +266,7 @@ for my $encrypt (0, 1) {
         is scalar $input->possible_values, 2, 'two options';
 
         $m->select( 'UseKey-rt-test at example.com' => $fpr1 );
-        $m->submit;
+        $m->click( 'SubmitTicket' );
     }
 
     $m->content_like( qr/Ticket \d+ created in queue/i, 'ticket created' );
diff --git a/t/web/html_template.t b/t/web/html_template.t
index 1dbe66b00..e4def1f61 100644
--- a/t/web/html_template.t
+++ b/t/web/html_template.t
@@ -44,6 +44,7 @@ diag('create a ticket to see the autoreply mail') if $ENV{TEST_VERBOSE};
         form_name => 'TicketCreate',
         fields      => { Subject => $subject, Content => "<h1>$content</h1>",
         ContentType => 'text/html' },
+        button      => 'SubmitTicket',
     );
     $m->content_like( qr/Ticket \d+ created/i, 'created the ticket' );
     $m->follow_link( text => 'Show' );
diff --git a/t/web/smime/outgoing.t b/t/web/smime/outgoing.t
index 2f80c7ec3..ea3bc7ebe 100644
--- a/t/web/smime/outgoing.t
+++ b/t/web/smime/outgoing.t
@@ -256,7 +256,7 @@ sub create_a_ticket {
         }
     }
 
-    $m->submit;
+    $m->click('SubmitTicket');
     is $m->status, 200, "request successful";
 
     unlike($m->content, qr/unable to sign outgoing email messages/);
diff --git a/t/web/ticket-create-utf8.t b/t/web/ticket-create-utf8.t
index 76a7360b7..2baaef5ca 100644
--- a/t/web/ticket-create-utf8.t
+++ b/t/web/ticket-create-utf8.t
@@ -29,7 +29,7 @@ foreach my $test_str ( $ru_test, $l1_test ) {
     ok $m->goto_create_ticket( $q ), "go to create ticket";
     $m->form_name('TicketCreate');
     $m->field( Subject => $test_str );
-    $m->submit;
+    $m->click( 'SubmitTicket' );
 
     $m->content_like( 
         qr{<td\s+class="message-header-value\s*"[^>]*>\s*\Q$test_str\E\s*</td>}i,
@@ -47,7 +47,7 @@ foreach my $test_str ( $ru_test, $l1_test ) {
         $m->form_name('TicketCreate');
         $m->field( Subject => $test_str );
         $m->field( Content => $support_str );
-        $m->submit;
+        $m->click( 'SubmitTicket' );
 
         $m->content_like( 
             qr{<td\s+class="message-header-value\s*"[^>]*>\s*\Q$test_str\E\s*</td>}i,
@@ -70,7 +70,7 @@ foreach my $test_str ( $ru_test, $l1_test ) {
         $m->form_name('TicketCreate');
         $m->field( Subject => $test_str );
         $m->field( Content => $support_str );
-        $m->submit;
+        $m->click( 'SubmitTicket' );
 
         $m->content_like( 
             qr{<td\s+class="message-header-value\s*"[^>]*>\s*\Q$test_str\E\s*</td>}i,
diff --git a/t/web/ticket_display.t b/t/web/ticket_display.t
index 7183b5ea7..7cb11cd06 100644
--- a/t/web/ticket_display.t
+++ b/t/web/ticket_display.t
@@ -31,7 +31,7 @@ diag "test ShowTicket right";
     $m->get_ok( '/Ticket/Create.html?Queue=' . $queue->id,
         'go to ticket create page' );
     my $form = $m->form_name('TicketCreate');
-    $m->submit_form( fields => { Subject => 'ticket foo', $cf_form_id => $cf_test_value } );
+    $m->submit_form( fields => { Subject => 'ticket foo', $cf_form_id => $cf_test_value }, button => 'SubmitTicket' );
 
     my $ticket = RT::Test->last_ticket;
     ok( $ticket->id, 'ticket is created' );
diff --git a/t/web/ticket_forward.t b/t/web/ticket_forward.t
index c0c740ec5..f92ba555d 100644
--- a/t/web/ticket_forward.t
+++ b/t/web/ticket_forward.t
@@ -22,6 +22,7 @@ $m->submit_form(
         Content => 'this is content',
         Attach  => $att_file,
     },
+    button    => 'SubmitTicket',
 );
 $m->content_like( qr/Ticket \d+ created/i, 'created the ticket' );
 RT::Test->clean_caught_mails;
@@ -122,7 +123,7 @@ diag "Forward Transaction with attachments but empty content" if $ENV{TEST_VERBO
     $m->set_fields(
         Attach  => RT::Test::get_relocatable_file('bpslogo.png', '..', 'data'), # an image!
     );
-    $m->submit;
+    $m->click( 'SubmitTicket' );
     $m->content_like( qr/Ticket \d+ created/i,  'created the ticket' );
     $m->content_like( qr/awesome.p\%C3\%A1tch/, 'uploaded patch file' );
     $m->content_like( qr/text\/x-diff/,     'uploaded patch file content type' );
diff --git a/t/web/ticket_links.t b/t/web/ticket_links.t
index 3f7f384b5..71e4c8b17 100644
--- a/t/web/ticket_links.t
+++ b/t/web/ticket_links.t
@@ -80,7 +80,7 @@ for my $type ( "DependsOn", "MemberOf", "RefersTo" ) {
                 $m->field( "$type-new", "$deleted_id $active_id $inactive_id" );
             }
 
-            $m->submit;
+            $m->click('SubmitTicket');
             $m->content_like(qr/Ticket \d+ created/, 'created ticket');
             $m->content_contains("Linking to a deleted ticket is not allowed");
             $id = RT::Test->last_ticket->id;
diff --git a/t/web/ticket_owner.t b/t/web/ticket_owner.t
index abce05a82..7d0c5b513 100644
--- a/t/web/ticket_owner.t
+++ b/t/web/ticket_owner.t
@@ -44,7 +44,7 @@ diag "current user has no right to own, nobody selected as owner on create";
     is $form->value('Owner'), RT->Nobody->id, 'correct owner selected';
     ok !grep($_ == $user_a->id, $form->find_input('Owner')->possible_values),
         'user A can not own tickets';
-    $agent_a->submit;
+    $agent_a->click('SubmitTicket');
 
     $agent_a->content_like(qr/Ticket \d+ created in queue/i, 'created ticket');
     my ($id) = ($agent_a->content =~ /Ticket (\d+) created in queue/);
@@ -70,7 +70,7 @@ diag "user can chose owner of a new ticket";
     ok grep($_ == $user_b->id,  $form->find_input('Owner')->possible_values),
         'user B is listed as potential owner';
     $agent_a->select('Owner', $user_b->id);
-    $agent_a->submit;
+    $agent_a->click('SubmitTicket');
 
     $agent_a->content_like(qr/Ticket \d+ created in queue/i, 'created ticket');
     my ($id) = ($agent_a->content =~ /Ticket (\d+) created in queue/);
diff --git a/t/web/ticket_owner_autocomplete.t b/t/web/ticket_owner_autocomplete.t
index 040aa7323..6cff7e1bd 100644
--- a/t/web/ticket_owner_autocomplete.t
+++ b/t/web/ticket_owner_autocomplete.t
@@ -39,7 +39,7 @@ diag "current user has no right to own, nobody selected as owner on create";
     my $form = $agent_a->form_name('TicketCreate');
     is $form->value('Owner'), RT->Nobody->Name, 'correct owner selected';
     autocomplete_lacks( 'RT::Queue-'.$queue->id, 'user_a' );
-    $agent_a->submit;
+    $agent_a->click('SubmitTicket');
 
     $agent_a->content_like(qr/Ticket \d+ created in queue/i, 'created ticket');
     my ($id) = ($agent_a->content =~ /Ticket (\d+) created in queue/);
@@ -64,7 +64,7 @@ diag "user can chose owner of a new ticket";
 
     autocomplete_contains( 'RT::Queue-'.$queue->id, 'user_b' );
     $form->value('Owner', $user_b->Name);
-    $agent_a->submit;
+    $agent_a->click('SubmitTicket');
 
     $agent_a->content_like(qr/Ticket \d+ created in queue/i, 'created ticket');
     my ($id) = ($agent_a->content =~ /Ticket (\d+) created in queue/);
diff --git a/t/web/ticket_owner_issues_16656.t b/t/web/ticket_owner_issues_16656.t
index c9fc7830e..2f72a999a 100644
--- a/t/web/ticket_owner_issues_16656.t
+++ b/t/web/ticket_owner_issues_16656.t
@@ -37,7 +37,7 @@ diag "user_a doesn't show up in create form";
     is $input->value, RT->Nobody->Id, 'correct owner selected';
     ok((not scalar grep { $_ == $user_a->Id } $input->possible_values), 'no user_a value in dropdown');
     $form->value('Requestors', 'user_a at example.com');
-    $agent_root->submit;
+    $agent_root->click('SubmitTicket');
 
     $agent_root->content_like(qr/Ticket \d+ created in queue/i, 'created ticket');
     my ($id) = ($agent_root->content =~ /Ticket (\d+) created in queue/);
diff --git a/t/web/ticket_preserve_basics.t b/t/web/ticket_preserve_basics.t
index db95ee3fd..b51bdafbd 100644
--- a/t/web/ticket_preserve_basics.t
+++ b/t/web/ticket_preserve_basics.t
@@ -95,7 +95,7 @@ for my $try (@form_tries) {
     $m->goto_create_ticket(1);
     $m->form_name('TicketCreate');
     $m->set_fields(%$try);
-    $m->submit();
+    $m->click('SubmitTicket');
     $m->form_name('TicketCreate');
     for my $field (keys %$try) {
         is(
diff --git a/t/web/ticket_txn_cf.t b/t/web/ticket_txn_cf.t
index 42a37720a..0767c487b 100644
--- a/t/web/ticket_txn_cf.t
+++ b/t/web/ticket_txn_cf.t
@@ -65,6 +65,7 @@ diag 'submit value on ticket create page';
             Content                                            => 'test',
             "Object-RT::Transaction--CustomField-$cfid-Values" => 'hello from create',
         },
+        button => 'SubmitTicket',
     );
     ok( ($id) = $m->content =~ /Ticket (\d+) created/, "created ticket $id" );
 
diff --git a/t/web/ticket_txn_content.t b/t/web/ticket_txn_content.t
index 096d78e31..35b8c0af3 100644
--- a/t/web/ticket_txn_content.t
+++ b/t/web/ticket_txn_content.t
@@ -49,7 +49,7 @@ for my $type ( 'text/plain', 'text/html' ) {
     $m->field( 'Attach',  $plain_file );
     $m->field( 'Content', 'this is main content' );
     $m->field( 'ContentType', $type ) unless $type eq 'text/plain';
-    $m->submit;
+    $m->click( 'SubmitTicket' );
     is( $m->status, 200, "request successful" );
     $m->content_contains('with plain attachment',
         'we have subject on the page' );
diff --git a/t/web/ticket_txn_subject.t b/t/web/ticket_txn_subject.t
index 553c0b59d..f9bfafbc6 100644
--- a/t/web/ticket_txn_subject.t
+++ b/t/web/ticket_txn_subject.t
@@ -30,6 +30,7 @@ diag "create a ticket via the web";
         with_fields => {
             Subject => Encode::decode("UTF-8",'bad subject #2‽'),
         },
+        button      => 'SubmitTicket',
     }, 'create ticket');
     $m->content_contains(Encode::decode("UTF-8",'bad subject #2‽'), 'correct subject');
     push @tickets, 2;
@@ -44,6 +45,7 @@ diag "create a ticket via the web without a unicode subject";
         with_fields => {
             Subject => 'a fine subject #3',
         },
+        button      => 'SubmitTicket',
     }, 'create ticket');
     $m->content_contains('a fine subject #3', 'correct subject');
     push @tickets, 3;

commit 930da784cab2dc974a8295c51bd7493396c446a7
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue Nov 6 10:47:59 2018 +0800

    Drop HotList column for Classes
    
    With the new article selection UI, all the articles applied accordingly
    will show up.

diff --git a/etc/initialdata b/etc/initialdata
index e65066185..74951a5b8 100644
--- a/etc/initialdata
+++ b/etc/initialdata
@@ -929,7 +929,6 @@ Hour:         { $SubscriptionObj->SubValue('Hour') }
     {
         Name              => 'General',
         Description       => 'The default class',
-        HotList           => 1,
     },
 );
 
diff --git a/etc/schema.Oracle b/etc/schema.Oracle
index b3e677b82..102f134dd 100644
--- a/etc/schema.Oracle
+++ b/etc/schema.Oracle
@@ -422,8 +422,7 @@ Disabled NUMBER(11,0) DEFAULT 0 NOT NULL,
 Creator NUMBER(11,0) DEFAULT 0 NOT NULL,
 Created DATE,
 LastUpdatedBy NUMBER(11,0) DEFAULT 0 NOT NULL,
-LastUpdated DATE,
-HotList NUMBER(11,0) DEFAULT 0 NOT NULL
+LastUpdated DATE
 );
 
 CREATE SEQUENCE Articles_seq;
diff --git a/etc/schema.Pg b/etc/schema.Pg
index aa4b437e0..3836c2667 100644
--- a/etc/schema.Pg
+++ b/etc/schema.Pg
@@ -656,7 +656,6 @@ Creator integer NOT NULL DEFAULT 0,
 Created TIMESTAMP NULL,
 LastUpdatedBy integer NOT NULL DEFAULT 0,
 LastUpdated TIMESTAMP NULL,
-HotList smallint NOT NULL DEFAULT 0,
 PRIMARY KEY (id)
 );
 
diff --git a/etc/schema.SQLite b/etc/schema.SQLite
index f8e6ae932..b6d286727 100644
--- a/etc/schema.SQLite
+++ b/etc/schema.SQLite
@@ -463,8 +463,7 @@ Disabled smallint NOT NULL DEFAULT 0,
 Creator integer NOT NULL DEFAULT 0,
 Created TIMESTAMP NULL,
 LastUpdatedBy integer NOT NULL DEFAULT 0,
-LastUpdated TIMESTAMP NULL,
-HotList smallint NOT NULL DEFAULT 0
+LastUpdated TIMESTAMP NULL
 );
 
 CREATE TABLE Articles (
diff --git a/etc/schema.mysql b/etc/schema.mysql
index eefc145ca..cb87d86a3 100644
--- a/etc/schema.mysql
+++ b/etc/schema.mysql
@@ -448,7 +448,6 @@ CREATE TABLE Classes (
   Created datetime default NULL,
   LastUpdatedBy int(11) NOT NULL default '0',
   LastUpdated datetime default NULL,
-  HotList int(2) NOT NULL default '0',
   PRIMARY KEY  (id)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
diff --git a/etc/upgrade/4.5.0/schema.Oracle b/etc/upgrade/4.5.0/schema.Oracle
new file mode 100644
index 000000000..b18ad9c97
--- /dev/null
+++ b/etc/upgrade/4.5.0/schema.Oracle
@@ -0,0 +1 @@
+ALTER TABLE Classes DROP( HotList );
diff --git a/etc/upgrade/4.5.0/schema.Pg b/etc/upgrade/4.5.0/schema.Pg
new file mode 100644
index 000000000..3dae347fa
--- /dev/null
+++ b/etc/upgrade/4.5.0/schema.Pg
@@ -0,0 +1 @@
+ALTER TABLE Scrips DROP COLUMN HotList;
diff --git a/etc/upgrade/4.5.0/schema.mysql b/etc/upgrade/4.5.0/schema.mysql
new file mode 100644
index 000000000..3dae347fa
--- /dev/null
+++ b/etc/upgrade/4.5.0/schema.mysql
@@ -0,0 +1 @@
+ALTER TABLE Scrips DROP COLUMN HotList;
diff --git a/lib/RT/Articles.pm b/lib/RT/Articles.pm
index 1e203a30c..b54038178 100644
--- a/lib/RT/Articles.pm
+++ b/lib/RT/Articles.pm
@@ -479,24 +479,6 @@ sub LimitReferredToBy {
 
 # }}}
 
-=head2 LimitHostlistClasses
-
-Only fetch Articles from classes where Hotlist is true.
-
-=cut
-
-sub LimitHotlistClasses {
-    my $self = shift;
-
-    my $classes = $self->Join(
-        ALIAS1 => 'main',
-        FIELD1 => 'Class',
-        TABLE2 => 'Classes',
-        FIELD2 => 'id',
-    );
-    $self->Limit( ALIAS => $classes, FIELD => 'HotList', VALUE => 1 );
-}
-
 =head2 LimitAppliedClasses Queue => QueueObj
 
 Takes a Queue and limits articles returned to classes which are applied to that Queue
diff --git a/lib/RT/Class.pm b/lib/RT/Class.pm
index 7784a3b9f..3bd2b704f 100644
--- a/lib/RT/Class.pm
+++ b/lib/RT/Class.pm
@@ -117,7 +117,6 @@ sub Create {
         Name        => '',
         Description => '',
         SortOrder   => '0',
-        HotList     => 0,
         @_
     );
 
@@ -135,7 +134,6 @@ sub Create {
         Name        => $args{'Name'},
         Description => $args{'Description'},
         SortOrder   => $args{'SortOrder'},
-        HotList     => $args{'HotList'},
     );
 
 }
@@ -474,24 +472,6 @@ Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
 =cut
 
 
-=head2 HotList
-
-Returns the current value of HotList. 
-(In the database, HotList is stored as int(2).)
-
-
-
-=head2 SetHotList VALUE
-
-
-Set HotList to VALUE. 
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, HotList will be stored as a int(2).)
-
-
-=cut
-
-
 =head2 Creator
 
 Returns the current value of Creator. 
@@ -542,8 +522,6 @@ sub _CoreAccessible {
                 {read => 1, write => 1, type => 'int(11)', default => '0'},
         Disabled => 
                 {read => 1, write => 1, type => 'int(2)', default => '0'},
-        HotList => 
-                {read => 1, write => 1, type => 'int(2)', default => '0'},
         Creator => 
                 {read => 1, auto => 1, type => 'int(11)', default => '0'},
         Created => 
diff --git a/share/html/Admin/Articles/Classes/Modify.html b/share/html/Admin/Articles/Classes/Modify.html
index f69a1601d..ccd997645 100644
--- a/share/html/Admin/Articles/Classes/Modify.html
+++ b/share/html/Admin/Articles/Classes/Modify.html
@@ -73,13 +73,6 @@
     <label for="Enabled"><&|/l&>Enabled (Unchecking this box disables this class)</&></label>
 </td>
 </tr>
-<tr>
-<td> </td>
-<td>
-    <input type="checkbox" id="HotList" name="HotList" value="1" <%$HotListChecked%>>
-    <label for="HotList"><&|/l&>All Articles in this class should be listed in a dropdown of the ticket reply page</&></label>
-</td>
-</tr>
 </table>
 
 <h3><&|/l&>When inserting articles in this class into emails:</&></h3>
@@ -176,8 +169,7 @@ if ($ClassObj->Id()) {
         );
     }
 
-    $ARGS{HotList} ||= 0 if $Submitted;
-    my @attribs= qw(Description Name HotList SubjectOverride);
+    my @attribs= qw(Description Name SubjectOverride);
     $m->callback( CallbackName => 'AttributeList', Attributes => \@attribs, ARGSRef => \%ARGS );
     push @results, UpdateRecordObject( AttributesRef => \@attribs,
                                        Object => $ClassObj,
@@ -234,7 +226,6 @@ if ( $ClassObj->id ) {
 $include{$_} = $include{$_} ? " CHECKED" : "" for keys %include;
 
 my $EnabledChecked = ($Create ? $Disabled : $ClassObj->Disabled()) ? "" : "CHECKED";
-my $HotListChecked = $ClassObj->id && $ClassObj->HotList ? "CHECKED" : "";
 </%INIT>
 
 
diff --git a/t/articles/queue-specific-class.t b/t/articles/queue-specific-class.t
index 7bc985eb7..cecea5a5c 100644
--- a/t/articles/queue-specific-class.t
+++ b/t/articles/queue-specific-class.t
@@ -18,7 +18,7 @@ for my $name ( keys %class ) {
 
     $m->submit_form(
         form_number => 3,
-        fields      => { Name => $name, HotList => 1 },
+        fields      => { Name => $name },
     );
 
     $m->content_contains( "Modify the Class $name",

-----------------------------------------------------------------------


More information about the rt-commit mailing list