[Rt-commit] rt branch, 4.2/deprecate-bookmarks-syntax, updated. rt-4.1.8-304-gc6ff2e3

Thomas Sibley trs at bestpractical.com
Wed May 15 18:06:14 EDT 2013


The branch, 4.2/deprecate-bookmarks-syntax has been updated
       via  c6ff2e31d00a37957f3d9cfaddd4ef7291b14a80 (commit)
      from  a070c6d71376835604be1343d936bda488097362 (commit)

Summary of changes:
 lib/RT.pm                      | 10 ++++++++++
 share/html/Elements/ShowSearch |  1 +
 share/html/m/tickets/search    |  1 +
 3 files changed, 12 insertions(+)

- Log -----------------------------------------------------------------
commit c6ff2e31d00a37957f3d9cfaddd4ef7291b14a80
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Wed May 15 15:04:02 2013 -0700

    Note the RT::Attribute id which contains the deprecated __Bookmarks__ syntax
    
    Without it, any admin trying to track down the deprecated syntax will be
    pretty frustrated.

diff --git a/lib/RT.pm b/lib/RT.pm
index c217633..1fe0e1f 100644
--- a/lib/RT.pm
+++ b/lib/RT.pm
@@ -54,6 +54,7 @@ package RT;
 
 use File::Spec ();
 use Cwd ();
+use Scalar::Util qw(blessed);
 
 use vars qw($Config $System $SystemUser $Nobody $Handle $Logger $_Privileged $_Unprivileged $_INSTALL_MODE);
 
@@ -885,6 +886,12 @@ calling it; names the arguments which are deprecated.
 Overrides the auto-built phrasing of C<Calling function ____ is
 deprecated> with a custom message.
 
+=item Object
+
+An L<RT::Record> object to print the class and numeric id of.  Useful if the
+admin will need to hunt down a particular object to fix the deprecation
+warning.
+
 =back
 
 =cut
@@ -929,6 +936,9 @@ sub Deprecated {
     $msg .= "  You should use $args{Instead} instead."
         if $args{Instead};
 
+    $msg .= sprintf "  Object: %s #%d.", blessed($args{Object}), $args{Object}->id
+        if $args{Object};
+
     $msg .= "  Call stack:\n$stack" if $args{Stack};
     RT->Logger->warn($msg);
 }
diff --git a/share/html/Elements/ShowSearch b/share/html/Elements/ShowSearch
index c6bff90..8ebdc28 100644
--- a/share/html/Elements/ShowSearch
+++ b/share/html/Elements/ShowSearch
@@ -136,6 +136,7 @@ foreach ( $SearchArg, $ProcessedSearchArg ) {
             Remove  => "4.4",
             Instead => "id = '__Bookmarked__'",
             Message => "The __Bookmarks__ query syntax is deprecated",
+            Object  => $search,
         );
 
         my @bookmarks = $session{'CurrentUser'}->UserObj->Bookmarks;
diff --git a/share/html/m/tickets/search b/share/html/m/tickets/search
index 86b9ecf..e5bf4da 100644
--- a/share/html/m/tickets/search
+++ b/share/html/m/tickets/search
@@ -95,6 +95,7 @@ my $search;
                 Remove  => "4.4",
                 Instead => "id = '__Bookmarked__'",
                 Message => "The __Bookmarks__ query syntax is deprecated",
+                Object  => $search,
             );
 
             my @bookmarks = $session{'CurrentUser'}->UserObj->Bookmarks;

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


More information about the Rt-commit mailing list