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

Global search fatal error when a file in mod_folder is renamed. mod_folder is not re-indexed when files are updated or added.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.1.8, 3.2.5, 3.3.2
    • Fix Version/s: 3.2.6, 3.3.3
    • Component/s: Global search
    • Labels:
    • Testing Instructions:
      Hide
      1. Setup global indexing
      2. Create a folder activity and add some test files (remember the file names)
      3. Index the site from the CLI: php search/cli/indexer.php
      4. Go to the folder activity and press "Edit" button
      5. Rename a file in the test folder activity
      6. Search for that file using the previous file name
      7. The file SHOULD NOT appear nor any fatal error
      8. Run the search indexer again from the CLI: php search/cli/indexer.php
      9. Search for that file using the new file name
      10. The file SHOULD appear as a search result
      Show
      Setup global indexing Create a folder activity and add some test files (remember the file names) Index the site from the CLI: php search/cli/indexer.php Go to the folder activity and press "Edit" button Rename a file in the test folder activity Search for that file using the previous file name The file SHOULD NOT appear nor any fatal error Run the search indexer again from the CLI: php search/cli/indexer.php Search for that file using the new file name The file SHOULD appear as a search result
    • Affected Branches:
      MOODLE_31_STABLE, MOODLE_32_STABLE, MOODLE_33_STABLE
    • Fixed Branches:
      MOODLE_32_STABLE, MOODLE_33_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-60105_master

      Description

      mod_folder.timemodified is not updated when updating the contents of a folder. The means that global search does not re-index the contents of the folder.

      If a file in the folder is renamed or deleted it will result in following fatal error when that file appears in the search results:

      Fatal error: Call to a member function get_filename() on a non-object in /search/classes/document.php on line 588

       

      Steps to reproduce:

      1. Setup global indexing
      2. Create a folder activity and add some test files
      3. Index the site from the CLI: php search/cli/indexer.php
      4. Go to the folder activity and press "Edit" button
      5. Rename a file in the test folder activity
      6. Search for that file
      7. Observe the fatal error
      8. Run the search indexer again from the CLI: php search/cli/indexer.php
      9. Observe that it does not re-index the folder.

       

        Attachments

          Activity

            People

            Assignee:
            matt.clarkson Matt Clarkson
            Reporter:
            matt.clarkson Matt Clarkson
            Peer reviewer:
            David Monllaó
            Integrator:
            Eloy Lafuente (stronk7)
            Tester:
            Ankit Agarwal
            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:
              Resolved:
              Fix Release Date:
              13/Nov/17