Mantis Bugtracker          
testlink.org

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005201TestLinkUsers and Rightspublic2012-09-05 14:382014-08-15 07:16
Reporterventury 
Assigned Tofman 
PrioritynormalSeveritytrivialReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version1.9.3 (2011 Q3 - bug fixing) 
Fixed in Version1.9.12 (2014 Q3) 
Summary0005201: There is a id criteria on tlRole::getUserIDsWithTestProjectRole function that is not needed
DescriptionIn file tlRole.class.php, the protected function getUserIDsWithTestProjectRole is supposed to return all userids of users that have a specific role.

The SQL request has a criteria that is not needed :

AND users.id < 10";


Why should we limit users.id to be minor than 10 ?
I suggest to remove that criteria.

Have'nt check on 1.9.4.
Steps To ReproduceAny uses of code like this :

$roleMgr = new tlRole(TL_SPECIFIC_ROLE);
$userSet = $roleMgr->getAllUsersWithRole($db);

will return a partial result, as soon as a user with the TL_SPECIFIC_ROLE has an id >= 10.

Additional InformationHere is the whole function.

/**
     * Gets all userids of users with a certain testproject role @TODO WRITE RIGHT COMMENTS FROM START
     *
     * @param resource &$db reference to database handler
     * @return array returns array of userids
     **/
    protected function getUserIDsWithTestProjectRole(&$db)
    {
        $sql = "SELECT DISTINCT id FROM {$this->tables['users']} users," .
                 " {$this->tables['user_testproject_roles']} user_testproject_roles " .
                 " WHERE users.id = user_testproject_roles.user_id";
        $sql .= " AND user_testproject_roles.role_id = {$this->dbID} AND users.id < 10";
        $idSet = $db->fetchColumnsIntoArray($sql,"id");
        
        return $idSet;
    }
TagsNo tags attached.
Database (MySQL,Postgres,etc)Any.
Browser
PHP Version
TestCaseID
QA Team - Task Workflow StatusREADY FOR TESTING
Attached Files

- Relationships

-  Notes
(0021469)
ventury (developer)
2014-08-14 21:10

Also present in 1.9.11 version

- Issue History
Date Modified Username Field Change
2012-09-05 14:38 ventury New Issue
2014-08-14 21:10 ventury Note Added: 0021469
2014-08-15 07:15 fman QA Team - Task Workflow Status TBD => READY FOR TESTING
2014-08-15 07:15 fman Status new => closed
2014-08-15 07:15 fman Assigned To => fman
2014-08-15 07:15 fman Resolution open => fixed
2014-08-15 07:15 fman Fixed in Version => 1.9.12 (2014 Q3)
2014-08-15 07:16 fman Description Updated View Revisions
2014-08-15 07:16 fman Steps to Reproduce Updated View Revisions
2014-08-15 07:16 fman Additional Information Updated View Revisions



Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker