[ZBX-3923] Wrong exit on database error in CUser::updateProfile Created: 2011 Jul 06  Updated: 2017 May 30  Resolved: 2014 Sep 24

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: API (A), Frontend (F)
Affects Version/s: 1.8.5
Fix Version/s: None

Type: Incident report Priority: Minor
Reporter: Jacobo Aragunde Pérez Assignee: Unassigned
Resolution: Won't fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Debian Lenny


Attachments: File 0001-Correct-wrong-error-check-in-CUser-updateProfile.patch    

 Description   

When there's an error with DB fields in method CUser::updateProfile, the application tries to 'break' but it's not inside a loop, causing the following error:

PHP Fatal error: Cannot break/continue 1 level in .../api/classes/class.cuser.php on line 759

Besides this error in the log file, the user doesn't receive any feedback in the web front-end.

I attach a small patch to fix the problem, which can be applied with:

patch -p1 < 0001-Correct-wrong-error-check-in-CUser-updateProfile.patch



 Comments   
Comment by Jacobo Aragunde Pérez [ 2011 Jul 06 ]

I forgot to mention a simple way to reproduce this bug. Modify the database to add a new column to users table:

alter table users add column new_column varchar(255);

It will make the web gui crash if you access the profile page and try to change one value (for example the language).

Of course, drop the column once you're done:

alter table users drop column new_column;

Comment by Alexander Vladishev [ 2014 Sep 24 ]

Already fixed in version 2.0.0. I close the issue.

Generated at Fri Apr 18 23:41:53 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.