]> git.mjollnir.org Git - moodle.git/log
moodle.git
16 years agoMDL-15484 Avoid JavaScript errors after a popup has been blocked.
tjhunt [Tue, 31 Mar 2009 03:24:21 +0000 (03:24 +0000)]
MDL-15484 Avoid JavaScript errors after a popup has been blocked.

Also clean up coding style of some nearby functions.

16 years agoUpdated the HEAD build version to 20090331
moodlerobot [Tue, 31 Mar 2009 00:35:40 +0000 (00:35 +0000)]
Updated the HEAD build version to 20090331

16 years agoMDL-18540 fixing "extra" memory strings
skodak [Mon, 30 Mar 2009 17:09:39 +0000 (17:09 +0000)]
MDL-18540 fixing "extra" memory strings

16 years ago"MDL-18540, change the uses of option"
dongsheng [Mon, 30 Mar 2009 10:07:24 +0000 (10:07 +0000)]
"MDL-18540, change the uses of option"

16 years agoeditor formslib element: symbolic constant EDITOR_UNLIMITED_FILES instead of hard...
tjhunt [Mon, 30 Mar 2009 10:01:39 +0000 (10:01 +0000)]
editor formslib element: symbolic constant EDITOR_UNLIMITED_FILES instead of hard-coded -1.

16 years ago"MDL-18540, change option name to extramemorylimit"
dongsheng [Mon, 30 Mar 2009 09:42:28 +0000 (09:42 +0000)]
"MDL-18540, change option name to extramemorylimit"

16 years ago"MDL-18540, use admin_setting_configselect to set option"
dongsheng [Mon, 30 Mar 2009 09:17:44 +0000 (09:17 +0000)]
"MDL-18540, use admin_setting_configselect to set option"

16 years agoqtypes: MDL-18711 Allow qtype plugins to have custom CSS and JavaScript on the editin...
tjhunt [Mon, 30 Mar 2009 09:15:46 +0000 (09:15 +0000)]
qtypes: MDL-18711 Allow qtype plugins to have custom CSS and JavaScript on the editing page.

16 years agofilters: MDL-17684 Look for the filter name in filter_myfilter.php first.
tjhunt [Mon, 30 Mar 2009 08:33:13 +0000 (08:33 +0000)]
filters: MDL-17684 Look for the filter name in filter_myfilter.php first.

This makes filters more plugginable, becuase with this lang file name, get_string will look for the filter name in filter/myfilter/lang/en_utf8/filter_myfilter.php.

To do this, there is a new function filter_get_name in filterlib that contains the logic.

Also, a new function filter_get_all_installed to replace the logic for getting all filters that was duplicated in three places.

filter_get_name no longer does such a nice fall-back if the name is missing, to encourage people to supply the right string. The fallback now looks like '[[filtername]] (filter/tidy)'.

16 years agoMDL-18409: new message required for "Remove grade item" form element
gbateson [Mon, 30 Mar 2009 07:09:56 +0000 (07:09 +0000)]
MDL-18409: new message required for "Remove grade item" form element

16 years agoDB unit tests: improve the class so it is easier to use.
tjhunt [Mon, 30 Mar 2009 07:05:29 +0000 (07:05 +0000)]
DB unit tests: improve the class so it is easier to use.

16 years agowhen search for media players, remove requirment for <object> tag to contain a space...
gbateson [Mon, 30 Mar 2009 07:03:55 +0000 (07:03 +0000)]
when search for media players, remove requirment for <object> tag to contain a space, and make closing </A> tag lowercase

16 years agoget_string: MDL-13816 allow third-partly modules to register sub-plugin types that...
tjhunt [Mon, 30 Mar 2009 06:13:35 +0000 (06:13 +0000)]
get_string: MDL-13816 allow third-partly modules to register sub-plugin types that have their own lang files.

I suppose to be really useful we should deal with database, capabiltities, etc. too in due course. Still, this is a start.

16 years agohelp.php: related to MDL-13816. Clean up the URLs used for help files by removing...
tjhunt [Mon, 30 Mar 2009 06:11:32 +0000 (06:11 +0000)]
help.php: related to MDL-13816. Clean up the URLs used for help files by removing unused parameters.

16 years ago"MDL-18540, fixed default value of memorylimit"
dongsheng [Mon, 30 Mar 2009 04:42:55 +0000 (04:42 +0000)]
"MDL-18540, fixed default value of memorylimit"

16 years agoget_string: Refactoring, performance improvements, bug fixes and unit tests
tjhunt [Mon, 30 Mar 2009 02:21:27 +0000 (02:21 +0000)]
get_string: Refactoring, performance improvements, bug fixes and unit tests

MDL-18669 get_string refactored to elimiate duplicate code and make it easier to understand.
MDL-17763 parent language not processed correctly when getting a plugin string.
MDL-16181 more intelligent caching to avoid repeated file_exists checks.
MDL-12434 move values to array keys to improve lookup times.

The main part of the refactoring is to create a singleton string_manager class to encapsulate the cached data and the processing, while breaking the code up into more smaller methods.

Other performance improvements include:
* Cache results of plugin name -> locations to search array.
* Cache parent lang lookup.
* Skip eval if the string does not contain $ \ or %.
* Remove the unnecessary sprintf from the eval.

There is a performance testing script in lib/simpletest/getstringperformancetester.php. For now this script has the old get_string implementation copied and pasted to the end, and renamed to old_get_string to allow for comparitive timings.

There are now some unit tests for get_string in lib/simpletest/teststringmanager.php. I think I have managed to cover most of the tricky cases.

16 years agoRemove failing unit tests. (We are going to remove enum support from the database...
tjhunt [Mon, 30 Mar 2009 01:57:47 +0000 (01:57 +0000)]
Remove failing unit tests. (We are going to remove enum support from the database layer anyway.)

16 years agoUpdated the HEAD build version to 20090330
moodlerobot [Mon, 30 Mar 2009 00:40:05 +0000 (00:40 +0000)]
Updated the HEAD build version to 20090330

16 years agoMDL-18716 - ALL Notification E-Mails are sent to System Admins
agrabs [Sun, 29 Mar 2009 01:30:38 +0000 (01:30 +0000)]
MDL-18716 - ALL Notification E-Mails are sent to System Admins

16 years agoUpdated the HEAD build version to 20090329
moodlerobot [Sun, 29 Mar 2009 00:35:19 +0000 (00:35 +0000)]
Updated the HEAD build version to 20090329

16 years agoDML fix
skodak [Sat, 28 Mar 2009 22:18:53 +0000 (22:18 +0000)]
DML fix

16 years agoMDL-14591 adding standard access control
skodak [Sat, 28 Mar 2009 22:15:12 +0000 (22:15 +0000)]
MDL-14591 adding standard access control

16 years agoMDL-14591 adding standard access control
skodak [Sat, 28 Mar 2009 22:02:00 +0000 (22:02 +0000)]
MDL-14591 adding standard access control

16 years agoMDL-18733 adding note - we need to use user keys instead of cookies here
skodak [Sat, 28 Mar 2009 21:45:54 +0000 (21:45 +0000)]
MDL-18733 adding note - we need to use user keys instead of cookies here

16 years agoMDL-14679 fixed DML
skodak [Sat, 28 Mar 2009 15:59:26 +0000 (15:59 +0000)]
MDL-14679 fixed DML

16 years agoMDL-18163 removed bogus archive
skodak [Sat, 28 Mar 2009 15:57:16 +0000 (15:57 +0000)]
MDL-18163 removed bogus archive

16 years agoMDL-18727 param types ARE required
skodak [Sat, 28 Mar 2009 15:51:42 +0000 (15:51 +0000)]
MDL-18727 param types ARE required

16 years agoMDL-18729 param types ARE required
skodak [Sat, 28 Mar 2009 15:46:34 +0000 (15:46 +0000)]
MDL-18729 param types ARE required

16 years agoMDL-18728 dml cleanup
skodak [Sat, 28 Mar 2009 15:45:41 +0000 (15:45 +0000)]
MDL-18728 dml cleanup

16 years agoMDL-18163 noting arrayview.php design is not acceptable in official moodle
skodak [Sat, 28 Mar 2009 15:39:31 +0000 (15:39 +0000)]
MDL-18163 noting arrayview.php design is not acceptable in official moodle

16 years agoMDL-18726 dml cleanup
skodak [Sat, 28 Mar 2009 15:18:38 +0000 (15:18 +0000)]
MDL-18726 dml cleanup

16 years agoMDL-17458 prevent trailing whitespace problems in config.php
skodak [Sat, 28 Mar 2009 15:15:22 +0000 (15:15 +0000)]
MDL-17458 prevent trailing whitespace problems in config.php

16 years agoMDL-14589 removed obsoleted comments
skodak [Sat, 28 Mar 2009 15:07:24 +0000 (15:07 +0000)]
MDL-14589 removed obsoleted comments

16 years agoUpdated the HEAD build version to 20090328
moodlerobot [Fri, 27 Mar 2009 23:33:47 +0000 (23:33 +0000)]
Updated the HEAD build version to 20090328

16 years agoweb service MDL-12886 remove some old comments
jerome [Fri, 27 Mar 2009 04:38:47 +0000 (04:38 +0000)]
web service MDL-12886 remove some old comments

16 years agomod/resource: MDL-18691 allow custom resource types to specify their name in their...
fmarier [Fri, 27 Mar 2009 03:21:10 +0000 (03:21 +0000)]
mod/resource: MDL-18691 allow custom resource types to specify their name in their own lang directory

Before this change, the full name of the resource type had to be stored in the "resource" namespace (for example in /mod/resource/lang/en_utf8/resource.php).

Now it can be put in the "resource_foo" namespace:

e.g. in /mod/resource/type/foo/lang/en_utf8/resource_foo.php:

<?php
  $string['resourcetypefoo'] = 'Link to a Foo Bar document';
?>

16 years agoSCORM MDL-18626 - fix SCORM navigation breadcrumbs
danmarsden [Fri, 27 Mar 2009 01:46:39 +0000 (01:46 +0000)]
SCORM MDL-18626 - fix SCORM navigation breadcrumbs

16 years agoUpdated the HEAD build version to 20090327
moodlerobot [Thu, 26 Mar 2009 23:34:39 +0000 (23:34 +0000)]
Updated the HEAD build version to 20090327

16 years agoMDL-18552 TeX filter - add string ; merged from 19_STABLE
stronk7 [Thu, 26 Mar 2009 21:34:59 +0000 (21:34 +0000)]
MDL-18552 TeX filter - add string ; merged from 19_STABLE

16 years agoChoice MDL-18600 fix sort to be sorted by surname,firstname - thanks to Mihai Sucan...
danmarsden [Thu, 26 Mar 2009 21:23:25 +0000 (21:23 +0000)]
Choice MDL-18600 fix sort to be sorted by surname,firstname - thanks to Mihai Sucan for the fix

16 years agoMDL-18417 fixed DML conversion
skodak [Thu, 26 Mar 2009 21:15:12 +0000 (21:15 +0000)]
MDL-18417 fixed DML conversion

16 years agoMDL-18472 fixed missing argument in deprecated function, thanks Gordon Bateson
skodak [Thu, 26 Mar 2009 20:53:03 +0000 (20:53 +0000)]
MDL-18472 fixed missing argument in deprecated function, thanks Gordon Bateson

16 years agoAICC MDL-18702 Completion Logic incorrect - thanks to Martin Holden for the fix!
danmarsden [Thu, 26 Mar 2009 20:22:43 +0000 (20:22 +0000)]
AICC  MDL-18702 Completion Logic incorrect - thanks to Martin Holden for the fix!

16 years agoMDL-18676 auth plugins should run before enrol because it may create new users -...
skodak [Thu, 26 Mar 2009 19:56:11 +0000 (19:56 +0000)]
MDL-18676 auth plugins should run before enrol because it may create new users - proposed by Jason Hardin

16 years agoMDL-18686 removing ancient readme file
skodak [Thu, 26 Mar 2009 19:46:15 +0000 (19:46 +0000)]
MDL-18686 removing ancient readme file

16 years agoMDL-18552 TeX filter - blacklist unsecure commands + protect texdebug ; merged from...
stronk7 [Thu, 26 Mar 2009 19:17:25 +0000 (19:17 +0000)]
MDL-18552 TeX filter - blacklist unsecure commands + protect texdebug ; merged from 19_STABLE

16 years ago"MDL-17966, fixed installation blocker, merged from 1.9"
dongsheng [Thu, 26 Mar 2009 13:32:28 +0000 (13:32 +0000)]
"MDL-17966, fixed installation blocker, merged from 1.9"

16 years agocourse overview report: MDL-18286 - verson number bump wasn't merged properly
poltawski [Thu, 26 Mar 2009 10:57:18 +0000 (10:57 +0000)]
course overview report: MDL-18286 - verson number bump wasn't merged properly

Grrrrrrrrrrrrrrrrr Petr! ;-)

16 years ago"ADMINLIB/MDL-17966, overwrite write_setting to update settings instead execute sql...
dongsheng [Thu, 26 Mar 2009 08:56:08 +0000 (08:56 +0000)]
"ADMINLIB/MDL-17966, overwrite write_setting to update settings instead execute sql execute in get_settings, this will not hurt performance, merged from 1.9"

16 years agoquestions: unit tests for default_questiontype::compare_responses.
tjhunt [Thu, 26 Mar 2009 08:42:23 +0000 (08:42 +0000)]
questions: unit tests for default_questiontype::compare_responses.

16 years ago"EDITOR/MDL-16698, replace htmleditor element with editor element in forum, move...
dongsheng [Thu, 26 Mar 2009 02:52:59 +0000 (02:52 +0000)]
"EDITOR/MDL-16698, replace htmleditor element with editor element in forum, move draft files to correct file area"

16 years ago"ADMINLIB/MDL-17966, update after writing settings, fix dml calls"
dongsheng [Thu, 26 Mar 2009 02:39:35 +0000 (02:39 +0000)]
"ADMINLIB/MDL-17966, update  after writing settings, fix dml calls"

16 years ago"ADMINLIB/MDL-17966, update after writing settings, merged from 1.9"
dongsheng [Thu, 26 Mar 2009 02:34:42 +0000 (02:34 +0000)]
"ADMINLIB/MDL-17966, update  after writing settings, merged from 1.9"

16 years ago"ADMINLIB/MDL-17966, update after writing settings, merged from 1.9"
dongsheng [Thu, 26 Mar 2009 02:25:46 +0000 (02:25 +0000)]
"ADMINLIB/MDL-17966, update  after writing settings, merged from 1.9"

16 years ago"MEMORY/MDL-18540,remove hard-coded php memory limit, added system setting for it...
dongsheng [Thu, 26 Mar 2009 02:09:28 +0000 (02:09 +0000)]
"MEMORY/MDL-18540,remove hard-coded php memory limit, added system setting for it, create a function reduce_memory_limit to reduce memroy limit and respect php.ini setting in the meanwhile, merged from 1.9"

16 years agoweb service MDL-12886 fix syntax error for description generation
jerome [Thu, 26 Mar 2009 01:54:56 +0000 (01:54 +0000)]
web service MDL-12886 fix syntax error for description generation

16 years agorandom essay questions: MDL-8648 fix merge problem.
tjhunt [Thu, 26 Mar 2009 01:54:40 +0000 (01:54 +0000)]
random essay questions: MDL-8648 fix merge problem.

16 years agoquiz manual grading: MDL-17586 'Grade all 4 ungraded attempts' acutally does the...
tjhunt [Thu, 26 Mar 2009 01:50:22 +0000 (01:50 +0000)]
quiz manual grading: MDL-17586 'Grade all 4 ungraded attempts' acutally does the opposite'

16 years agoUpdated the HEAD build version to 20090326
moodlerobot [Wed, 25 Mar 2009 23:33:40 +0000 (23:33 +0000)]
Updated the HEAD build version to 20090326

16 years agoMDL-18672 and MDL-18679 fixed. DIRECTORY_SEPARATOR / PATH_SEPARATOR mismatch
diml [Wed, 25 Mar 2009 21:28:43 +0000 (21:28 +0000)]
MDL-18672 and MDL-18679 fixed. DIRECTORY_SEPARATOR / PATH_SEPARATOR mismatch

16 years agoFix 'progile' typo MDL-18312
poltawski [Wed, 25 Mar 2009 09:46:12 +0000 (09:46 +0000)]
Fix 'progile' typo MDL-18312

merged from MOODLE_19_STABLE

16 years agoFix 'drow-down' typo MDL-18320
poltawski [Wed, 25 Mar 2009 09:43:19 +0000 (09:43 +0000)]
Fix 'drow-down' typo MDL-18320

merged from MOODLE_19_STABLE

16 years agolib/moodlelib.php MDL-18406 - use more robust require path
poltawski [Wed, 25 Mar 2009 09:38:41 +0000 (09:38 +0000)]
lib/moodlelib.php MDL-18406 - use more robust require path

thanks to Daniel Neis
merged from MOODLE_19_STABLE

16 years agodocumentation/workshop MDL-2605 - bad helpfile link
poltawski [Wed, 25 Mar 2009 09:33:06 +0000 (09:33 +0000)]
documentation/workshop MDL-2605 - bad helpfile link
merged from MOODLE_19_STABLE

16 years agolib/email_to_user MDL-10384 Recipeint names broken
poltawski [Wed, 25 Mar 2009 09:18:19 +0000 (09:18 +0000)]
lib/email_to_user MDL-10384 Recipeint names broken

When emailcharset is not utf8 the charset conversion was breaking
recipient/replyto names

thanks to Tatsuya Shirai
merged from MOODLE_19_STABLE

16 years agoswitch roles: MDL-18132 New Role allow switches page finished.
tjhunt [Wed, 25 Mar 2009 04:20:57 +0000 (04:20 +0000)]
switch roles: MDL-18132 New Role allow switches page finished.

I also set up a reasonable set of default allows, including setting up some sensible allow_overrides, whatever the rant in MDL-15841 says.

16 years agoswitch roles: MDL-18132 Convert allow override page to use the shared code.
tjhunt [Wed, 25 Mar 2009 02:17:14 +0000 (02:17 +0000)]
switch roles: MDL-18132 Convert allow override page to use the shared code.

16 years agoswitch roles: MDL-18132 Refactor role allow assign page
tjhunt [Wed, 25 Mar 2009 01:50:55 +0000 (01:50 +0000)]
switch roles: MDL-18132 Refactor role allow assign page

This is ready to eliminate the duplication between this and role allow override, and the soon-to-be-written role allow switch page.

16 years ago"DATA/MDL-18136, change to moodle coding style and fix incorrect parameter of data_ge...
dongsheng [Wed, 25 Mar 2009 01:49:52 +0000 (01:49 +0000)]
"DATA/MDL-18136, change to moodle coding style and fix incorrect parameter of data_get_field_from_id"

16 years agoUpdated the HEAD build version to 20090325
moodlerobot [Tue, 24 Mar 2009 23:32:49 +0000 (23:32 +0000)]
Updated the HEAD build version to 20090325

16 years agoAutomatic installer.php lang files by installer_builder (20090325)
moodlerobot [Tue, 24 Mar 2009 23:22:43 +0000 (23:22 +0000)]
Automatic installer.php lang files by installer_builder (20090325)

16 years agoFix drift from CVS in git
Dan Marsden [Tue, 24 Mar 2009 11:12:33 +0000 (11:12 +0000)]
Fix drift from CVS in git

16 years agoMDL-18542:
thepurpleblob [Tue, 24 Mar 2009 11:12:33 +0000 (11:12 +0000)]
MDL-18542:
Just noticed a couple of oddnesses in the diff.....

16 years agoMDL-17966 reverting previous commit, solution proposed in tracker
skodak [Tue, 24 Mar 2009 11:01:45 +0000 (11:01 +0000)]
MDL-17966 reverting previous commit, solution proposed in tracker

16 years agoMDL-18542:
thepurpleblob [Tue, 24 Mar 2009 10:52:50 +0000 (10:52 +0000)]
MDL-18542:
Reverting various checkins related to this bug.
PLUS... proper 1 line fix included (merged from STABLE19)

16 years agoTest client using Flex 3 compiler to produce a Flash 9 client for moodle web services.
jamiesensei [Tue, 24 Mar 2009 08:19:00 +0000 (08:19 +0000)]
Test client using Flex 3 compiler to produce a Flash 9 client for moodle web services.

16 years agoquiz: MDL-18637 fix 1.9-style DB code merged to HEAD by mistake.
tjhunt [Tue, 24 Mar 2009 04:15:49 +0000 (04:15 +0000)]
quiz: MDL-18637 fix 1.9-style DB code merged to HEAD by mistake.

16 years agoUpdated the HEAD build version to 20090324
moodlerobot [Mon, 23 Mar 2009 23:33:32 +0000 (23:33 +0000)]
Updated the HEAD build version to 20090324

16 years agoAddresses MDL-18638 (Search code does not follow coding guidelines) and MDL-18474...
diml [Mon, 23 Mar 2009 21:35:30 +0000 (21:35 +0000)]
Addresses MDL-18638 (Search code does not follow coding guidelines) and MDL-18474 (global search should use of PATH_SEPARATOR)

16 years agoAddresses the tracker MDL - 18638 and MDL 18474
diml [Mon, 23 Mar 2009 21:09:01 +0000 (21:09 +0000)]
Addresses the tracker MDL - 18638 and MDL 18474

16 years agoAddresses the tracker MDL - 18638 and MDL 18474
diml [Mon, 23 Mar 2009 21:07:02 +0000 (21:07 +0000)]
Addresses the tracker MDL - 18638 and MDL 18474

16 years agoAddresses the tracker MDL - 18638 and MDL 18474
diml [Mon, 23 Mar 2009 21:00:30 +0000 (21:00 +0000)]
Addresses the tracker MDL - 18638 and MDL 18474

16 years agoAddresses the tracker MDL - 18638 and MDL 18474
diml [Mon, 23 Mar 2009 20:54:53 +0000 (20:54 +0000)]
Addresses the tracker MDL - 18638 and MDL 18474

16 years agoAddresses the tracker MDL - 18638
diml [Mon, 23 Mar 2009 20:43:38 +0000 (20:43 +0000)]
Addresses the tracker MDL - 18638

16 years agoMDL-18644 Add a note about the bug found and upstream bug link
mudrd8mz [Mon, 23 Mar 2009 10:53:10 +0000 (10:53 +0000)]
MDL-18644 Add a note about the bug found and upstream bug link

16 years agoMDL-18644 Bugs found by syntax checker, merged from MOODLE_19_STABLE
mudrd8mz [Mon, 23 Mar 2009 10:25:52 +0000 (10:25 +0000)]
MDL-18644 Bugs found by syntax checker, merged from MOODLE_19_STABLE

16 years agoMDL-18644 Bugs found by syntax checker, merged from MOODLE_19_STABLE
mudrd8mz [Mon, 23 Mar 2009 09:53:02 +0000 (09:53 +0000)]
MDL-18644 Bugs found by syntax checker, merged from MOODLE_19_STABLE

16 years agoMDL-18402 Merged from MOODLE_19_STABLE
nicolasconnault [Mon, 23 Mar 2009 08:35:06 +0000 (08:35 +0000)]
MDL-18402 Merged from MOODLE_19_STABLE

16 years agoswitch roles: MDL-18132 separate database table role_allow_switch instead of re-using...
tjhunt [Mon, 23 Mar 2009 08:15:21 +0000 (08:15 +0000)]
switch roles: MDL-18132 separate database table role_allow_switch instead of re-using role_allow_assign.

This is part 1 that does the back-end:

1. New table role_allow_switch.
2. Upgrade that copies all the allows from role_allow_assign, and then drops the old CFG->allowuserswitchrolestheycantassign.
3. Old function get_assignable_roles_for_switchrole renamed to get_switchable_roles and changed to use the new table. Fixes MDL-18604 in HEAD.
4. Switch callers to use the new function name.
5. Unit tests for this new function.
6. To make those unit tests work, new switch_global_user_id and revert_global_user_id methods in UnitTestCaseUsingDatabase for toggling $USER->id.

I still need to do the editing interface under Administration ► Users ► Permissions ► Define roles. That will be done as a second commit.

16 years ago"REPOSITORY/MDL-18520, fix undefined warning"
dongsheng [Mon, 23 Mar 2009 07:53:32 +0000 (07:53 +0000)]
"REPOSITORY/MDL-18520, fix undefined warning"

16 years agoMDL-18637 fix Moodle 1.9-style {$CFG->prefix}tablename in HEAD, and a few missing...
tjhunt [Mon, 23 Mar 2009 05:19:53 +0000 (05:19 +0000)]
MDL-18637 fix Moodle 1.9-style {$CFG->prefix}tablename in HEAD, and a few missing $DB->s.

I did not fix all the DB problems in search, there are too many there for me to be prepared to clean up other people's mess.

(For once, it was not me making this mistake ;-))

16 years agoMake accesslib unit tests work once again using the new UnitTestCaseUsingDatabase
tjhunt [Mon, 23 Mar 2009 04:18:44 +0000 (04:18 +0000)]
Make accesslib unit tests work once again using the new UnitTestCaseUsingDatabase

16 years agounit tests: MDL-18607 new way to do unit tests involving the database.
tjhunt [Mon, 23 Mar 2009 04:12:37 +0000 (04:12 +0000)]
unit tests: MDL-18607 new way to do unit tests involving the database.

This is not as ambitious as the abortive FakeDBUnitTests scheme, but this one works for simple cases.

There is a new test case class UnitTestCaseUsingDatabase to inherit from. I hope it is sufficiently well documented in its PHPdocs.
* It users $CFG->unittestprefix.
* You can access that database using $this->testdb.
* That database is empty by default, you have to call create_test_table to create the ones you want, and drop_test_table to clean them up in the end. The table definitions are read from the XMLDB file.
* When you are ready to call real Moodle code that users $DB, call switch_to_test_db and then revert_to_real_db when you are done.
* If you forget to call drop_test_table or switch_to_test_db, the class will attempt to clean up after you, but will also print rude developer debug messages telling you not to be stupid.
* There is also a load_test_data method for populating a table from an array.

The is an example of its use in lib/simpletest/testunittestusingdb.php.

16 years agoddl: New method install_one_table_from_xmldb_file ready for MDL-18607 unit test changes.
tjhunt [Mon, 23 Mar 2009 04:04:37 +0000 (04:04 +0000)]
ddl: New method install_one_table_from_xmldb_file ready for MDL-18607 unit test changes.

Plus small refactoring to avoid duplicating code.

16 years agoaccesslib: MDL-18620 - followup - remove the one case of external code using one...
tjhunt [Mon, 23 Mar 2009 04:02:28 +0000 (04:02 +0000)]
accesslib: MDL-18620 - followup - remove the one case of external code using one of the accesslib private globals.

16 years agoFix typo.
tjhunt [Mon, 23 Mar 2009 03:57:45 +0000 (03:57 +0000)]
Fix typo.

16 years agoaccesslib: MDL-18620 do not used static to cache things, it makes unit testing imposs...
tjhunt [Mon, 23 Mar 2009 03:54:50 +0000 (03:54 +0000)]
accesslib: MDL-18620 do not used static to cache things, it makes unit testing impossible.

Instead we have a new $ACCESSLIB_PRIVATE for all caching. Regrettably, the only way to make this work in PHP (other than rewriting everything to be methods of a class rather than functions) is to make this a global variable. However $ACCESSLIB_PRIVATE should not be thought of a global, it is a private implementation detail of accesslib.php. (And there is a comment saying that.)

There is a new function accesslib_clear_all_caches_for_unit_testing(). In a unit test, you need to call this at the start of your test method, before you set up any test data, and again at the end, after you have discarded all your test data.

This new $ACCESSLIB_PRIVATE subsumes the old $ACCESS, $RDEFS and $DITRYCONTEXTS globals.

Also, I took the opportunity to refactor the (inconsistently) duplicated code for adding a context to the caches code into a cache_context function.

16 years agoweblib: Fix test_format_text_email and unit tests.
tjhunt [Mon, 23 Mar 2009 03:41:34 +0000 (03:41 +0000)]
weblib: Fix test_format_text_email and unit tests.

16 years agoquiz: MDL-18635 log every single hit to mod/quiz/attempts.php
tjhunt [Mon, 23 Mar 2009 01:59:30 +0000 (01:59 +0000)]
quiz: MDL-18635 log every single hit to mod/quiz/attempts.php

I don't know why the quiz only logged every 10 minutes. No other part of Moodle worked like that. However, it has always been like that and I did not have a good reason to change it until now.

What was a problem becuase it made it harder to catch people doing a primitive DOS attack against the server by hitting Reload repeatedly.

16 years agoUpdated the HEAD build version to 20090323
moodlerobot [Sun, 22 Mar 2009 23:40:34 +0000 (23:40 +0000)]
Updated the HEAD build version to 20090323