Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report in course context with course secondary navigation NOT module navigation links #10

Open
moodleulpgc opened this issue May 30, 2023 · 3 comments

Comments

@moodleulpgc
Copy link

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.

@marcusgreen
Copy link
Owner

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.

@marcusgreen
Copy link
Owner

marcusgreen commented Jul 22, 2023

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.

@marcusgreen
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants