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

Mitigate regression in PECL solr extension v2.5.0

XMLWordPrintable

    • Any
    • MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE
    • MOODLE_36_STABLE, MOODLE_37_STABLE
    • m38_MDL-66140_Mitigate_PECL_Solr_issue_Ref_72740
    • Hide

      (difficulty: easy, requires to being able to install the PECL solr extension)
      Unit tests should be enough.

      You need to install the brand new PECL solr ext v2.5.0 and launch first a specific test session to quickly check its success and then the full run of Moodle unit tests.

      If you're familiar w/ the Moodle Docker Toolbox you should use the sequence of CLI commands listed above, in the Description of the issue.

      Show
      (difficulty: easy, requires to being able to install the PECL solr extension) Unit tests should be enough. You need to install the brand new PECL solr ext v2.5.0 and launch first a specific test session to quickly check its success and then the full run of Moodle unit tests. If you're familiar w/ the Moodle Docker Toolbox you should use the sequence of CLI commands listed above, in the Description of the issue.

      Long story short, SolrDisMaxQuery::addQueryField() doesn't work as expected when not passing the optional boost value, since long time.
      PECL solr extension has been finally GAed w/ support for PHP 7.2 and 7.3 via v2.5.0, unfortunately still including the regression above.

      Test:

      # export MOODLE_DOCKER_WWWROOT=/path/to/moodle-master
      # export MOODLE_DOCKER_DB=mysql
      # export MOODLE_DOCKER_PHP_VERSION=7.2
      # export MOODLE_DOCKER_PHPUNIT_EXTERNAL_SERVICES=true
      # bin/moodle-docker-compose up -d && bin/moodle-docker-wait-for-db
      # bin/moodle-docker-compose exec webserver php admin/tool/phpunit/cli/init.php
      # bin/moodle-docker-compose exec webserver php --ri solr
       
      solr
       
      Solr Support => enabled
      Version => 2.4.0
      Last Build Date => May 27 2019
      Last Build Time => 00:58:51
      # bin/moodle-docker-compose exec webserver php vendor/bin/phpunit --filter test_search search_solr_engine_testcase search/engine/solr/tests/engine_test.php -v
      [cut]
      OK (2 tests, 28 assertions)
      # bin/moodle-docker-compose exec webserver apt-get update
      # bin/moodle-docker-compose exec webserver apt-get install -y --no-install-recommends libcurl4-openssl-dev libxml2-dev
      # bin/moodle-docker-compose exec webserver pecl install solr
      # bin/moodle-docker-compose exec webserver php --ri solr
       
      solr
       
      Solr Support => enabled
      Version => 2.5.0
      Last Build Date => Jul 12 2019
      Last Build Time => 20:14:06
      # bin/moodle-docker-compose exec webserver php vendor/bin/phpunit --filter test_search search_solr_engine_testcase search/engine/solr/tests/engine_test.php -v
      [cut]
      FAILURES!
      Tests: 2, Assertions: 2, Failures: 2.
      

      Refs:

            matteo Matteo Scaramuccia
            matteo Matteo Scaramuccia
            Jun Pataleta Jun Pataleta
            Jun Pataleta Jun Pataleta
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 31 minutes
                1h 31m

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