Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.16.14

Bug #2452 Admin/Perm/DB_Medium getGroups method broken
Submitted: 2004-10-04 21:14 UTC
From: tim at nonfiction dot ca Assigned: dufuz
Status: Closed Package: LiveUser
PHP Version: 4.3.6 OS: Mandrake 9
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 35 + 37 = ?

 
 [2004-10-04 21:14 UTC] tim at nonfiction dot ca
Description: ------------ Admin/Perm/Container/DB_Medium.php getGroups() method has an SQL Syntax error. Reproduce code: --------------- --- DB_Medium1.php Mon Oct 4 15:06:21 2004 +++ DB_Medium2.php Mon Oct 4 15:06:29 2004 @@ -586,33 +586,33 @@ ); if (isset($this->groupTableCols['optional']['group_type'])) { - $customFields[] = $this->groupTableCols['optional']['group_type']['name'] . ' AS group_type'; + $customFields[] = 'groups.' . $this->groupTableCols['optional']['group_type']['name'] . ' AS group_type'; } if (isset($this->groupTableCols['optional']['is_active'])) { - $customFields[] = "CASE {$this->groupTableCols['optional']['is_active']['name']} + $customFields[] = "CASE groups.{$this->groupTableCols['optional']['is_active']['name']} WHEN 'Y' THEN 1 WHEN 'N' THEN 0 END AS is_active"; } if (isset($this->groupTableCols['optional']['owner_user_id'])) { - $customFields[] = $this->groupTableCols['optional']['owner_user_id']['name'] . ' AS owner_user_id'; + $customFields[] = 'groups.' . $this->groupTableCols['optional']['owner_user_id']['name'] . ' AS owner_user_id'; } if (isset($this->groupTableCols['optional']['owner_group_id'])) { - $customFields[] = $this->groupTableCols['optional']['owner_group_id']['name'] . ' AS owner_group_id'; + $customFields[] = 'groups.' . $this->groupTableCols['optional']['owner_group_id']['name'] . ' AS owner_group_id'; } if (isset($this->groupTableCols['custom']) && sizeof($this->groupTableCols['custom']) > 0) { foreach ($this->groupTableCols['custom'] as $alias => $field_data) { - $customFields[] = $field_data['name'] . ' AS ' . $alias; + $customFields[] = 'groups.' . $field_data['name'] . ' AS ' . $alias; } } if (count($customFields) > 0) { $fields = ','; - $fields .= implode(', groups.', $customFields); + $fields .= implode(', ', $customFields); } $query = 'SELECT Expected result: ---------------- Should get back an array of groups. Actual result: -------------- Returns a DB Error object

Comments

 [2004-10-05 03:53 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!