Guest are continually asked for an enrolment password when trying to enter courses they should have access to
Description
Testing Instructions
1/ use DB editor and set some enrol->password fields from guest plugin to NULL
2/ make sure user can not access
3/ upgrade and verify guest access is now possible
4/ try upgrade from 1.9
Automated test results
Pre-check results
Workaround
is a regression caused by

Activity

Yes, you did it!
Now your code is part of the best weeklies released ever, many thanks!
Closing, ciao

Eloy: that table is general, each plugin defines what each filed means - changing to NOT NULL would break BC which is not acceptable for stable, this was one of the reasons why I fixed the trouble with '' because in current 2.2 stable it is expecting empty strings, in older 2.0 and 2.1 we have a mixture there and use sloppy empty(). And no, it is not your fault, I am thinking very slowly these days...

I'm a noob here so I'm going to be quite terse in case I've made a false assumption in my test process. This is how I interpreted the test instructions and performed them:
1)
git checkout -b preGuestFix da3494a8c42a1bf08fa921f4a9cd73fd4c1df443; # The commit just before the fix was applied to moodle22stable integration on git.moodle.org/integration.git
created a blank database moodle_int_moodle22stable the with appropriate settings.
ran the following command to set everything up:
created a test course with guest access and no course password.
Logged out and logged in as guest on the course
Logged back into admin and out again, to clear any guest session.
Change the mdl_enrol.password field for guest to NULL
2)
Tried to "Login as a Guest" and recieved a password box
cat enrol/guest/version.php | grep "plugin->version"; # outputs: $plugin->version = 2011112900; // The current plugin version (Date: YYYYMMDDXX)
3)
git checkout MOODLE_22_STABLE # git rev-parse HEAD returns 4dbdc834ffc4adf09c4ae104b9024f61388a2c53
Just to prove that the patch is applied:git remote add skodak git://github.com/skodak/moodle.git
git fetch skodak
git merge skodak/w50_MDL-30623_m22_guest # returns "Already up-to-date."
cat enrol/guest/version.php | grep "plugin->version"; # outputs: $plugin->version = 2011112901; // The current plugin version (Date: YYYYMMDDXX)
logged into admin, went to home and performed upgrade
logged out.
Clicked on "Login as a Guest" for the course
It worked, WOOT!
4)
Setup 1.9 instance with test course that has guess access (without a key)
Login as guest and enter the course as a guest.
Login as admin to clear the guest session.
git fetch integration
git checkout -b MOODLE_22_STABLE integration/MOODLE_22_STABLE
Run upgrade
Sign out of admin
Log into test course as guest
TEST PASSED.
Thanks to Rajesh, Jason and Aparup for your help with this.

Wow, I must be losing explaining skills,
I saw your upgrade script and the SQL update on it, obviouly. What I'm saying, is that we should ALTER the table to stop accepting nulls (right now it continues accepting them, you just modified the contents).

my patch did roughly 2/, the logic should be fine, I could have implemented it as NULLS, but it was already using empties in 2.2
Details
Details
Priority
Affects versions
Components
Assignee

Reporter

Integrator

Fix versions
Tester

Participants





Pull from Repository
Pull Main Diff URL
Pull Main Branch
Clockify
Start / Stop
Clockify

https://moodle.atlassian.net/browse/MDL-30148#icft=MDL-30148 added 3 tighter checks on $instance->password in enrol/guest/lib.php
eg
Since the default value of this field in the database is actually NULL this now breaks sites like moodle.org with a lot of guest access by forcing everyone to type a guest password.