Closed Bug 289012 Opened 19 years ago Closed 19 years ago

Can't use an undefined value as a HASH reference at userprefs.cgi line 142.

Categories

(Bugzilla :: User Accounts, defect)

2.19.2
defect
Not set
critical

Tracking

()

RESOLVED FIXED
Bugzilla 2.20

People

(Reporter: cso, Assigned: Tomas.Kopal)

References

Details

(Keywords: regression, Whiteboard: [wanted for 2.20])

Attachments

(1 file, 1 obsolete file)

I saw this error on landfill when testing for regressions for LpSolit.

Line 142 appears to be:

my @setting_list = keys %{Bugzilla->user->settings};

and according to lxr it was due to bug 98123.
Note that this bug still exists despite the bug 98123 comment 27 saying it would
be resolved with another patch landing.

[Mon Apr 04 14:02:29 2005] [error] [client a.b.c.d] [Mon Apr  4 14:02:29 2005]
userprefs.cgi: Can't use an undefined value as a HASH reference at
/var/www/html/bugzilla-tip/userprefs.cgi line 142., referer:
http://landfill.bugzilla.org/bugzilla-tip/userprefs.cgi?tab=permissions
Flags: blocking2.20?
OS: Windows XP → All
Hardware: PC → All
Target Milestone: --- → Bugzilla 2.20
Colin: do you see this anymore? If not, what fixed it?
I think its because there now exists an option that a user can pick the value
of. I'm suspecting this is caused when there are no user-selectable settings -
which means this should be fixed as an admin can turn them all off.

I'll try and confirm this is the case later on with my test install.
Not seeing this now; and not sure exactly what fixed it either; can't reproduce
it on my test install either.
"If it's not a regression from 2.18 and it's not a critical problem with
something that's already landed, let's push it off." - Dave
Flags: blocking2.20?
Whiteboard: [wanted for 2.20]
Flags: blocking2.20-
I am seeing it now, on my test install (Windows, PostgreSQL). It may be
incorrect DB upgrade, as checksetup is not fully fixed for PostgreSQL yet though.
I don't have any settings (User Settings page shows "There are no settings to
edit."), and Prefs->General settings shows the same error.
I will try to investigate further, time permitting.
It looks that it happens always if the 'setting' table is empty. So the question
is if it is valid to have settings table empty? I haven't found any code in
checksetup populating the table, so it's probably valid.
I guess that 'get_all_settings' and 'get_defaults' in Bugzilla::User::Settings
should return empty hash if the table is empty...
Comments?
OK, I found the code to populate the table in checksetup. For some reason, it's
placed inside of the block with MySQL legacy checks and upgrade code, which is
wrong. It needs to be executed even for fresh new installs and on all DBs.
I would still like to return empty hash from the two mentioned functions, as it
will make them more robust.
I think I can do the patch now :-).
Assignee: user-accounts → Tomas.Kopal
Status: NEW → ASSIGNED
Attached patch V1 (obsolete) — Splinter Review
This seems to do the job...
Attachment #181487 - Flags: review?(vladd)
Attachment #181487 - Flags: review?(vladd) → review+
Flags: approval?
Flags: approval? → approval+
Comment on attachment 181487 [details] [diff] [review]
V1

Yeah, this is correct. But I can guarantee that it's been bitrotted by 285722,
because bz_change_field_type (which is in the patch context) doesn't even exist
anymore. :-)

Just a bitrot fix should do it.
Attachment #181487 - Flags: review-
Flags: approval+
Attached patch V1.1Splinter Review
Well, it still applied cleanely for me... But here it is unbitrotted anyway.
Attachment #181487 - Attachment is obsolete: true
Attachment #181738 - Flags: review?(mkanat)
Blocks: bz-postgres
Comment on attachment 181738 [details] [diff] [review]
V1.1

Cool. Yeah, that looks like the correct fix. :-)
Attachment #181738 - Flags: review?(mkanat) → review+
Flags: approval?
Severity: normal → major
Keywords: regression
Oh, common, I can't believe we're doing this now with approval+ bugs. Sheesh.
At least on Pg, this makes Bugzilla totally unusuable (show_bug is completely
broken), so I'm going to up the severity for stats.
Severity: major → critical
show_bug doesn't even work if you're logged in.  I think that counts as a
release blocker ;)
Flags: blocking2.20-
Flags: blocking2.20+
Flags: approval?
Flags: approval+
Checking in checksetup.pl;
/cvsroot/mozilla/webtools/bugzilla/checksetup.pl,v  <--  checksetup.pl
new revision: 1.400; previous revision: 1.399
done
Checking in Bugzilla/User/Setting.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/User/Setting.pm,v  <--  Setting.pm
new revision: 1.2; previous revision: 1.1
done
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Version: unspecified → 2.19.2
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: