Issue Details (XML | Word | Printable)

Key: MDL-11292
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Critical Critical
Assignee: Petr Skoda
Reporter: Mark Nielsen
Votes: 0
Watchers: 1
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

Cannot create child auth plugins

Created: 15/Sep/07 07:25 AM   Updated: 17/Sep/07 05:35 AM
Return to search
Component/s: Administration, Authentication, Networking
Affects Version/s: 1.8
Fix Version/s: 1.8.3, 1.9

File Attachments: 1. File mnetadminlib.diff (0.7 kB)


Participants: Mark Nielsen, Martín Langhoff and Petr Skoda
Security Level: None
Resolved date: 15/Sep/07
Affected Branches: MOODLE_18_STABLE
Fixed Branches: MOODLE_18_STABLE, MOODLE_19_STABLE


 Description  « Hide
Cannot create child authentication plugins because it will throw a Fatal Error upon installation. Tracked down the culprit in function mnet_get_functions defined in admin/mnet/adminlib.php. Attached is a proposed fix, but several other solutions come to mind that take advantage of existing API to manage enrol/auth plugins.

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Petr Skoda made changes - 15/Sep/07 05:17 PM
Field Original Value New Value
Assignee Martin Dougiamas [ dougiamas ] Petr Skoda [ skodak ]
Petr Skoda committed 1 file to 'Moodle CVS' - 15/Sep/07 05:29 PM
MDL-11292 fixed Cannot create child auth plugins - patch by Mark Nielsen; used inlude_once() when searching for functions/methods in files
MODIFY admin/mnet/adminlib.php   Rev. 1.3    (+2 -2 lines)
Petr Skoda committed 1 file to 'Moodle CVS' on branch 'MOODLE_18_STABLE' - 15/Sep/07 05:31 PM
MDL-11292 fixed Cannot create child auth plugins - patch by Mark Nielsen; used inlude_once() when searching for functions/methods in files; backported from HEAD
MODIFY admin/mnet/adminlib.php   Rev. 1.2.2.1    (+2 -2 lines)
Petr Skoda added a comment - 15/Sep/07 05:38 PM
The quick patch is in CVS, I have changed one more include to include_once(). I agree this use of include() is a potential problem because it might cause breakage in the future in some contexts, when including library files we should IMO always use xx_once(). The exceptions are our version, access, defaults where we construct arrays or set some variables.

CCing Martín, please file a new issue if other improvements needed, feel free to revert the commit

thanks for the report and patch


Petr Skoda made changes - 15/Sep/07 05:38 PM
Resolution Fixed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 1.9 [ 10190 ]
Mark Nielsen added a comment - 16/Sep/07 12:42 AM
Thanks Petr for your quick response! Having the patch in so quickly is really appreciated

I agree with using the x_once() approach since one never knows when it might have already been included, especially with plugins and class definitions. Along this line, I was wondering if Moodle has a coding preference to write includes/requires as statements or as functions. So:

require_once 'path/to/file';

or

require_once('path/to/file');

Cheers and thanks again Petr!


Petr Skoda added a comment - 16/Sep/07 03:05 AM
there is no official way - though most ppl use the function style calls

Martín Langhoff added a comment - 17/Sep/07 05:35 AM
ACK! Good patch - wonder how that got in there without anyone realising.