You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, the report page construct a table for a single instance of Assignment, just a single course_module.
The information shown belongs to a a single instance, so it should show the navigation, secondary navigation, for that module instance.
Yet, the page is constructed in course context and show secondary navigation links corresponding to a course main page. Using moodle 4.1.
It seems that changing locallib.php function init(array $data)
$PAGE->set_context(context_course::instance($data['courseid']));
to
$PAGE->set_context(context_module::instance($data['modid']));
makes the magic: secondary navigation is then the assignment instance one.
However there is a warning about reading id of an empty object.
The text was updated successfully, but these errors were encountered:
You are correct the context is incorrect. I added your change with debug set to developer and it threw a big error, but I could see the menus were what they ought to be. I will not be able to work on this until next week and I will post an update. There is an interesting error described in one of the other tickets I also need to work on.
I have just spent several hours trying to fix the issue I mentioned ..warning about reading id of an empty object. You only see if briefly in the browser but it is in the html and I don't want to release something with a mysterious bug in it.
As I cannot get to the bottom of it I will not change the context for the next release.
Cancel that comment. I think I have managed to put it into module context without any errors.
I believe this is fixed now (I should have kept the commit). I will close this ticket. Feel free to re-open if you believe the issue is still there. My apologies for taking so long to get back to you on this.
Marcus
Hi, the report page construct a table for a single instance of Assignment, just a single course_module.
The information shown belongs to a a single instance, so it should show the navigation, secondary navigation, for that module instance.
Yet, the page is constructed in course context and show secondary navigation links corresponding to a course main page. Using moodle 4.1.
It seems that changing locallib.php function init(array $data)
$PAGE->set_context(context_course::instance($data['courseid']));
to
$PAGE->set_context(context_module::instance($data['modid']));
makes the magic: secondary navigation is then the assignment instance one.
However there is a warning about reading id of an empty object.
The text was updated successfully, but these errors were encountered: