[Rt-commit] [rtir] 02/02: Handle unnamed searches in update_saved_searches
Jim Brandt
jbrandt at bestpractical.com
Fri Jun 28 14:56: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 eae91be1e21ebb6c4be2b5e6ff014fe358dde1cf
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 | 14 ++++++++------
1 file changed, 8 insertions(+), 6 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..b5b9dbb 100644
--- a/etc/upgrade/2.5.1/update_saved_searches.pl.in
+++ b/etc/upgrade/2.5.1/update_saved_searches.pl.in
@@ -75,22 +75,24 @@ while ( my $s = $saved_searches->Next ) {
s/(?<=CustomField\.{)_RTIR_//ig;
s/(?<=CF\.{)_RTIR_//ig;
s/(?<=CustomField\.{)_RTIR_//ig;
- s/\b($special)\b/$special_rename{$1}/ige;
+ s/\b($special)\b/$special_rename{$1}/ige if $1;
}
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