FLARUM 張貼文章時發生錯誤! -- Day3

OO

如果跟我一樣在張貼文章時,發生了以下錯誤:

Warning: count(): Parameter must be an array or an object that implements Countable in C:\xampp\htdocs\flarum\vendor\flarum\core\src\Core\Post\RegisteredTypesScope.php on line 52


開啟:

\vendor\flarum\core\src\Core\Post\RegisteredTypesScope.php



在Line 52
$this->whereIndex = count($query->wheres);


改成↓👇👇👇

$this->whereIndex = count($query->wheres ?: []);

參考網址:Fix PHP 7.2 warning

留言

張貼留言