Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-70251

Search: Error if user filters results to a course they are not enrolled in

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Minor
    • None
    • 3.9.3
    • Global search
    • None
    • MOODLE_39_STABLE
    • MDL-70251-master
    • Hide

      Note: It doesn't matter which search engine you use for this, the default (simple database search) is fine.

      1. On the search settings page (Plugins > Search > Manage global search), turn on the 'Include all visible courses' option (if not on already).
      2. Select a course for testing. Edit the course summary to add an interesting word, such as FROOGLEBLISS.
      3. Make sure search indexing has run since you changed the summary (e.g. run or wait for the 'Global search indexing' scheduled task).
      4. Log in as a non-admin test user who is NOT enrolled in the course.
      5. Go to the search screen (type something in the search box and press return).
      6. Open the 'Filters' fieldset, and under 'Courses', type and select the name of the course selected above (that the user is not enrolled in).
      7. Do a search for FROOGLEBLISS.
        • EXPECTED: You should get the search result, and not an error message
      Show
      Note: It doesn't matter which search engine you use for this, the default (simple database search) is fine. On the search settings page (Plugins > Search > Manage global search), turn on the 'Include all visible courses' option (if not on already). Select a course for testing. Edit the course summary to add an interesting word, such as FROOGLEBLISS. Make sure search indexing has run since you changed the summary (e.g. run or wait for the 'Global search indexing' scheduled task). Log in as a non-admin test user who is NOT enrolled in the course. Go to the search screen (type something in the search box and press return). Open the 'Filters' fieldset, and under 'Courses', type and select the name of the course selected above (that the user is not enrolled in). Do a search for FROOGLEBLISS. EXPECTED: You should get the search result, and not an error message

    Description

      1 On the search settings page (Plugins > Search > Manage global search), turn on the 'Include all visible courses' option.
      2 Log in as a non-admin user.
      3 Go to the search screen (type something in the search box and press return).
      4 Open the 'Filters' fieldset, and under 'Courses', type and select the name of a course that the current user is NOT enrolled in.
      5 Do a search

      This error occurs:

      Coding error detected, it must be fixed by a programmer: moodle_database::get_in_or_equal() does not accept empty arrays

      More information about this error
      Debug info:
      Error code: codingerror
      Stack trace:

      line 770 of \lib\dml\moodle_database.php: coding_exception thrown
      line 836 of \search\classes\manager.php: call to moodle_database->get_in_or_equal()
      line 1041 of \search\classes\manager.php: call to core_search\manager->get_areas_user_accesses()
      line 940 of \search\classes\manager.php: call to core_search\manager->search()
      line 176 of \search\index.php: call to core_search\manager->paged_search()

      Attachments

        Issue Links

          Activity

            People

              quen Sam Marshall
              quen Sam Marshall
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Clockify

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.