Comment 3 for bug 968314

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.