Ticket #1385 (new defect)

Opened 2 years ago

Adding new preference causes login problems for admin

Reported by: davidn Assigned to: somebody
Priority: normal Milestone:
Component: module - user Severity: open
Keywords: preferences admin Cc:

Description

This error occurs after adding a preference to the system. The logic to add a preference attempts to rebuild (or add the new) USER_PREFERENCE rows for existing users. It does do this correctly for most users. The problem comes when you're the admin user (id=1) and you then attempt to log in.

Looking into DA_User.php, it tries to locate preferences in several places, first the user, then org, then master list (PREFERENCE) and uses whatever preferences it first finds. When adding a new Preference, the system erroneously adds the new preference item to USER_PREFERENCE for all users, including admin. This throws the DA_User logic off, and causes its logic to see that the count(preferences) > 0, but there really is only 1 preference there for the administrator.