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

uncaught exception: Call to undefined function uuid_make()in file: lib/setuplib.php line 618

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      (difficulty: easy, requires a docker enabled env)
      Tests are covered by unit.

      First run - No PHP uuid extensions

      # export MOODLE_DOCKER_WWWROOT=/path/to/moodle
      # cp config.docker-template.php $MOODLE_DOCKER_WWWROOT/config.php
      # export MOODLE_DOCKER_DB=mysql <== Any DB Server here
      # 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 vendor/bin/phpunit --verbose core_setuplib_testcase lib/tests/setuplib_test.php
      

      Tests should pass, mentioning one skipped test only in branch m38_MDL-61038_Fix_uuid_extensions_usage_v2:

      ...
      There was 1 skipped test:
       
      1) core_setuplib_testcase::test_core_uuid_generate_uuid_via_pecl_uuid_extension
      PHP 'uuid' extension not loaded.
       
      /var/www/html/lib/tests/setuplib_test.php:502
      /var/www/html/lib/phpunit/classes/advanced_testcase.php:80
       
      To re-run:
       vendor/bin/phpunit --verbose "core_setuplib_testcase" lib/tests/setuplib_test.php
       
      OK, but incomplete, skipped, or risky tests!
      Tests: 26, Assertions: 116, Skipped: 1.
      

      Second run - Install PECL uuid extension

      # bin/moodle-docker-compose exec webserver apt-get update
      # bin/moodle-docker-compose exec webserver apt-get install -y uuid-dev 
      # bin/moodle-docker-compose exec webserver pecl install uuid
      # bin/moodle-docker-compose exec webserver docker-php-ext-enable uuid
      # bin/moodle-docker-compose exec webserver vendor/bin/phpunit --verbose core_setuplib_testcase lib/tests/setuplib_test.php
      

      Tests should pass, w/o any skipped test:

      ...
      OK (26 tests, 117 assertions)
      

      Note: numbers of tests and assertions are related to 3.8 branch (m38_MDL-61038_Fix_uuid_extensions_usage_v2).

      Show
      (difficulty: easy, requires a docker enabled env) Tests are covered by unit. First run - No PHP uuid extensions # export MOODLE_DOCKER_WWWROOT=/path/to/moodle # cp config.docker-template.php $MOODLE_DOCKER_WWWROOT/config.php # export MOODLE_DOCKER_DB=mysql <== Any DB Server here # 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 vendor/bin/phpunit --verbose core_setuplib_testcase lib/tests/setuplib_test.php Tests should pass, mentioning one skipped test only in branch m38_MDL-61038_Fix_uuid_extensions_usage_v2 : ... There was 1 skipped test:   1) core_setuplib_testcase::test_core_uuid_generate_uuid_via_pecl_uuid_extension PHP 'uuid' extension not loaded.   /var/www/html/lib/tests/setuplib_test.php:502 /var/www/html/lib/phpunit/classes/advanced_testcase.php:80   To re-run: vendor/bin/phpunit --verbose "core_setuplib_testcase" lib/tests/setuplib_test.php   OK, but incomplete, skipped, or risky tests! Tests: 26, Assertions: 116, Skipped: 1. Second run - Install PECL uuid extension # bin/moodle-docker-compose exec webserver apt-get update # bin/moodle-docker-compose exec webserver apt-get install -y uuid-dev # bin/moodle-docker-compose exec webserver pecl install uuid # bin/moodle-docker-compose exec webserver docker-php-ext-enable uuid # bin/moodle-docker-compose exec webserver vendor/bin/phpunit --verbose core_setuplib_testcase lib/tests/setuplib_test.php Tests should pass, w/o any skipped test: ... OK (26 tests, 117 assertions) Note: numbers of tests and assertions are related to 3.8 branch ( m38_MDL-61038_Fix_uuid_extensions_usage_v2 ).
    • Workaround:
      Hide

      Uninstall PECL uuid extension.

      Show
      Uninstall PECL uuid extension.
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE
    • Fixed Branches:
      MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE
    • Pull from Repository:
    • Pull 3.5 Branch:
      m35_MDL-61038_Fix_uuid_extensions_usage_v2
    • Pull 3.7 Branch:
      m37_MDL-61038_Fix_uuid_extensions_usage_v2
    • Pull Master Branch:
      m38_MDL-61038_Fix_uuid_extensions_usage_v2

      Description

      Hi,

      This error occured when I tried to start a quiz or when I tried to update plugins:

      uncaught exception: Call to undefined function uuid_make()in file: /home/maicolml/public_html/quiz/lib/setuplib.php line 618 wiris
      

      Now I have commented these lines of the setuplib.php file and it works:

      if (function_exists("uuid_create")) {
              $context = null;
              uuid_create($context);
       
              uuid_make($context, UUID_MAKE_V4);
              uuid_export($context, UUID_FMT_STR, $uuid);
          } else {
      

      Please delete them otherwise users that will install WIRIS plugin will affect this issue...

      Steps to test this:

      1. Install WIRIS plugin
      2. Make a quiz with WIRIS plugin
      3. Try to start the quiz or update a plugin

        Attachments

        1. 35_first_run.png
          35_first_run.png
          94 kB
        2. 35_second_run.png
          35_second_run.png
          103 kB
        3. 36_first_run.png
          36_first_run.png
          96 kB
        4. 36_second_run.png
          36_second_run.png
          104 kB
        5. 37_first_run.png
          37_first_run.png
          103 kB
        6. 37_second_run.png
          37_second_run.png
          103 kB
        7. master_first_run.png
          master_first_run.png
          186 kB
        8. master_second_run.png
          master_second_run.png
          104 kB

          Issue Links

            Activity

              People

              Assignee:
              matteo Matteo Scaramuccia
              Reporter:
              maicol07 Maicol Battistini
              Peer reviewer:
              Tim Hunt
              Integrator:
              Andrew Nicols
              Tester:
              Michael Hawkins
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              Votes:
              2 Vote for this issue
              Watchers:
              8 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                8/Jul/19

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 3 hours, 40 minutes
                  3h 40m