moodle_page::set_state : Invalid state error

moodle_page::set_state : Invalid state error

by Ayushi Gupta -
Number of replies: 3

Creating a custom page for grader report.

Error showing -"Coding error detected, it must be fixed by a programmer: Invalid state passed to moodle_page::set_state. We are in state 0 and state 3 was requested."

Header is loading again. 

Any help what can be the possible issue or what the code is missing.


Thanks


Average of ratings: -
In reply to Ayushi Gupta

Re: moodle_page::set_state : Invalid state error

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Check for an additional $OUTPUT->header() call. This sort of thing can happen if you have more than one. 

Check your $PAGE->,  require_login(), and $OUTPUT stuff against a report that works.

In reply to Howard Miller

Re: moodle_page::set_state : Invalid state error

by Ayushi Gupta -

I have made a custom page where I am calling moodle grade files.


In reply to Ayushi Gupta

Re: moodle_page::set_state : Invalid state error

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Right... but it still needs to match pages of a similar type. 

Attach the code if you like... or point us to it in Github if you use it.