Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rt
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
best-practical
rt
Commits
ca61ecfb
Commit
ca61ecfb
authored
11 years ago
by
Ruslan Zakirov
Committed by
Alex Vandiver
11 years ago
Browse files
Options
Downloads
Patches
Plain Diff
upgrade script for old quicksearch preferences
parent
057302c7
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
etc/upgrade/4.3.0/content
+40
-0
40 additions, 0 deletions
etc/upgrade/4.3.0/content
with
40 additions
and
0 deletions
etc/upgrade/4.3.0/content
0 → 100644
+
40
−
0
View file @
ca61ecfb
use strict;
use warnings;
our @Initial = (sub {
my $pref_name = 'QuickSearch';
my $users = RT::Users->new(RT->SystemUser);
$users->FindAllRows;
my $attributes = $users->Join(
ALIAS1 => "main",
FIELD1 => "id",
TABLE2 => RT::Attributes->Table,
FIELD2 => "ObjectId",
);
$users->Limit(
ALIAS => $attributes,
FIELD => "ObjectType",
VALUE => "RT::User",
);
$users->Limit(
ALIAS => $attributes,
FIELD => "Name",
VALUE => RT::User::_PrefName( $pref_name ),
);
# Iterate all users (including disabled), with Quicksearch preferences set.
# Avoids running a query for every user in the system by only selecting
# those known to have preferences.
while (my $user = $users->Next) {
RT->Logger->debug(sprintf "User #%d has $pref_name preferences", $user->id);
my $config = $user->Preferences( $pref_name )
or next;
$user->SetPreferences( $pref_name, { Unwanted => $config } );
RT->Logger->debug(sprintf "Updated $pref_name preferences for user %s (#%d)", $user->Name, $user->id);
}
});
1;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment