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

codingerror in Global Search when "search within enrolled courses only" is set

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.5
    • Fix Version/s: None
    • Component/s: Global search
    • Labels:
    • Affected Branches:
      MOODLE_35_STABLE

      Description

      Steps to recreate -

      • enable global search on Moodle with all settings left as default
      • create a new course "veggies" and a label "cabbage"
      • give the course:view permission to "Authenticated users" for "veggies"
      • log in as a non-admin user, not registered on any courses
      • go into the "veggies" course and search for "cabbage" - no results, as expected, because "searchable courses" is still set to the default of "search within enrolled courses only"
      • from the "search within" drop-down menu choose "course: veggies" and search again

      Result -

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

      Stack trace:

      • line 770 of /lib/dml/moodle_database.php: coding_exception thrown
      • line 593 of /search/classes/manager.php: call to moodle_database->get_in_or_equal()
      • line 778 of /search/classes/manager.php: call to core_search\manager->get_areas_user_accesses()
      • line 684 of /search/classes/manager.php: call to core_search\manager->search()
      • line 150 of /search/index.php: call to core_search\manager->paged_search()

      The error doesn't occur if you've changed "searchable courses" to "search within all courses the user can access"
       

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mjr66 Mat Ridley
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: