[Bps-public-commit] rt-extension-commentoncreate branch, master, updated. 0.06-1-g55882ef

Alex Vandiver alexmv at bestpractical.com
Wed May 28 13:44:13 EDT 2014


The branch, master has been updated
       via  55882ef211829775b6fb6f7e8644aaf6dc7e4b3a (commit)
      from  9fb61dfd1bb8e89840938b8a4490bd56df20991c (commit)

Summary of changes:
 .../Ticket/Display.html/BeforeDisplay                         | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

- Log -----------------------------------------------------------------
commit 55882ef211829775b6fb6f7e8644aaf6dc7e4b3a
Author: Matt Zagrabelny <mzagrabe at d.umn.edu>
Date:   Fri May 23 19:12:46 2014 -0500

    short circuit out if CommentContent is not defined
    
    In certain circumstance tickets are created (via FormTools or whatever)
    where there is no CommentOnCreate box. Thus, the argument
    'CommentContent' doesn't even exist. This patch fixes warnings like the
    following:
    
    [warning]: Use of uninitialized value in pattern match (m//) at
    RT-Extension-CommentOnCreate/html/Callbacks/RT-Extension-CommentOnCreate/Ticket/Display.html/BeforeDisplay
    line 49.

diff --git a/html/Callbacks/RT-Extension-CommentOnCreate/Ticket/Display.html/BeforeDisplay b/html/Callbacks/RT-Extension-CommentOnCreate/Ticket/Display.html/BeforeDisplay
index af82088..05bec27 100644
--- a/html/Callbacks/RT-Extension-CommentOnCreate/Ticket/Display.html/BeforeDisplay
+++ b/html/Callbacks/RT-Extension-CommentOnCreate/Ticket/Display.html/BeforeDisplay
@@ -46,8 +46,15 @@
 %# 
 %# END BPS TAGGED BLOCK }}}
 <%INIT>
-if ($ARGSRef->{id} eq 'new' && $$TicketObj->Id
-        && $ARGSRef->{'CommentContent'} =~ /\S/ ) {
+if (
+    $ARGSRef->{id} eq 'new'
+    &&
+    $$TicketObj->Id
+    &&
+    defined $ARGSRef->{CommentContent}
+    &&
+    $ARGSRef->{CommentContent} =~ /\S/
+) {
     my $sigless = RT::Interface::Web::StripContent(
             Content => $ARGSRef->{'CommentContent'},
             ContentType => $ARGSRef->{'CommentContentType'},

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


More information about the Bps-public-commit mailing list