Skip to content

Commit

Permalink
Merge pull request #908 from execut/907-fix-bug-with-strings-columns-key
Browse files Browse the repository at this point in the history
(bug #907): Fixed bug with undefined offset inside rendering summary …
  • Loading branch information
kartik-v authored May 20, 2019
2 parents f00d893 + dd38d9f commit e8fa339
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Change Log: `yii2-grid`

- (enh #906): Allow setting page summary colspan direction (`ltr` or `rtl`)
- set via column's `pageSummaryOptions['data-colspan-dir']` property
- (bug #907): Fixed bug with undefined offset inside rendering summary row when using string columns keys (Yuriy Mamaev)

## Version 3.3.1

Expand Down
5 changes: 3 additions & 2 deletions src/GridView.php
Original file line number Diff line number Diff line change
Expand Up @@ -1234,15 +1234,16 @@ public function renderPageSummary()
*/
protected function getPageSummaryRow()
{
$cols = count($this->columns);
$columns = array_values($this->columns);
$cols = count($columns);
if ($cols === 0) {
return null;
}
$cells = [];
$skipped = [];
for ($i = 0; $i < $cols; $i++) {
/** @var DataColumn $column */
$column = $this->columns[$i];
$column = $columns[$i];
if (!method_exists($column, 'renderPageSummaryCell')) {
$cells[] = Html::tag('td');
continue;
Expand Down

0 comments on commit e8fa339

Please sign in to comment.