Exception - Too few arguments to function - content_item::__construct()

Exception - Too few arguments to function - content_item::__construct()

by BIBS Webmaster -
Number of replies: 2

Hi Everyone,

Wondered if you could help. I upgraded my moodle site to version 4.0.4 and since upgrading everything seems to be working as expected apart from when I try to add a new activity or resource to a course area. This is the same for any type of user with permission to add Activities and Resource.

I get the following error:

 Error occurred

Exception - Too few arguments to function core_course\local\entity\content_item::__construct(), 8 passed in [dirroot]/mod/lti/lib.php on line 284 and exactly 9 expected

Attachment Screenshot 2022-09-22 at 22.11.45.png
Attachment Screenshot 2022-09-22 at 22.14.17.png
Attachment Screenshot 2022-09-22 at 22.17.01.png
Average of ratings: -
In reply to BIBS Webmaster

Re: Exception - Too few arguments to function - content_item::__construct()

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
The code you have there, doesn't seem to match the latest code found in the MOODLE_400_STABLE branch: https://github.com/moodle/moodle/blob/MOODLE_400_STABLE/mod/lti/lib.php#L277

Maybe get a fresh copy of the code from the Moodle site?
In reply to Davo Smith

Re: Exception - Too few arguments to function - content_item::__construct()

by BIBS Webmaster -
Thank you Davo,

That was the problem and problem was resolved straight away. I'm not sure if this is related. But I've just tried to view one of the assignments from previous years and I'm not getting this error:
Exception - Argument 1 passed to mod_assign\output\renderer::render_assign_header() must be an instance of mod_assign\output\assign_header, instance of assign_header given, called in [dirroot]/lib/outputrenderers.php on line 491

Any ideas?
Attachment Screenshot 2022-09-22 at 23.47.50.png