-
Bug
-
Resolution: Fixed
-
Minor
-
3.6.1, 3.7.2
-
-
MOODLE_36_STABLE, MOODLE_37_STABLE
-
MOODLE_38_STABLE
-
Moodle App 3.8.0
Steps to reproduce:
- Login to site as admin
- Go to the site home
- Turn on editing
- Add a block -> activities
- Set the activities block Page contexts to "display throughout the entire site"
- Go back to site home
- Add an activity (forum, for example).
- Go to site admin -> Appearance -> Default Dashboard page and verify that the activities block is showing.
- Login into the Mobile App as a NON-admin who is not enrolled in any courses
- Navigate to the dashboard
- You will receive one of two errors, depending on if a course id is available that matches the user's id:
- If the course exists: You cannot execute functions in the course context (course id: <moodle user id>)
- If the course does not: Can't find data record in database table course (SELECT * FROM {course} where id = ? [array (0 => <userid>,)])
It appears the mobile app is calling 'core_course_get_contents' with a courseid/context equal to that of the user's id. In my test case below, the user id is 6 and such a course does not exist:
courseid:
6options[0][name]:
excludemodulesoptions[0][value]:
0options[1][name]:
excludecontentsoptions[1][value]:
1moodlewssettingfilter:
truemoodlewssettingfileurl:
true
Is this a mobile side issue or Moodle API side?