Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

Commit

Permalink
Fixed handling of masslists in criteria
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelchisari authored and The Appleseed Project committed Dec 28, 2010
1 parent 93ad096 commit 06eddea
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion system/model.php
Original file line number Diff line number Diff line change
Expand Up @@ -464,8 +464,16 @@ protected function _BuildCriteria ( array $pCriteria ) {
$comparison = null;
$comparison_string = null;

$this->_Masslist = false;

if ( $this->_IsMasslist ( $criteria ) ) {
$directive = '()';
$newCriteria = array ( );
foreach ( $criteria as $cc => $crit ) {
$newCriteria[] = $cc;
}
$criteria = join ( ',', $newCriteria );
$this->_Masslist = true;
} elseif ( is_array ( $criteria ) ) {
$comparison = 'AND';
$compare = substr ( $c, 0, 2 );
Expand Down Expand Up @@ -523,7 +531,8 @@ protected function _BuildCriteria ( array $pCriteria ) {

if ( $operand ) {
// Strip the operand information from the criteria.
if ( !is_array ( $criteria ) ) $criteria = substr ( $criteria, 2, strlen ( $criteria ) );
if ( ( !is_array ( $criteria ) ) and ( !$this->_Masslist ) )
$criteria = substr ( $criteria, 2, strlen ( $criteria ) );
} else {
// Default to equal comparison
$operand = "=";
Expand Down

0 comments on commit 06eddea

Please sign in to comment.