Steps to reproduce:
- Login as admin.
- Create a course.
- Add an H5P activity.
- Add the "Navigation" block to the main course page.
- Configure the "Navigation" block and set "Display on page types" to "Any page".
- Access to the H5P activity you created.
The H5P player is displayed without any error.
Above the H5P player, the following error is displayed: "Notice: Trying to get property 'id' of non-object in moodle/lib/navigationlib.php on line 1407"
It happens with any of the H5P contents displayed in the course (not just the H5P activity). And I've been able to reproduce it in Moodle 3.11 onwards (in Moodle 3.10 is working as expected).