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

White screen on auth test page

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Open site administration -> Plugins -> Manage Authentication
      2. Click Test settings beside any of the plugins
      3. Modify the URL to remove all query params (e.g. it should just be /auth/test_settings.php}})
        1. Confirm the dropdown select was shown
      4. Select a plugin from the dropdown
        1. Confirm that you were redirected and the page loaded
      Show
      Open site administration -> Plugins -> Manage Authentication Click Test settings beside any of the plugins Modify the URL to remove all query params (e.g. it should just be /auth/test_settings.php}}) Confirm the dropdown select was shown Select a plugin from the dropdown Confirm that you were redirected and the page loaded
    • Affected Branches:
      MOODLE_33_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE
    • Fixed Branches:
      MOODLE_33_STABLE, MOODLE_34_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-61860-master

      Description

      When accessing the "Test settings" page from the Manage authentication screen I encounter the following error:

      Array ( [0] => Array ( [file] => /var/www/moodle-future/releases/20180405003201/public/auth/test_settings.php [line] => 24 [function] => require ) ) /var/www/moodle-future/releases/20180405003201/publicArray ( [0] => Array ( [file] => /var/www/moodle-future/releases/20180405003201/public/auth/test_settings.php [line] => 26 [function] => require_once ) ) /var/www/moodle-future/shared/public
      Notice: Undefined property: stdClass::$libdir in /var/www/moodle-future/releases/20180405003201/public/auth/test_settings.php on line 27
       
      Warning: require_once(/adminlib.php): failed to open stream: No such file or directory in /var/www/moodle-future/releases/20180405003201/public/auth/test_settings.php on line 27
       
      Fatal error: require_once(): Failed opening required '/adminlib.php' (include_path='/var/www/moodle-future/current/public/lib/pear:.:/opt/rh/rh-php71/root/usr/share/pear:/opt/rh/rh-php71/root/usr/share/php') in /var/www/moodle-future/releases/20180405003201/public/auth/test_settings.php on line 27
      

      The environment is PHP 7.1 with PHP-FPM and Opcache. There are symlinks in play for the dirroot but config.php is configured appropriately.

      I think the root cause is how auth/test_settings.php imports config.php:

      require(__DIR__.'../../config.php');
      

      I'm not sure why this works in the first place; _DIR_ doesn't include a trailing slash. Anyway, it does work, only too well. It gets included twice, only most of the setup tasks from lib/setup.php don't happen the second time around, so you're missing all kinds of useful things like libdir. Standardizing the require statement to include the trailing slash does seem to resolve the issue. There's a similar block in enrol/test_settings.php which probably has the same issue.

      I think there's something about my environment causing the root issue but it makes sense to me to standardize these statements.

        Attachments

          Activity

            People

            Assignee:
            cfulton Charles Fulton
            Reporter:
            cfulton Charles Fulton
            Peer reviewer:
            Tim Hunt
            Integrator:
            Eloy Lafuente (stronk7)
            Tester:
            Janelle Barcega
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
            Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              17/May/18

                Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 38 minutes
                38m