Coding error detected, it must be fixed by a programmer: PHP catchable fatal error
[root@moodle moodle23]# grep -m1 'PHPUNIT_UTIL' -A3 lib/setup.php
if (!PHPUNIT_TEST or PHPUNIT_UTIL) {
set_exception_handler('default_exception_handler');
set_error_handler('default_error_handler', E_ALL | E_STRICT);
}
Coding error detected, it must be fixed by a programmer: PHP catchable fatal error
has_capability 回傳函式 has_capability_in_accessdata 中的第三個參數 $access,應該是陣列 array,但卻是布林值,解決方式先加入變數 $access 型態的判斷,若是布林值,就直接回傳,此時首頁的左邊區塊不會顯示。出現問題為清除 cache 後發生,真正原理待分析。
[root@dywang moodle23]# vim lib/accesslib.php
.......
function has_capability($capability, context $context, $user = null, $doanything = true) {
global $USER, $CFG, $SCRIPT, $ACCESSLIB_PRIVATE;
.........
+ if (is_bool($access) ) { return;}
return has_capability_in_accessdata($capability, $context, $access);