mdmsoft / yii2-admin

Auth manager for Yii2 (RBAC Manager)
GNU General Public License v3.0
1.16k stars 574 forks source link

Support untuk PHP 8.1 #466

Open ahmadfadlydziljalal opened 2 years ago

ahmadfadlydziljalal commented 2 years ago

Dear Cak, PHP versi 8.1.5 Yii 2.0.46

Untuk route: /admin/permission/index dengan

Halaman gagal render karena :

PHP Deprecated Warning – yii\base\ErrorException trim(): Passing null to parameter #1 ($string) of type string is deprecated

madeep commented 2 years ago

Hi, it's not compliant but you can bypass the problem by update search/models/AuthItem on line 79: replace this code: $search = mb_strtolower(trim($this->name)); $desc = mb_strtolower(trim($this->description));

to

if (null !== $this->name && trim($this->name) != '') { $search = mb_strtolower(trim($this->name)); } if (null !== $this->description && trim($this->description) != '') { $desc = mb_strtolower(trim($this->description)); }