Skip to content

Commit

Permalink
Merge pull request #27 from gheggie/master
Browse files Browse the repository at this point in the history
Fixes for 3.1 compatibility
  • Loading branch information
silbinarywolf authored Sep 8, 2017
2 parents 97bb743 + f7fbf5b commit 3893726
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions code/ListFilterUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,9 @@ public static function filter_by_relation_ids(SS_List $list, $relationName, arra
$list = new ArrayList($result);
} else {
$idsSQL = "(".implode(',', $ids).")";

list($parentClass, $componentClass, $myIDColumnName, $relationIDColumnName, $manyManyTable) = singleton($class)->manyManyComponent($relationName);
$classObj = singleton($class);
$manyManyInfo = $classObj->hasMethod('manyManyComponent') ? 'manyManyComponent' : 'many_many';
list($parentClass, $componentClass, $myIDColumnName, $relationIDColumnName, $manyManyTable) = $classObj->$manyManyInfo($relationName);
$list = $list->innerJoin($manyManyTable, "\"{$myIDColumnName}\" = \"$parentClass\".\"ID\" AND \"{$relationIDColumnName}\" IN {$idsSQL}");
}
break;
Expand Down
2 changes: 1 addition & 1 deletion code/form/ListFilterForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ public function ShowingMessage(SS_List $list = null) {
}
}

$data['TotalCount'] = $list->TotalItems();
$data['TotalCount'] = $list->getTotalItems();
if ($start < $data['TotalCount']) {
$data['OffsetStart'] = $start + 1;
$data['ThisPage'] = $list->CurrentPage();
Expand Down

0 comments on commit 3893726

Please sign in to comment.