[Rt-commit] rt branch, 4.2/error-cleanup, created. rt-4.1.6-348-g9c2c6b2

Alex Vandiver alexmv at bestpractical.com
Wed Mar 13 21:19:06 EDT 2013


The branch, 4.2/error-cleanup has been created
        at  9c2c6b23c8bb8654932fcee5044455075f9b6e7c (commit)

- Log -----------------------------------------------------------------
commit 1520657d13755c2e56197bd8303610edae679469
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Wed Mar 13 20:59:44 2013 -0400

    Remove old $Code argument, and stop passing $Why up to Header
    
    $Code was excised in RT 2.1, in 4137c44, which also removed any reason
    to pass $Why to the header.

diff --git a/share/html/Elements/Error b/share/html/Elements/Error
index 6a9edc4..1ec81c8 100644
--- a/share/html/Elements/Error
+++ b/share/html/Elements/Error
@@ -48,7 +48,7 @@
 % $m->callback( %ARGS, error => $error );
 
 % unless ($SuppressHeader) {
-<& /Elements/Header, Code => $Code, Why => $Why, Title => $Title &>
+<& /Elements/Header, Title => $Title &>
 <& /Elements/Tabs &>
 % }
 
@@ -67,7 +67,6 @@ $m->abort();
 
 <%args>
 $Actions => []
-$Code => undef
 $Details => ''
 $Title => loc("RT Error")
 $Why => loc("the calling component did not specify why"),
diff --git a/share/html/Elements/Header b/share/html/Elements/Header
index 481b8d1..cc1d4f5 100644
--- a/share/html/Elements/Header
+++ b/share/html/Elements/Header
@@ -138,9 +138,7 @@ else {
 #$Focus => 'focus'
 $Focus => ''
 $Title =>  'RT'
-$Code => undef
 $Refresh => 0
-$Why => undef
 $ShowBar => 1
 $URL => undef
 $RSSAutoDiscovery => undef

commit b586cec7271e97d423c3b56ef42e6dba4734042e
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Wed Mar 13 21:03:21 2013 -0400

    Remove <%cleanup> block, which just obfuscates things

diff --git a/share/html/Elements/Error b/share/html/Elements/Error
index 1ec81c8..70cc857 100644
--- a/share/html/Elements/Error
+++ b/share/html/Elements/Error
@@ -60,10 +60,8 @@
 <%$Details%>
 </div>
 
-<%cleanup>
-$m->comp('/Elements/Footer');
-$m->abort();
-</%cleanup>
+<& /Elements/Footer &>
+% $m->abort;
 
 <%args>
 $Actions => []

commit 80b1b0c6ef3a4d3215d33868dc4da7f73f0f5c8e
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Wed Mar 13 21:03:47 2013 -0400

    Remove WebRT prefix on error messages in logs
    
    WebRT is a concept which dates back to RT 2 days, and has no meaning

diff --git a/share/html/Elements/Error b/share/html/Elements/Error
index 70cc857..a047677 100644
--- a/share/html/Elements/Error
+++ b/share/html/Elements/Error
@@ -72,7 +72,7 @@ $SuppressHeader => 0,
 </%args>
 
 <%INIT>
-my $error = "WebRT: $Why";
+my $error = $Why;
 $error .= " ($Details)" if defined $Details && length $Details;
 
 # TODO: Log::Dispatch isn't UTF-8 safe. Autrijus needs to talk to dave rolsky about getting this fixed

commit 9c2c6b23c8bb8654932fcee5044455075f9b6e7c
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Wed Mar 13 21:11:31 2013 -0400

    Remove SelfService/Error.html, replacing with standard Abort() calls

diff --git a/share/html/SelfService/Display.html b/share/html/SelfService/Display.html
index 23d1c91..faf3150 100644
--- a/share/html/SelfService/Display.html
+++ b/share/html/SelfService/Display.html
@@ -116,27 +116,15 @@ if ( defined ($id[0]) && $id[0] eq 'new' ) {
     # {{{ Create a new ticket
 
     my $Queue = RT::Queue->new( $session{'CurrentUser'} );
-    unless ( $Queue->Load( $ARGS{'Queue'} ) ) {
-        $m->comp( 'Error.html', Why => loc('Queue not found') );
-        $m->abort;
-    }
-
-    unless ( $Queue->CurrentUserHasRight('CreateTicket') ) {
-        $m->comp( 'Error.html',
-            Why =>
-              loc('You have no permission to create tickets in that queue.') );
-        $m->abort;
-    }
+    Abort( loc('Queue not found') ) unless $Queue->Load( $ARGS{'Queue'} );
 
+    Abort( loc('You have no permission to create tickets in that queue.') )
+        unless $Queue->CurrentUserHasRight('CreateTicket');
 
     ( $Ticket, @results ) =
     CreateTicket( Attachments => $session{'Attachments'}, %ARGS );
 
-    unless ( $Ticket->id ) {
-        $m->comp( 'Error.html', Why => join( "\n", @results ));
-              $m->abort();
-        }
-
+    Abort( join("\n", @results ) ) unless $Ticket->id;
 
         # delete temporary storage entry to make WebUI clean
         unless ( keys %{ $session{'Attachments'} } and $ARGS{'UpdateAttach'} ) {
@@ -145,11 +133,7 @@ if ( defined ($id[0]) && $id[0] eq 'new' ) {
 
     }
     else {
-        unless ( $Ticket->Load( $id[0] ) ) {
-            $m->comp( 'Error.html',
-                Why => loc( "Couldn't load ticket '[_1]'", $id ) );
-            $m->abort();
-        }
+        $Ticket = LoadTicket($ARGS{'id'});
 
     my ( $code, $msg );
 
diff --git a/share/html/SelfService/Error.html b/share/html/SelfService/Error.html
deleted file mode 100644
index 0ee0b5d..0000000
--- a/share/html/SelfService/Error.html
+++ /dev/null
@@ -1,71 +0,0 @@
-%# BEGIN BPS TAGGED BLOCK {{{
-%#
-%# COPYRIGHT:
-%#
-%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC
-%#                                          <sales at bestpractical.com>
-%#
-%# (Except where explicitly superseded by other copyright notices)
-%#
-%#
-%# LICENSE:
-%#
-%# This work is made available to you under the terms of Version 2 of
-%# the GNU General Public License. A copy of that license should have
-%# been provided with this software, but in any event can be snarfed
-%# from www.gnu.org.
-%#
-%# This work is distributed in the hope that it will be useful, but
-%# WITHOUT ANY WARRANTY; without even the implied warranty of
-%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-%# General Public License for more details.
-%#
-%# You should have received a copy of the GNU General Public License
-%# along with this program; if not, write to the Free Software
-%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-%# 02110-1301 or visit their web page on the internet at
-%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
-%#
-%#
-%# CONTRIBUTION SUBMISSION POLICY:
-%#
-%# (The following paragraph is not intended to limit the rights granted
-%# to you to modify and distribute this software under the terms of
-%# the GNU General Public License and is only of importance to you if
-%# you choose to contribute your changes and enhancements to the
-%# community by submitting them to Best Practical Solutions, LLC.)
-%#
-%# By intentionally submitting any modifications, corrections or
-%# derivatives to this work, or any other work intended for use with
-%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-%# you are the copyright holder for those contributions and you grant
-%# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
-%# royalty-free, perpetual, license to use, copy, create derivative
-%# works based on those contributions, and sublicense and distribute
-%# those contributions and any derivatives thereof.
-%#
-%# END BPS TAGGED BLOCK }}}
-<& /SelfService/Elements/Header, Title => loc('Error') &>
-<h2 class="title"><%loc('Error')%></h2>
-<&| /Widgets/TitleBox, title => $Title &>
-<%$Why%>
-<br />
-<font size="-1">
-<%$Details%>
-</font>
-</&>
-</body>
-</html>
-
-
-<%args>
-$Code => undef
-$Details => undef
-$Title => loc("RT Error")
-$Why => loc("the calling component did not specify why")
-</%args>
-
-<%INIT>
-$Details ||= loc("No details");
-$RT::Logger->error("WebRT: $Why ($Details)");
-</%INIT>

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


More information about the Rt-commit mailing list