[Rt-commit] [rtir] 02/07: Handle unnamed searches in update_saved_searches

Jim Brandt jbrandt at bestpractical.com
Tue Jul 2 15:25:59 EDT 2013


This is an automated email from the git hooks/post-receive script.

jbrandt pushed a commit to branch 2.9/update-2.5.1-update-saved-search
in repository rtir.

commit 628e867697003476c31a5a76195002f152b1c54b
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Fri Jun 28 14:53:48 2013 -0400

    Handle unnamed searches in update_saved_searches
    
    Handle the undefined Description case and provide the search id when
    updating unnamed saved searches. Also clean up the progress
    messages a bit.
---
 etc/upgrade/2.5.1/update_saved_searches.pl.in | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/etc/upgrade/2.5.1/update_saved_searches.pl.in b/etc/upgrade/2.5.1/update_saved_searches.pl.in
index bdf49e6..5e76d4a 100644
--- a/etc/upgrade/2.5.1/update_saved_searches.pl.in
+++ b/etc/upgrade/2.5.1/update_saved_searches.pl.in
@@ -80,17 +80,19 @@ while ( my $s = $saved_searches->Next ) {
 
     if ( $old_query ne $content->{Query} || $old_format ne $content->{Format} )
     {
+        my $description = $s->Description;
+        $description = 'Unnamed (id: ' . $s->Id . ')' unless $description;
+
         my ( $status, $msg ) = $s->SetContent($content);
         if ($status) {
-            print 'update content of saved search ' . $s->Description . ' with
-                success';
+            print 'Updated content of saved search ' . $description;
         }
         else {
-            print 'failed to update content of saved search '
-              . $s->Description
-              . ": $msg";
+            print 'Failed to update content of saved search: '
+              . $description . $msg;
         }
         print "\n";
     }
 }
 
+print "Done.\n";

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Rt-commit mailing list