Adaptable Theme Error Moodle 3.9

Adaptable Theme Error Moodle 3.9

by Rachel Martin -
Number of replies: 6

Good morning, 

I have recently upgraded to Moodle 3.9 on my development server and installed Adaptable.  Everything has gone well, but I have seen the following error come up a couple of times.

The error seems to be related to an account with system level role assignments visiting a course that has an expired enrollment for that account.  If the enrollment is removed and added back as an active enrollment, it disappears.  Once it is gone, I can't seem to get it to reproduce if I then expire that enrollment.

The first time I saw the error it was on a different course that did not use the topcoll format, so I do not believe that is a factor.  I thought the initial error was a fluke but then it came up again.  

------------------------------

Please do not call get_users_roles() with $checkparentcontexts = true and $userids array not set. This combination causes large Moodle sites with lots of site-wide role assignemnts to run out of memory.

line 2878 of \lib\accesslib.php: call to debugging()

line 850 of \theme\adaptable\classes\activity.php: call to get_users_roles()

line 155 of \theme\adaptable\classes\activity.php: call to theme_adaptable\activity::course_participant_count()

line 312 of \theme\adaptable\classes\activity.php: call to theme_adaptable\activity::std_meta()

line ? of unknownfile: call to theme_adaptable\activity::lesson_meta()

line 59 of \theme\adaptable\classes\activity.php: call to call_user_func()

line 791 of \theme\adaptable\classes\output\core\course_renderer.php: call to theme_adaptable\activity::module_meta()

line 747 of \theme\adaptable\classes\output\core\course_renderer.php: call to theme_adaptable\output\core\course_renderer->course_section_cm_get_meta()

line 856 of \course\renderer.php: call to theme_adaptable\output\core\course_renderer->course_section_cm()

line 1049 of \course\renderer.php: call to core_course_renderer->course_section_cm_list_item()

line 1111 of \course\format\topcoll\renderer.php: call to core_course_renderer->course_section_cm_list()

line 214 of \course\format\topcoll\format.php: call to format_topcoll_renderer->print_multiple_section_page()

line 290 of \course\view.php: call to require()

Notice: Undefined offset: 3446 in \moodle\theme\adaptable\classes\activity.php on line 888

Notice: Undefined offset: 3448 in \moodle\theme\adaptable\classes\activity.php on line 888

Average of ratings: -
In reply to Rachel Martin

Re: Adaptable Theme Error Moodle 3.9

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
Ok, I understand all of the code, however, the line numbers are meaningless without the versions.... so as per all the notices all over the forum.... what version of the theme are you running please? Does the issue happen on courses with no enrolled users?
In reply to Gareth J Barnard

Re: Adaptable Theme Error Moodle 3.9

by Rachel Martin -

Sorry, it is the current version for Moodle 3.9 --  3.0.2

In reply to Rachel Martin

Re: Adaptable Theme Error Moodle 3.9

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Please patch with this version of the file and see if it solves the problem: https://gitlab.com/jezhops/moodle-theme_adaptable/-/blob/eeefc6adc8cad9675efa5403e2362eb4e706f20c/classes/activity.php.

In reply to Gareth J Barnard

Re: Adaptable Theme Error Moodle 3.9

by Rachel Martin -

The patch worked.  I am no longer getting the error.

Thank you!

In reply to Rachel Martin

Re: Adaptable Theme Error Moodle 3.9

by Bruce Musinguzi -
Hi... How did you patch???
In reply to Bruce Musinguzi

Re: Adaptable Theme Error Moodle 3.9

by Rachel Martin -
In that instance it was replacing the class/activity.php file with the one from the link. But he has released newer versions of the plugin since that time.