Quantcast
Channel: General developer forum
Viewing all articles
Browse latest Browse all 37675

set_context() for a page accessed from "My Moodle"

$
0
0
by sakai user.  

Hi all. 

I'm working on a block that is accessed and made for an instructors /my (aka: My Moodle) page. 

The block installs correctly and the page that does my work is coming up fine in the browser pane. However, I'm getting a $PAGE->context was not set error in my logs.. and in the debug output. 

I do call require_login() in my code at the top. 

I also am generally following the page API to create my page.. In following the page guidlines I have used 

$PAGE->set_context(context_system::instance());

This does not seem to work though in setting the context. All of the other referenced set_context() calls take an argument such as a courseid or other. 

How do I get a correct page context with the type of block I'm creating? Can I give it the site courseid as the arguemnt?

Looking for guidance.. 

thanks -- kevin


Viewing all articles
Browse latest Browse all 37675

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>