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

Global Search: Course sections indexing errors with call to undefined function

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 3.5
    • Fix Version/s: None
    • Component/s: Global search
    • Labels:
      None
    • Database:
      PostgreSQL
    • Testing Instructions:
      Hide
      1. Install a new Moodle 3.5 (or Master)
      2. Create a new course with the course format as topics
      3. Turn editing mode on for that course
      4. Edit topic 1
      5. Enter in a custom topic name
      6. Enter some topic description text
      7. Click save and display
      8. As an administrator enable Global Search for the site with simple search as the search engine
      9. From the command line for the site manually run the `\core\task\search_index_task` scheduled task

      Expected behavior:

      Index task should complete with out errors

      Bug behavior:

      Index task fails with a PHP exception of the course sections index sub task

      Show
      Install a new Moodle 3.5 (or Master) Create a new course with the course format as topics Turn editing mode on for that course Edit topic 1 Enter in a custom topic name Enter some topic description text Click save and display As an administrator enable Global Search for the site with simple search as the search engine From the command line for the site manually run the `\core\task\search_index_task` scheduled task Expected behavior: Index task should complete with out errors Bug behavior: Index task fails with a PHP exception of the course sections index sub task
    • Workaround:
      Hide

      Disabling the Course - sections search are via the admin UI stops the error from occurring. It also stops that are from being indexed

      Show
      Disabling the Course - sections search are via the admin UI stops the error from occurring. It also stops that are from being indexed
    • Affected Branches:
      MOODLE_35_STABLE

      Description

      In 3.5 and MASTER running the global search index schedule task from the command line results in a PHP exception as the `get_section_name` method can not be found. This looks like a recent regression.

      This seems to occur regardless of which search engine backend is being used.

      Full stack trace is:

       

      php admin/tool/task/cli/schedule_task.php --execute='\core\task\search_index_task'
       Execute scheduled task: Global search indexing (core\task\search_index_task)
       Processing area: Assignment - activity information
         No new documents to index.
       Processing area: Page
         No new documents to index.
       Processing area: Messages - sent
         No new documents to index.
       Processing area: Messages - received
         No new documents to index.
       Processing area: Course sections
       Default exception handler: Exception - Call to undefined function core_course\search\get_section_name() Debug: 
       Error code: generalexceptionmessage
       
      line 100 of /course/classes/search/section.php: Error thrown line ? of unknownfile: call to core_course\search\section->get_document() line 103 of /lib/classes/dml/recordset_walk.php: call to call_user_func() line 72 of /search/classes/skip_future_documents_iterator.php: call to core\dml\recordset_walk->current() line 93 of /search/classes/skip_future_documents_iterator.php: call to core_search\skip_future_documents_iterator->current() line 234 of /search/classes/engine.php: call to core_search\skip_future_documents_iterator->valid() line 899 of /search/classes/manager.php: call to core_search\engine->add_documents() line 59 of /lib/classes/task/search_index_task.php: call to core_search\manager->index() line 156 of /admin/tool/task/cli/schedule_task.php: call to core\task\search_index_task->execute() 

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                mattp@catalyst-au.net Matt Porritt
                Participants:
                Component watchers:
                Amaia Anabitarte, Bas Brands, Carlos Escobedo, Sara Arjona (@sarjona), Víctor Déniz Falcón
              • Votes:
                1 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: