Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
4e1e44ea
Commit
4e1e44ea
authored
Jul 30, 2012
by
Koosha Khajeh Moogahi
Committed by
Frédéric Buclin
Jul 30, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 498890: Bugzilla::User::Setting doesn't need to sort DB results
r/a=LpSolit
parent
2e617ed0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
15 deletions
+10
-15
Setting.pm
Bugzilla/User/Setting.pm
+10
-15
No files found.
Bugzilla/User/Setting.pm
View file @
4e1e44ea
...
...
@@ -154,21 +154,18 @@ sub add_setting {
sub
get_all_settings
{
my
(
$user_id
)
=
@_
;
my
$settings
=
get_defaults
(
$user_id
);
# first get the defaults
my
$settings
=
{};
my
$dbh
=
Bugzilla
->
dbh
;
my
$
sth
=
$dbh
->
prepare
(
my
$
rows
=
$dbh
->
selectall_arrayref
(
q{SELECT name, default_value, is_enabled, setting_value, subclass
FROM setting
LEFT JOIN profile_setting
ON setting.name = profile_setting.setting_name
WHERE profile_setting.user_id = ?
ORDER BY name}
);
AND profile_setting.user_id = ?}
,
undef
,
(
$user_id
));
$sth
->
execute
(
$user_id
);
while
(
my
(
$name
,
$default_value
,
$is_enabled
,
$value
,
$subclass
)
=
$sth
->
fetchrow_array
())
{
foreach
my
$row
(
@$rows
)
{
my
(
$name
,
$default_value
,
$is_enabled
,
$value
,
$subclass
)
=
@$row
;
my
$is_default
;
...
...
@@ -194,13 +191,11 @@ sub get_defaults {
$user_id
||=
0
;
my
$sth
=
$dbh
->
prepare
(
q{SELECT name, default_value, is_enabled, subclass
FROM setting
ORDER BY name}
);
$sth
->
execute
();
while
(
my
(
$name
,
$default_value
,
$is_enabled
,
$subclass
)
=
$sth
->
fetchrow_array
())
{
my
$rows
=
$dbh
->
selectall_arrayref
(
q{SELECT name, default_value, is_enabled, subclass
FROM setting}
);
foreach
my
$row
(
@$rows
)
{
my
(
$name
,
$default_value
,
$is_enabled
,
$subclass
)
=
@$row
;
$default_settings
->
{
$name
}
=
new
Bugzilla::User::
Setting
(
$name
,
$user_id
,
$is_enabled
,
$default_value
,
$default_value
,
1
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment