Skip to content

Commit

Permalink
Added check for array to prevent errors
Browse files Browse the repository at this point in the history
  • Loading branch information
BradCrumb committed Nov 15, 2013
1 parent b222be0 commit e4fef76
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion View/Elements/datagrid/headers.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@

foreach($paging as $pModel => $pOptions) {
// This allows the setting of a default direction class, otherwise the paginator is not supplying that
if (array_key_exists('order', $pOptions) && array_key_exists($sortKey, $pOptions['order'])) {
if (is_array($pOptions) && array_key_exists('order', $pOptions) &&
is_array($pOptions['order']) && array_key_exists($sortKey, $pOptions['order'])) {
$directionClass .= ' ' . strtolower($pOptions['order'][$sortKey]);
break;
}
Expand Down

0 comments on commit e4fef76

Please sign in to comment.