mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 14:26:54 +08:00
Fixes #17156: Fixes PHP 7.2 warning when a data provider has no data as a parameter for a GridView
This commit is contained in:

committed by
Alexander Makarov

parent
b77e3ea0e7
commit
8cc74f5c57
@ -4,7 +4,7 @@ Yii Framework 2 Change Log
|
||||
2.0.17 under development
|
||||
------------------------
|
||||
|
||||
- no changes in this release.
|
||||
- Bug #17156: Fixes PHP 7.2 warning when a data provider has no data as a parameter for a GridView (evilito)
|
||||
|
||||
|
||||
2.0.16.1 February 28, 2019
|
||||
|
@ -123,7 +123,7 @@ class ArrayDataProvider extends BaseDataProvider
|
||||
*/
|
||||
protected function prepareTotalCount()
|
||||
{
|
||||
return count($this->allModels);
|
||||
return is_array($this->allModels) ? count($this->allModels) : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user