2015-06-25 36 views
0

我的moodle給了我這個錯誤: 「檢測到編碼錯誤,它必須由程序員修正:傳遞給moodle_page :: set_state的狀態無效。我們處於狀態0並且請求狀態3。檢測到Moodle編碼錯誤

我google了一下,但找不到這個錯誤的確切解決方案。我以前從未遇到過它。如果您需要關於代碼或文件的任何額外信息,請務必告訴我。

回答

2

如果調用$OUTPUT->footer()$OUTPUT->header()沒有,則可能發生這種情況。頁面應處於以下狀態之一:

/** The state of the page before it has printed the header **/ 
const STATE_BEFORE_HEADER = 0; 

/** The state the page is in temporarily while the header is being printed **/ 
const STATE_PRINTING_HEADER = 1; 

/** The state the page is in while content is presumably being printed **/ 
const STATE_IN_BODY = 2; 

/** 
* The state the page is when the footer has been printed and its function is 
* complete. 
*/ 
const STATE_DONE = 3; 

可能有些自定義代碼。打開調試到開發人員級別以查找位置。在你的config.php中加

$CFG->debug = E_ALL | E_STRICT; 
$CFG->debugdisplay = true; 
+0

謝謝!我沒有注意到我的$ OUTPUT-> header()實際上只是簡單地丟失了。 –