Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 3.3.1 GridView throwing undefined offset in Line 1227 #907

Closed
SSiwek opened this issue May 20, 2019 · 2 comments
Closed

Version 3.3.1 GridView throwing undefined offset in Line 1227 #907

SSiwek opened this issue May 20, 2019 · 2 comments

Comments

@SSiwek
Copy link

SSiwek commented May 20, 2019

Hi,

I just run into that Error. I fixed it with:

public function renderPageSummary()
[...]
//for ($i = 0; $i < $cols; $i++) {
foreach($this->columns as $i => $column){
/** @var DataColumn $column */
//$column = $this->columns[$i];
if (!method_exists($column, 'renderPageSummaryCell')) {
$cells[] = Html::tag('td');
continue;
}
$cells[] = $column->renderPageSummaryCell();

Sven

execut added a commit to execut/yii2-grid that referenced this issue May 20, 2019
…summary row when using string columns keys
@execut
Copy link
Contributor

execut commented May 20, 2019

Minimal code to reproduce the bug:

$dataProvider = new \yii\data\ArrayDataProvider([
    'allModels' => [
        ['id' => 1]
    ],
]);
echo \kartik\grid\GridView::widget([
    'dataProvider' => $dataProvider,
    'showPageSummary' => true,
    'columns' => [
        'id' => 'id',
    ]
]);

kartik-v added a commit that referenced this issue May 20, 2019
(bug #907): Fixed bug with undefined offset inside rendering summary …
@kartik-v
Copy link
Owner

Fixed via #908.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants