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

Global search configuration screen does memorize the fact that external programs are outside moodle directory

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 1.9.11
    • Fix Version/s: None
    • Component/s: Global search
    • Labels:
      None
    • Environment:
      any

      Description

      In configuration screen of the Moodle's 1.9 Global Search there is a config option 'block_search_usemoodleroot' that specify whether the external programs (pdftotext, doctotext...) should be within moodledata directory of not.

      Or it looks like that this option is never correctly retrieved from database and always reset to 1 when updating the
      configuration thus leading to a lot of confusion when global search starts failing because the external programs
      are indeed outside moodledata (where they should normally be on a 'regular server', but may be not on an 'hosted moodle site')

      This is due to the following piece of code in blocks/search/config_global.html

      $usemoodleroot = (isset($CFG->block_search_usemoodleroot)) ? 'checked="checked"' : '' ;
      $notusemoodleroot = (!isset($CFG->block_search_usemoodleroot)) ? 'checked="checked"' : '' ;

      that should be :

      $usemoodleroot = (! empty($CFG->block_search_usemoodleroot)) ? 'checked="checked"' : '' ;
      $notusemoodleroot =(empty($CFG->block_search_usemoodleroot)) ? 'checked="checked"' : '' ;

      Indeed $usemoodleroot should be 'checked' if and only if $CFG->block_search_usemoodleroot is 1 (!empty) and
      not if it is set (has any value including 0)

      The same goes for $notusemoodleroot that should be 'checked' only if $CFG->block_search_usemoodleroot is 0 (empty)
      and not if is not set ...

      Cheers.

        Gliffy Diagrams

          Attachments

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: