Manage user's roles does not propagate

Bug #968314 reported by Jay Scruton
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Eventum
New
Undecided
Elan Ruusamäe

Bug Description

When managing users that have existing roles assigned (standard user, reporter, etc...), you click on a user to pull them to the top to be able to change or add new roles, all of the roles revert to "No Access". This requires the end user to re-set every role the user had for each project in order to be able to add or change a new one. We are using version 2.3.1

Revision history for this message
Bryan Alsdorf (balsdorf) wrote :

I am unable to re-produce this. What browser are you using and is it saving form data such as email / password?

I have noticed in the past that if a browser is saving a username / login for Eventum it can mess up the add / edit user orm.

Jay Scruton (jscruton)
summary: - Manage user's roles do not propagate
+ Manage user's roles does not propagate
Revision history for this message
Vlad Safronov (vsafronov) wrote :

I have the same issue after upgrading from 2.2 to 2.3.1.
Latest Firefox 12.0.

I don't think it is browser issue because html from code has no traces of the propagated default values.

Elan Ruusamäe (glen666)
Changed in eventum:
milestone: none → 2.3.4
Revision history for this message
Marcin M (x-marcin) wrote :

Sam situation here.

Problem is not HTML nor borwser.

It is in PHP code. Exactly in method:
getDetailsAssoc in lib/eventum/class.user.php

this piece of code (starts line 700):
 foreach ($res as $usr_id => &$row) {
                // FIXME: maybe PEAR has some "fill NULL" mode?
                if (!isset($row['usr_grp_id'])) {
                    $row['usr_grp_id'] = null;
                }

                $row['group'] = Group::getName($row['usr_grp_id']);
                //--------------------------------------------------------
                //here is the bug
                $roles = Project::getAssocList($usr_id, false, true);
                $row['projects'] = array_keys($roles);
                $row['roles'] = $roles;
            }

Should be replaced with:
 foreach ($res as &$row) {
                // FIXME: maybe PEAR has some "fill NULL" mode?
                if (!isset($row['usr_grp_id'])) {
                    $row['usr_grp_id'] = null;
                }

                $row['group'] = Group::getName($row['usr_grp_id']);
                //and now it is fixed!!!!!!!!!!!!!!!
                $roles = Project::getAssocList($row['usr_id'], false, true);
                $row['projects'] = array_keys($roles);
                $row['roles'] = $roles;
            }

$res array has wrong indexes.

Hope this helps.

Elan Ruusamäe (glen666)
Changed in eventum:
milestone: 2.3.4 → 2.4
Revision history for this message
Elan Ruusamäe (glen666) wrote :
Changed in eventum:
assignee: nobody → Elan Ruusamäe (glen666)
milestone: 2.4 → 3.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.