mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-02 04:37:42 +08:00
Fix PHP 8.1 Empty header DataColumn (#19350)
* Fix PHP 8.1 Empty header DataColumn #19349 * Update CHANGELOG.md * Update CHANGELOG.md Co-authored-by: Bizley <pawel@positive.codes>
This commit is contained in:
committed by
GitHub
parent
0741c4cab0
commit
ad1fd84f39
@ -4,6 +4,7 @@ Yii Framework 2 Change Log
|
||||
2.0.46 under development
|
||||
------------------------
|
||||
|
||||
- Bug #19349: Fix PHP 8.1 error when attribute and label of `yii\grid\DataColumn` are empty (githubjeka)
|
||||
- Bug #19243: Handle `finfo_open` for tar.xz as `application/octet-stream` on PHP 8.1 (longthanhtran)
|
||||
- Bug #19235: Fix return type compatibility of `yii\web\SessionIterator` class methods for PHP 8.1 (virtual-designer)
|
||||
- Bug #19256: Pass missed `$view` to user's callback in `yii\validators\InlineValidator::clientValidateAttribute()` (WinterSilence)
|
||||
|
||||
@ -167,7 +167,9 @@ class DataColumn extends Column
|
||||
$provider = $this->grid->dataProvider;
|
||||
|
||||
if ($this->label === null) {
|
||||
if ($provider instanceof ActiveDataProvider && $provider->query instanceof ActiveQueryInterface) {
|
||||
if ($this->attribute === null) {
|
||||
$label = '';
|
||||
} elseif ($provider instanceof ActiveDataProvider && $provider->query instanceof ActiveQueryInterface) {
|
||||
/* @var $modelClass Model */
|
||||
$modelClass = $provider->query->modelClass;
|
||||
$model = $modelClass::instance();
|
||||
|
||||
Reference in New Issue
Block a user