fixes for user_list.module

luxx - May 6, 2009 - 21:27
Project:User List
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

Line 99 in user_list.module
else if ($op == 'roles' && _user_list_get_roles('base', $role_type) && $roles[$role_type]) {
line 90
else if ($op == 'content' && ($type_name = node_get_types('name', $content_type)) && $types[$content_type]) {

These conditions will never be true as $roles[$role_type] and $types[$content_type] do not return Boolean TRUE or FALSE. I dont really know what those conditions are for as the other conditions check if the role_type or content_type are in the array. Using these conditions instead seems to work fine:

change line 99 in user_list.module
else if ($op == 'roles' && _user_list_get_roles('base', $role_type) ) {
and also line 90
else if ($op == 'content' && ($type_name = node_get_types('name', $content_type)) ) {

Another bug I noticed that was fatal for our use of this module, all instances of 'role' were changed to 'roles' in the latest revision. Running a debugger revealed that any condition that checked for arguments such as lines 75, 99, 146, 448, 506 were not working properly. Changing 'roles' back to 'role' seemed to fix this.

Also I would request that prior releases of this module be posted in the way that other modules do. Here is an example of how we are using this module http://www.homesavvi.com/userlist/active/role/Professional but to achieve the effect some modification of the .module file was required. When integrating module updates with our own changes, it is nice to be able to compare prior versions of official releases, as sometimes our fixes overlap with official updates.

 
 

Drupal is a registered trademark of Dries Buytaert.