cvs: pear /LiveUser_Admin/Perm Simple.php

From: Date: Thu, 13 Apr 2006 09:03:00 +0000
Subject: cvs: pear /LiveUser_Admin/Perm Simple.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-39588@lists.php.net to get a copy of this message
lsmith Thu Apr 13 09:03:00 2006 UTC Modified files: /pear/LiveUser_Admin/Perm Simple.php Log: - fixed typos in 'with' handling http://cvs.php.net/viewcvs.cgi/pear/LiveUser_Admin/Perm/Simple.php?r1=1.84&r2=1.85&diff_format=u Index: pear/LiveUser_Admin/Perm/Simple.php diff -u pear/LiveUser_Admin/Perm/Simple.php:1.84 pear/LiveUser_Admin/Perm/Simple.php:1.85 --- pear/LiveUser_Admin/Perm/Simple.php:1.84 Tue Apr 11 17:31:43 2006 +++ pear/LiveUser_Admin/Perm/Simple.php Thu Apr 13 09:03:00 2006 @@ -57,7 +57,7 @@ * @author Bjoern Kraus <krausbn@php.net> * @copyright 2002-2006 Markus Wolff * @license http://www.gnu.org/licenses/lgpl.txt - * @version CVS: $Id: Simple.php,v 1.84 2006/04/11 17:31:43 lsmith Exp $ + * @version CVS: $Id: Simple.php,v 1.85 2006/04/13 09:03:00 lsmith Exp $ * @link http://pear.php.net/LiveUser_Admin */ @@ -673,14 +673,19 @@ { $params = LiveUser_Admin_Storage::setSelectDefaultParams($params); - // ensure that all $with fields are fetched - $params['filters'] = array_merge($params['filters'], array_keys($params['with'])); - $data = $this->_storage->select($params['select'], $params['fields'], $params['filters'], $params['orders'], $params['rekey'], $params['group'], $params['limit'], $params['offset'], $root_table, $selectable_tables); - if (!empty($params['with']) && is_array($data)) { + if (!empty($params['with']) && !empty($data) && !is_array($data)) { + $missing = array_diff(array_keys($params['with']), array_keys(reset($data))); + if (!empty($missing)) { + $this->stack->push( + LIVEUSER_ADMIN_ERROR, 'exception', + array('msg' => 'The following "with" elements are not included in the result: '.implode($missing)) + ); + return false; + } foreach ($data as $key => $row) { foreach ($params['with'] as $field => $with_params) { $with_params['filters'][$field] = $row[$field];

« previous php.pear.cvs (#39588) next »