Uploaded image for project: 'Moodle app'
  1. Moodle app
  2. MOBILE-3235

Error on Dashboard when Activity Block is added

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Steps to reproduce:

      1. Login to site as admin
      2. Go to the site home
      3. Turn on editing
      4. Add a block -> activities
      5. Set the activities block Page contexts to "display throughout the entire site"
      6. Go back to site home
      7. Add an activity (forum, for example).
      8. Go to site admin -> Appearance -> Default Dashboard page and verify that the activities block is showing.
      9. Login into the Mobile App as a NON-admin who is not enrolled in any courses
      10. Navigate to the dashboard
      11. You should see an activities block displaying the block you've previously created.
      Show
      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 should see an activities block displaying the block you've previously created.
    • Affected Branches:
      MOODLE_36_STABLE, MOODLE_37_STABLE
    • Fixed Branches:
      MOODLE_38_STABLE
    • Pull Master Branch:
    • Sprint:
      Moodle App 3.8.0

      Description

      Steps to reproduce:

      1. Login to site as admin
      2. Go to the site home
      3. Turn on editing
      4. Add a block -> activities
      5. Set the activities block Page contexts to "display throughout the entire site"
      6. Go back to site home
      7. Add an activity (forum, for example).
      8. Go to site admin -> Appearance -> Default Dashboard page and verify that the activities block is showing.
      9. Login into the Mobile App as a NON-admin who is not enrolled in any courses
      10. Navigate to the dashboard
      11. You will receive one of two errors, depending on if a course id is available that matches the user's id:
        1. If the course exists: You cannot execute functions in the course context (course id: <moodle user id>)
        2. 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:

      1. courseid:
        6

      2. options[0][name]:
        excludemodules

      3. options[0][value]:
        0

      4. options[1][name]:
        excludecontents

      5. options[1][value]:
        1

      6. moodlewssettingfilter:
        true

      7. moodlewssettingfileurl:
        true

      Is this a mobile side issue or Moodle API side?

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                20/Dec/19