Compare commits

...

1018 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7) 560c1c8ea3 Moodle release 2.4.7 2013-11-10 01:58:40 +01:00
Damyon Wiese 7922f118db weekly release 2.4.6+ 2013-11-08 12:51:03 +08:00
Damyon Wiese f8872ff3e8 Merge branch 'install_24_STABLE' of git://git.moodle.org/moodle-install into MOODLE_24_STABLE 2013-11-08 12:50:59 +08:00
AMOS bot d4edd6c99f Automatically generated installer lang files 2013-11-08 00:43:09 +00:00
Damyon Wiese 301e79acae Merge branch 'MDL-42668-24' of git://github.com/FMCorz/moodle into MOODLE_24_STABLE 2013-11-07 16:11:30 +08:00
Frederic Massart baad460c91 MDL-42668 portfolio_boxnet: Disable the portfolio when non-HTTPS 2013-11-07 14:40:22 +08:00
Frederic Massart c3cf690cee MDL-42668 portfolio_boxnet: Disable the portfolio during upgrade 2013-11-07 14:40:22 +08:00
Frederic Massart 6cc4b72fb9 MDL-42668 portfolio_boxnet: Notify the admins about the upgrade process
Conflicts:

	portfolio/boxnet/version.php
2013-11-07 14:40:19 +08:00
Frederic Massart d311f9cc75 MDL-42668 portfolio_boxnet: Migration to APIv2
Conflicts:

	lib/boxlib.php
	portfolio/boxnet/lib.php
2013-11-07 14:39:44 +08:00
Marina Glancy bc6f61fe9f Merge branch 'MDL-42697-24' of git://github.com/andrewnicols/moodle into MOODLE_24_STABLE 2013-11-07 16:31:39 +11:00
Dan Poltawski b1455d0d74 Merge branch 'MDL-42666-24' of git://github.com/FMCorz/moodle into MOODLE_24_STABLE 2013-11-07 11:44:53 +08:00
Frederic Massart 01a2722f32 MDL-42666 repository_boxnet: New lang strings rather than replace 2013-11-07 11:13:22 +08:00
Damyon Wiese 711f77e4ca Merge branch 'MDL-42605-24' of git://github.com/FMCorz/moodle into MOODLE_24_STABLE 2013-11-07 11:05:32 +08:00
Frederic Massart 615e2caf67 MDL-42666 repository_boxnet: Improved output during migration 2013-11-07 11:01:01 +08:00
Dan Poltawski cad44b4778 Merge branch 'MDL-42728-en_fix_24' of git://github.com/mudrd8mz/moodle into MOODLE_24_STABLE 2013-11-07 09:37:14 +08:00
Frederic Massart c3cefce21c MDL-42666 repository_boxnet: Avoid re-download of sync'd references 2013-11-06 15:03:07 +08:00
Frederic Massart 393133707a MDL-42666 repository_boxnet: Downloading a file follows locations 2013-11-06 14:05:00 +08:00
Frederic Massart 0fb12db343 MDL-42666 repository_boxnet: Fix undefined variable usage 2013-11-06 14:05:00 +08:00
Frederic Massart b1e4d7afc8 MDL-42666 repository_boxnet: Using the right reference 2013-11-06 14:04:59 +08:00
Frederic Massart eca84ae277 MDL-42666 repository_boxnet: Convert all the references asap
This has been done in case the script fails during the processing
and needs to be re-run. Now all the references are converted as soon
as we can, where as before they could have ended up being re-downloaded.
2013-11-06 14:04:59 +08:00
Frederic Massart c578a134fa MDL-42666 repository_boxnet: Warn on HTTPS requirement when non HTTPS 2013-11-06 14:04:59 +08:00
Frederic Massart 53661a6767 MDL-42666 repository_boxnet: Alert the admins of the migration process
Conflicts:

	repository/boxnet/version.php

Conflicts:

	repository/boxnet/version.php
2013-11-06 14:04:55 +08:00
Frederic Massart 3d115053d2 MDL-42666 repository_boxnet: Revoke access token when logging out 2013-11-06 14:03:43 +08:00
Frederic Massart 27db0b4376 MDL-42666 oauthlib: Getter methods for accesstoken, client id and secret 2013-11-06 14:03:43 +08:00
Frederic Massart 45c79022ac MDL-42666 repository_boxnet: Remove hardcoded date for APIv1 end of life 2013-11-06 14:03:42 +08:00
Frederic Massart e15c728434 MDL-42666 repository_boxnet: Disabling file references 2013-11-06 14:03:42 +08:00
Frederic Massart 2c1fc0e086 MDL-42666 repository_boxnet: Advise the user to run the migration tool 2013-11-06 14:03:41 +08:00
Frederic Massart 35662296e5 MDL-42666 repository_boxnet: Tool to launch the migration 2013-11-06 14:03:41 +08:00
Frederic Massart f5c99c5144 MDL-42666 repository_boxnet: Function to convert APIv1 references to true copies 2013-11-06 14:03:41 +08:00
Frederic Massart 82efa6c9f2 MDL-42666 repository_boxnet: Convert repository to APIv2
The support for downloading images when they are references
from Box.net have been dropped in this script as the new
API does not support references. Unfortunately the old
references thumbnails will not be updated any more.

Conflicts:

	lib/upgrade.txt
	repository/boxnet/lib.php

Conflicts:

	lib/upgrade.txt
	repository/boxnet/lib.php
2013-11-06 14:03:24 +08:00
Petr Škoda e02256507c MDL-38743 add private cache headers 2013-11-06 13:58:15 +08:00
Marina Glancy 794f42d81d Merge branch 'MDL-42640-24' of https://github.com/colin-umn/moodle into MOODLE_24_STABLE 2013-11-06 16:32:39 +11:00
Andrew Nicols add479a88e MDL-42697 Theme: Fix overflow on docked blocks 2013-11-06 12:02:41 +08:00
Damyon Wiese 429d0d711b MDL-39800 tags: Fix tags/upgrade.txt version number in backport 2013-11-06 10:45:22 +08:00
Jenny Gray 47b2416012 MDL-39800 tags: moved cloud sorting to print function 2013-11-06 10:43:27 +08:00
Jenny Gray a01bd41865 MDL-39800 tags: Applied weight and ordering fix on all more page options
Also:
Fixed weight and ordering on more page show=all
Fixed weight and ordering on more page show=my
rationalised tag_print_cloud lines now identical
2013-11-06 10:43:27 +08:00
Jenny Gray 555ad195a0 MDL-39800 tags: resolved weighting in block content 2013-11-06 10:43:27 +08:00
Mary Evans 1ba20f5594 MDL-40244 forms: added setType() for groupinfo in forum and wiki 2013-11-06 12:25:46 +11:00
Helen Foster d0890a7791 MDL-42728 Merge English strings from the en_fix language pack 2013-11-05 23:54:37 +01:00
Damyon Wiese b7a1f71911 Merge branch 'wip-MDL-38228-m24' of git://github.com/marinaglancy/moodle into MOODLE_24_STABLE 2013-11-05 21:49:12 +08:00
Dan Poltawski 7fd34aa0e6 Merge branch 'MDL-42613_m24' of https://github.com/markn86/moodle into MOODLE_24_STABLE 2013-11-05 16:46:36 +08:00
Marina Glancy a78bb0cc83 Merge branch 'MDL-40267-24' of git://github.com/danpoltawski/moodle into MOODLE_24_STABLE 2013-11-05 17:45:38 +11:00
Aaron Barnes 2acdf0af6b MDL-42476 report_progress: don't browser sniff for SVG support
Use feature detection, its more robust and better practice.
2013-11-05 11:24:38 +08:00
Marina Glancy ba5ecbc72a MDL-38228 upgrade: Rewrite script that fixes corrupt course modules to sequence relation 2013-11-05 14:15:17 +11:00
Colin Campbell 4bb2eaa7d0 MDL-42640 quiz: Fix restore of backup without overduehandling setting
Use default quiz overduehandling setting when restoring a
backup from older Moodle version that does not have a quiz
overduehandling setting.
2013-11-04 20:56:32 -06:00
Ray Morris 55e3c2cd82 MDL-42265 make Browse Users list scrollable for smaller screens 2013-11-05 10:51:27 +08:00
Dan Poltawski d320d0b285 MDL-40267 forms: fix utf8 string length rules 2013-11-05 10:19:22 +08:00
Eloy Lafuente (stronk7) 9424bcb66e MDL-40267 forms: added some tests for the range rule 2013-11-05 10:10:51 +08:00
Dan Poltawski 08a8eb917e Merge branch 'wip-MDL-42270_M24_2' of git://github.com/gjb2048/moodle into MOODLE_24_STABLE 2013-11-04 22:54:20 +08:00
Dan Poltawski df78a7902b Merge branch 'MDL-42548_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-11-04 22:35:09 +08:00
Dan Poltawski 43fa28331e Merge branch 'MDL-42453_M24' of git://github.com/lazydaisy/moodle into MOODLE_24_STABLE 2013-11-04 22:17:22 +08:00
Dan Poltawski c512b7cc65 MDL-42533 conditionlib: Add clarifying comments 2013-11-04 22:04:30 +08:00
Dan Poltawski 8a7078b28b Merge branch 'MDL-42533-24' of git://github.com/FMCorz/moodle into MOODLE_24_STABLE 2013-11-04 21:55:40 +08:00
Dan Poltawski dcb6e4169b Merge branch '42350-24' of git://github.com/samhemelryk/moodle into MOODLE_24_STABLE 2013-11-04 17:21:32 +08:00
Dan Poltawski 8cd148efe0 Merge branch 'MDL-42551_24' of git://github.com/stronk7/moodle into MOODLE_24_STABLE 2013-11-04 16:22:50 +08:00
Marina Glancy e2fb6ffa24 Merge branch 'MDL-42604-24' of git://github.com/ankitagarwal/moodle into MOODLE_24_STABLE 2013-11-04 19:17:08 +11:00
Sam Hemelryk 71a5c487ce MDL-42350 mod_assign: fixed display of submission button 2013-11-04 15:59:24 +08:00
Dan Poltawski 23ea3287ea Merge branch 'MDL-42111_m24' of git://github.com/rwijaya/moodle into MOODLE_24_STABLE 2013-11-04 15:31:37 +08:00
Damyon Wiese a3e6f40dbe Merge branch 'MDL-34654-m24' of git://github.com/sammarshallou/moodle into MOODLE_24_STABLE 2013-11-04 15:23:11 +08:00
Dan Poltawski 42cc95c245 Merge branch 'MDL-42494-workshop-exception_24' of git://github.com/mudrd8mz/moodle into MOODLE_24_STABLE 2013-11-04 14:52:24 +08:00
Marina Glancy 9ea075bb32 Merge branch 'MDL-42429_m24' of https://github.com/markn86/moodle into MOODLE_24_STABLE 2013-11-04 17:28:34 +11:00
Marina Glancy 08839bbcb8 Merge branch 'MDL-42566_m24' of https://github.com/markn86/moodle into MOODLE_24_STABLE 2013-11-04 17:23:31 +11:00
Marina Glancy abfdce235b Merge branch 'MDL-42465_m24' of https://github.com/markn86/moodle into MOODLE_24_STABLE 2013-11-04 16:58:26 +11:00
Frederic Massart 70427c648e MDL-41807 repository_filesystem: Prevent access to parent directories 2013-11-04 13:30:58 +08:00
Damyon Wiese 5287178537 Merge branch 'MDL-42489-24' of git://github.com/ankitagarwal/moodle into MOODLE_24_STABLE 2013-11-04 13:16:23 +08:00
Marina Glancy abaaa8cdae Merge branch 'MDL-42617_24' of git://github.com/jleyva/moodle into MOODLE_24_STABLE 2013-11-04 16:15:13 +11:00
Marina Glancy 9312fbe16e Merge branch 'MDL-38664_m24' of git://github.com/rwijaya/moodle into MOODLE_24_STABLE 2013-11-04 15:19:00 +11:00
Dan Poltawski d120a7baf2 Merge branch 'MDL-40515_24' of git://github.com/aolley/moodle into MOODLE_24_STABLE 2013-11-04 12:10:58 +08:00
Damyon Wiese fb494ae9c8 Merge branch 'MDL-35146_m24' of https://github.com/markn86/moodle into MOODLE_24_STABLE 2013-11-04 12:05:22 +08:00
Petr Škoda 09f2963373 MDL-41941 clean message text 2013-11-04 11:38:14 +08:00
Tim Hunt 6917b452bf MDL-41820 XSS in the quiz responses report.
Thanks to Michael Hess for finding this bug and reporting it to us.
2013-11-04 11:10:30 +08:00
Damyon Wiese 919efdf632 Merge branch 'MDL-42663_24' of git://github.com/dmonllao/moodle into MOODLE_24_STABLE 2013-11-04 10:50:09 +08:00
Marina Glancy b3e58b7d0b Merge branch 'MDL-42664-performance_measuring_filter_manager_24' of git://github.com/mudrd8mz/moodle into MOODLE_24_STABLE 2013-11-04 13:18:39 +11:00
Damyon Wiese 4844fc124c Merge branch 'MDL-38850_m24' of git://github.com/rwijaya/moodle into MOODLE_24_STABLE 2013-11-04 09:41:10 +08:00
Damyon Wiese d98f1751e8 Merge branch 'wip-MDL-28463-m24' of git://github.com/marinaglancy/moodle into MOODLE_24_STABLE 2013-11-01 22:53:01 +08:00
David Monllao 9ab44b3f99 MDL-42663 mod_lesson: Move definitions to show_clock()
Seems that the required data is not always set
before timer.js is included.
2013-11-01 16:39:36 +08:00
Mark Nelson 6c32a2f003 MDL-42429 mod_lesson: removed unnecessary conditional check 2013-11-01 16:32:25 +08:00
David Mudrák f23a63b545 MDL-42664 Fix the filter_manager instantiation
For legacy reasons, the $CFG->perfdebug uses values 7 for disabled and 15 for
enabled. Because of this typo, Moodle has always created instance of the slower
performance_measuring_filter_manager instead of the standard filter_manager,
regardless the perfdebug setting.
2013-11-01 09:24:10 +01:00
Dan Poltawski 6758c0fa99 weekly release 2.4.6+ 2013-11-01 15:47:45 +08:00
Dan Poltawski eef875e0c1 Merge branch 'install_24_STABLE' of git://git.moodle.org/moodle-install into MOODLE_24_STABLE 2013-11-01 15:47:42 +08:00
Sam Hemelryk 150735fbdb MDL-42619 block_community: delete course redirect bug fix 2013-11-01 10:16:02 +08:00
Marina Glancy accfa102fe Merge branch 'MDL-41624_24' of git://github.com/jmvedrine/moodle into MOODLE_24_STABLE 2013-10-31 22:20:20 +11:00
Juan Leyva e5663dfd70 MDL-42617 Add support for frozen fields in searchableselector form elements 2013-10-31 11:49:14 +01:00
Marina Glancy 91d309074f Merge branch 'MDL-40971_M24' of git://github.com/lazydaisy/moodle into MOODLE_24_STABLE 2013-10-31 21:17:28 +11:00
Mark Nelson 9a3f511056 MDL-42566 mod_data: introduced check to ensure the picture supplied is valid 2013-10-31 17:10:46 +08:00
Michael Aherne de4d45ce8e MDL-42517 testing Changed events test to use assertDebuggingCalled() 2013-10-31 13:25:36 +08:00
Frederic Massart 2d22a9d474 MDL-42605 portfolio_flickr: Do not auto select a set to export to 2013-10-31 10:32:23 +08:00
Frederic Massart c64eea0a51 MDL-42605 portfolio_flickr: Photos can be added to a set on export 2013-10-31 10:32:22 +08:00
Jean-Michel Vedrine 0e099cc444 MDL-41624 DragMath crashes Firefox 2013-10-30 18:25:02 +01:00
Mark Nelson fda6ef7a1f MDL-42613 core_group: removed unnecessary table row when there is no group description or picture 2013-10-30 17:59:36 +08:00
Damyon Wiese 7b8dba0b52 Merge branch 'MDL-38734-24' of git://github.com/danpoltawski/moodle into MOODLE_24_STABLE 2013-10-30 17:21:30 +08:00
Sam Hemelryk c3673c5531 Merge branch 'MDL-42574-24' of git://github.com/ankitagarwal/moodle into MOODLE_24_STABLE 2013-10-30 13:44:39 +08:00
Ankit Agarwal 1efa930202 MDL-42604 scorm: Fix division by zero warnings in error logs 2013-10-30 11:01:04 +08:00
Damyon Wiese 87c3a9fd9f Merge branch 'wip-MDL-41337-m24' of git://github.com/marinaglancy/moodle into MOODLE_24_STABLE 2013-10-30 10:54:13 +08:00
Sam Hemelryk 1f26c7053a Merge branch 'MDL-42542-24' of git://github.com/FMCorz/moodle into MOODLE_24_STABLE 2013-10-30 08:38:47 +08:00
Mary Evans fff86d45c1 MDL-40971 grade: Fixes missing setType() and $PAGE->layout for Outcomes/import which results in errors in 2.5 Clean theme 2013-10-30 00:15:59 +00:00
Marina Glancy 54a0a16b53 MDL-41337 files: Fixed bug with accidental delete of the root directory 2013-10-29 20:30:26 +11:00
John Beedell 8cb63784e5 MDL-41473 book: Book html zip import, incorrect url produced for internal linking to other chapters 2013-10-29 14:27:38 +08:00
Damyon Wiese 9ac938636f Merge branch 'MDL-40470-24' of git://github.com/andrewnicols/moodle into MOODLE_24_STABLE 2013-10-29 13:55:28 +08:00
Andrew Nicols 3bdbe1b08b MDL-40470 JavaScript: Correct issue when checking select change in Firefox 2013-10-29 10:43:06 +08:00
Marina Glancy eaccd0d486 MDL-28463 conditionlib: 10 minutes lifetime of cached grades 2013-10-29 13:21:12 +11:00
Dan Poltawski 0bc9604212 Merge branch 'MDL-22669-24' of git://github.com/FMCorz/moodle into MOODLE_24_STABLE 2013-10-28 16:31:38 +08:00
Ankit Agarwal 17a0f7350f MDL-42574 blocks: Fix strict standards warning in community block 2013-10-28 15:43:09 +08:00
Mark Nielsen 0ed5fa3b88 MDL-38419: External tool - when force SSL checked, URLs get corrupted 2013-10-28 12:35:19 +08:00
Mark Nelson 34b3aa4d49 MDL-35146 mod_wiki: fixed variable typo and altered code to conform to Moodle guidelines 2013-10-28 12:34:37 +08:00
Anton Fletcher 5f22097114 MDL-35146 mod_wiki: fixed issue where pages for deleted groups caused an error on restore 2013-10-28 12:34:37 +08:00
Damyon Wiese 43fed596e5 Merge branch 'wip-mdl-30812-m24' of git://github.com/rajeshtaneja/moodle into MOODLE_24_STABLE 2013-10-28 12:10:09 +08:00
Dan Poltawski acb1bf6fac Merge branch 'wip-mdl-42491-m24' of git://github.com/deraadt/moodle into MOODLE_24_STABLE 2013-10-28 11:33:36 +08:00
Prateek Sachan 6a748d5e8b MDL-38850: Fixed Horizontal bar issue in lesson 2013-10-28 11:09:42 +08:00
Damyon Wiese d0a9524463 Merge branch 'MDL-36818-24' of git://github.com/danpoltawski/moodle into MOODLE_24_STABLE 2013-10-28 10:59:16 +08:00
AMOS bot 42e7fb5e49 Automatically generated installer lang files 2013-10-28 00:46:46 +00:00
Eloy Lafuente (stronk7) 5c550aaafc MDL-42551 timezone info: updated to 2013h 2013-10-26 17:15:21 +02:00
Tim Hunt ea6e1851e9 MDL-42548 quiz review: don't show grade for non-finished attempts.
Now we show the attempt state separately, so there is no need to show
Grade: Attempt still in progress - especially since we were showing that
for abandoned and overdue attempts which is just wrong.
2013-10-25 20:11:26 +01:00
Gareth J Barnard bd0d739550 MDL-42270 course: Section name too big message. 2013-10-25 16:40:31 +01:00
Eloy Lafuente (stronk7) 75d8d06ffb weekly release 2.4.6+ 2013-10-25 13:03:31 +02:00
Eloy Lafuente (stronk7) 8c92e24434 Merge branch 'install_24_STABLE' of git://git.moodle.org/moodle-install into MOODLE_24_STABLE 2013-10-25 13:03:27 +02:00
Frederic Massart cbd0157d66 MDL-42542 portfolio: Fix handlerfile in portfolio event handler 2013-10-25 16:02:21 +08:00
Frederic Massart c9bcb47d54 MDL-42533 conditionlib: Field name is translated for students 2013-10-25 09:52:02 +08:00
Michael de Raadt c58f3ed7ff MDL-42491 libraries: add exception for IE11 (and hopefully later versions) 2013-10-25 09:00:19 +08:00
Eloy Lafuente (stronk7) 3b34d79d36 Merge branch 'MDL-42377_m24' of https://github.com/markn86/moodle into MOODLE_24_STABLE 2013-10-25 01:13:08 +02:00
Dan Poltawski 8f19a957e2 Merge branch 'MDL-42338_m24' of git://github.com/rwijaya/moodle into MOODLE_24_STABLE 2013-10-24 16:29:19 +08:00
Marina Glancy 94cc2c769c Merge branch 'MDL-35402_editor_rules_24' of git://github.com/davosmith/moodle into MOODLE_24_STABLE 2013-10-24 15:31:12 +11:00
rwijaya 4f718dc60c MDL-42338 lti_mod: convert hardcoded string. 2013-10-24 10:34:20 +08:00
sam marshall d1b0786a51 MDL-34654 Glossary: ampersand breaks auto-linking 2013-10-23 16:22:25 +01:00
David Mudrák 1cdd43b12b MDL-42494 Fix workshop coding exception if all assessments have zero weight
If all assessments for the given submission have zero weight, the grading
evaluation plugin "Comparison with the best assessment" is unable to decide on
the average assessment as it ignores those with zero weight. In such rare case,
it makes sense to set the grading grade to null and prevent the coding
exception.
2013-10-23 11:51:37 +02:00
Damyon Wiese b807cc6334 Merge branch 'MDL-42210_24' of git://github.com/grabs/moodle into MOODLE_24_STABLE 2013-10-23 14:19:42 +08:00
Ankit Agarwal 8cbfc9614a MDL-42489 backup: use correct exception class in automated backups 2013-10-23 13:56:08 +08:00
Damyon Wiese 9de894db2d Merge branch 'w43_MDL-42208_m24_authunmask' of https://github.com/skodak/moodle into MOODLE_24_STABLE 2013-10-23 13:42:26 +08:00
Dan Poltawski 7a2db63954 Merge branch 'MDL-40531_24' of https://github.com/stronk7/moodle into MOODLE_24_STABLE 2013-10-23 12:36:38 +08:00
Ankit Agarwal 8a3894de89 MDL-42427 backup: Fix undefined errors during automated backups 2013-10-23 12:10:14 +08:00
Damyon Wiese 60ca7d5b07 MDL-41339 Tags - use uppercase for SQL keywords (AS) 2013-10-23 11:58:48 +08:00
Damyon Wiese 697ecc6db1 Merge branch '24STABLE-wip-mdl-41339' of https://github.com/jennymgray/moodle into MOODLE_24_STABLE 2013-10-23 11:55:33 +08:00
Marina Glancy e2536570a3 Merge branch 'w43_MDL-37813_m24_filterall' of https://github.com/skodak/moodle into MOODLE_24_STABLE 2013-10-23 10:18:47 +11:00
Dan Poltawski af90211efd Merge branch 'MDL-42112-24' of git://github.com/damyon/moodle into MOODLE_24_STABLE 2013-10-22 16:45:17 +08:00
Mark Nelson 78855a6c7b MDL-42465 mod_chat: instantiated message object before declaring properties 2013-10-22 16:12:20 +08:00
Dan Poltawski 1640389bcf Merge branch 'MDL-29441-24' of git://github.com/andrewnicols/moodle into MOODLE_24_STABLE 2013-10-22 13:21:27 +08:00
Marina Glancy a70c9434d7 Merge branch 'MDL-26170_rss_24' of https://github.com/andyjdavis/moodle into MOODLE_24_STABLE 2013-10-22 15:04:25 +11:00
Andrew Davis 441b8d6e69 MDL-26170 RSS: fixed RSS cache clearing when items are deleted 2013-10-22 10:59:03 +07:00
Rajesh Taneja de61d99ad1 MDL-31405 Assignment: removed type in time shift reset status
Assignment reset shifts time for all assignments and not specific to
assignment type, hence removed type string from reset status
2013-10-22 11:54:23 +08:00
Marina Glancy f311ba2714 Merge branch 'MDL-24380-24' of git://github.com/mouneyrac/moodle into MOODLE_24_STABLE 2013-10-22 14:35:09 +11:00
Marina Glancy 06032cd928 Merge branch 'MDL-42239-m24' of git://github.com/ankitagarwal/moodle into MOODLE_24_STABLE 2013-10-22 14:09:05 +11:00
Ankit Agarwal d05a5b126c MDL-42239 calendar: Fix missing ids issue with mouseover panels 2013-10-22 10:46:02 +08:00
Jerome Mouneyrac 45e4351ade MDL-24380 Chat: autoscroll help popup incorrect and doesn't display fully (it only concerns the alternative chat methods) 2013-10-22 10:45:27 +08:00
Dan Poltawski 2811b3d262 Merge branch 'MDL-42201_m24' of https://github.com/markn86/moodle into MOODLE_24_STABLE 2013-10-22 10:30:43 +08:00
Rajesh Taneja 0cb2846998 MDL-34612 Restore: Gracefully handle empty file contenthash while restoring 2013-10-22 09:49:01 +08:00
Rajesh Taneja 4db1863687 MDL-34612 Restore: Gracefully handle empty section title while restoring 2013-10-22 09:49:01 +08:00
AMOS bot 4a256d6e8e Automatically generated installer lang files 2013-10-22 00:45:44 +00:00
Mary Evans 44666a2d31 MDL-42453 theme_base: Fixed Error in base/style/admin.css that breaks CSS validator. 2013-10-21 15:39:28 +01:00
Dan Poltawski a122d95343 Merge branch 'MDL-34209-24' of git://github.com/andrewnicols/moodle into MOODLE_24_STABLE 2013-10-21 13:58:40 +08:00
rwijaya af11bd26b6 MDL-38664 Lesson mod: code improvement for lesson re-attempt page 2013-10-21 13:54:28 +08:00
Joseph Rézeau b8aa36a063 MDL-38664 Lesson mod: fixed re-attempt unseen page 2013-10-21 13:54:16 +08:00
Jody Steele a10d621fc5 MDL-38628 mod_assign: Allow a user to specify "No Grade" when grading an assignment submission 2013-10-21 16:51:33 +11:00
Marina Glancy a322a0ab53 Merge branch 'w43_MDL-42386_m24_etag' of https://github.com/skodak/moodle into MOODLE_24_STABLE 2013-10-21 16:00:53 +11:00
Mark Nelson 969d8f0e3f MDL-42377 backup: fixed incorrect debugging message 2013-10-21 11:55:30 +08:00
Mark Nelson 36cfbfe841 MDL-42201 backup: introduced new automatic backup state 2013-10-21 11:49:07 +08:00
Andrew Nicols 314cc22a28 MDL-34209 JavaScript: Simplify section drag/drop to fix reordering issues 2013-10-21 11:42:43 +08:00
Dan Poltawski bd1fae5fc0 Merge branch 'MDL-26244_url_24' of https://github.com/andyjdavis/moodle into MOODLE_24_STABLE 2013-10-21 11:25:27 +08:00
rwijaya ac23be5d24 MDL-42111 TinyMCE media preview: fix video preview display for TinyMCE media.
Effected themes: boxxie, clean, brick, formal_white and splash.
2013-10-21 11:12:45 +08:00
Dan Poltawski 6e72e0a6aa MDL-31405 assign: avoid uncessary get_string call 2013-10-21 11:02:45 +08:00
Dan Poltawski 57bafe6ebc Merge branch 'wip-mdl-31405-m24' of git://github.com/rajeshtaneja/moodle into MOODLE_24_STABLE 2013-10-21 10:59:00 +08:00
Andreas Grabs 4ae00d74bc MDL-42210 mod_feedback - convert tabs to space 2013-10-20 10:04:10 +02:00
Michael Milette 60293b276a MDL-42210-Feedback-Input-Labels
Adds labels to the input fields in the Feedback module including: multichoice, multichoicerated, numeric, textarea and textfield.
2013-10-20 10:04:08 +02:00
Charles Severance 4673a6a8fc MDL-40531 mod_lti: Various 1.1/1.1.1 fixes.
Conflicts:
	mod/lti/service.php
2013-10-19 03:04:59 +02:00
Sam Chaffee ce5a85c354 MDL-40531 mod_lti: Changed namespace in XML to IMS LTI compliant 2013-10-19 03:04:47 +02:00
AMOS bot ff952aa064 Automatically generated installer lang files 2013-10-19 00:47:36 +00:00
Petr Škoda 675fa4b813 MDL-37813 remove missing filters when configuring string filters and fix filter uninstall 2013-10-18 15:59:22 +02:00
Petr Škoda 73b0524202 MDL-42208 prevent autocompletion in auth configs 2013-10-18 15:09:17 +02:00
Petr Škoda 58c57f94d6 MDL-42386 fix invalid etag comparison
Credit goes to Eloy Lafuente, thanks!
2013-10-18 14:49:49 +02:00
Dan Poltawski b6ced2f7e4 weekly release 2.4.6+ 2013-10-18 16:16:43 +08:00
Dan Poltawski 6123c76bc7 Merge branch 'install_24_STABLE' of git://git.moodle.org/moodle-install into MOODLE_24_STABLE 2013-10-18 16:16:34 +08:00
Tony Levi 8beb495df4 MDL-38734: Automated backup failure causing all course to fail 2013-10-18 15:05:00 +08:00
Damyon Wiese 90b46f39a4 Merge branch 'MDL-41554-24' of git://github.com/danpoltawski/moodle into MOODLE_24_STABLE 2013-10-18 13:27:19 +08:00
Dan Poltawski 1f3a85aa54 MDL-41554 rss: Move to more robust test url
tinyurl was sometimes failing (was bad to use them anyway)
2013-10-18 12:47:44 +08:00
Dan Poltawski 98e4f24ff6 Merge branch 'MDL-42421_m24' of https://github.com/markn86/moodle into MOODLE_24_STABLE 2013-10-18 12:15:43 +08:00
Damyon Wiese 48763c4d21 MDL-42112 tablelib: Generate the correct number of cols for empty rows
(And a test for it).
2013-10-18 11:56:06 +08:00
Damyon Wiese d91225aae4 MDL-42112 Tablelib: Add unit tests (some) 2013-10-18 11:56:03 +08:00
Mark Nelson a5436ae8ce MDL-42421 auth: removed incorrect statement in upgrade.txt 2013-10-18 11:38:56 +08:00
Jenny Gray 7a9000b1ff MDL-41339 Tags: Added unique tag instance id to tag_get_tags functions
Avoids php warnings on creating new tags
2013-10-17 14:03:30 +01:00
Damyon Wiese 85d47590cc Merge branch 'MDL-42065_24' of https://github.com/sam-moodle/moodle into MOODLE_24_STABLE 2013-10-16 15:48:19 +08:00
Damyon Wiese 8789750cc5 Merge branch 'MDL-37528-24' of git://github.com/andrewnicols/moodle into MOODLE_24_STABLE 2013-10-16 11:16:45 +08:00
Andrew Davis b15478526a MDL-26244 mod_date:added some logic show or hide the file picker button based on repository availability 2013-10-16 08:33:39 +07:00
Eloy Lafuente (stronk7) 8786deb033 MDL-37877 backup: fix incorrect backported code. 2013-10-16 00:32:00 +02:00
Davo Smith 59e8879130 MDL-35402 forms - prevent crash when multiple rules defined on an editor element 2013-10-15 14:34:40 +01:00
Damyon Wiese e81aa9e8e6 Merge branch 'MDL-37877-m24' of git://github.com/ankitagarwal/moodle into MOODLE_24_STABLE 2013-10-15 16:58:39 +08:00
Dan Poltawski 8a2e491ee7 Merge branch 'MDL-42209_m24' of https://github.com/markn86/moodle into MOODLE_24_STABLE 2013-10-15 14:43:21 +08:00
Ankit Agarwal 3a6857090e MDL-37877 backup: Fix issues with zipping of large files
Files bigger than 4GB is not supported at this point. Zip archiver doesn't know about it and always returns true. We need to verify if it is a valid file or not and delete if not
Also delete the backup file immediately if anything goes wrong anywhere in backup. We don't want to use up space
2013-10-15 13:18:46 +08:00
Marina Glancy d2ff78d173 Merge branch 'wip-MDL-42234-24' of git://github.com/abgreeve/moodle into MOODLE_24_STABLE 2013-10-15 14:11:58 +11:00
Tim Hunt ef37c13e29 MDL-42309 typo: fix reponse -> response throughout Moodle. 2013-10-15 13:50:05 +11:00
Adrian Greeve a8d816982a MDL-42234 - Repositories: Fix undefined variable notice when no repositories are enabled. 2013-10-15 10:47:22 +08:00
Dan Poltawski ac7f6f4b96 Merge branch 'w42_MDL-42082_m24_authdbpass' of https://github.com/skodak/moodle into MOODLE_24_STABLE 2013-10-14 14:36:29 +08:00
FilipBenco 6da08c0e2c MDL-42209 backup: fixed wrong icon being displayed when restoring course 2013-10-14 14:33:19 +08:00
Damyon Wiese f72e3fbbf2 MDL-34586 assignment - fix whitespace 2013-10-14 14:29:22 +08:00
Damyon Wiese 8afe4de645 Merge branch 'MDL-34586-24' of https://github.com/mackensen/moodle into MOODLE_24_STABLE 2013-10-14 14:29:14 +08:00
Dan Poltawski 1fc88334a6 Merge branch 'MDL-42232_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-10-14 14:24:17 +08:00
Damyon Wiese 7643bd4ca9 Merge branch 'MDL-34612-24' of https://github.com/mackensen/moodle into MOODLE_24_STABLE 2013-10-14 14:12:23 +08:00
Damyon Wiese 1b9f0beaf3 Merge branch 'MDL-41170-m24' of git://github.com/ankitagarwal/moodle into MOODLE_24_STABLE 2013-10-14 14:04:18 +08:00
Ankit Agarwal 993612b00e MDL-41170 events: Update upgrade.txt to reflect changes made in MDL-41170 2013-10-14 13:24:05 +08:00
Akinsaya Delamarre 4eb084f1a2 MDL-41170: Added user updated event triggers to password updating functions. 2013-10-14 13:22:15 +08:00
Dan Poltawski 34b3d144fe Merge branch 'MDL-41672-text-mail-links_24' of git://github.com/mudrd8mz/moodle into MOODLE_24_STABLE 2013-10-14 12:12:17 +08:00
Thijs Kinkhorst c61decc816 MDL-36818 cas: improve SSL validation 2013-10-14 10:12:53 +08:00
Eloy Lafuente (stronk7) 5864eb6017 Merge branch 'wip-mdl-41843-m24' of git://github.com/rajeshtaneja/moodle into MOODLE_24_STABLE 2013-10-14 00:15:29 +02:00
Eloy Lafuente (stronk7) d9131593c7 Merge branch 'MDL-37181_m24' of https://github.com/markn86/moodle into MOODLE_24_STABLE 2013-10-13 23:32:55 +02:00
Andrew Nicols 16e566b99f MDL-29441 Chat: Use a valid name for chat popup actions 2013-10-13 20:08:04 +08:00
Petr Škoda bd010f8854 MDL-42110 do not show auth_db password in plaintext 2013-10-12 13:49:54 +02:00
AMOS bot a364f61121 Automatically generated installer lang files 2013-10-12 00:43:51 +00:00
Tim Hunt cf2fb7579b MDL-42232 Multiple choice question choice alignment issue
The problem was with the alignment of:
* tables inside the choices.
* Lists inside the choices.
* The specific feedback, when it spanned mulitple lines.

The problem was introduced by MDL-39420.
2013-10-11 14:26:34 +01:00
Eloy Lafuente (stronk7) 945aa97617 weekly release 2.4.6+ 2013-10-11 13:20:55 +02:00
Rajesh Taneja ca4349c1ce MDL-31405 Assignment: Fixed date in reset to be called once
Conflicts:

	mod/assign/locallib.php
2013-10-11 08:59:02 +08:00
Jayesh Anandani 267b45e0a1 MDL-31405 Assignment reset issue solved 2013-10-11 08:58:29 +08:00
Andrew Nicols 4c53ec3355 MDL-37528 Libraries: Fix gesture + mouse issues with YUI
This addresses issues with devices which support both mouse and gesture
input devices whereby the presence of gesture support on the device causes
mouse interactions to be ignored.

This has the potential to cause issues with multiple events being triggered
for the same action, but we do not have this issue in core, and few
third-party plugins support drag and drop in such a way that this may be an
issue.

This is fixed in the latest version of YUI in a similar way, and the
addition of a new system to only trigger the event from the first action to
be triggered.
2013-10-10 17:14:02 +08:00
Marina Glancy 7bd19d562d Merge branch 'MDL-37153_24' of https://github.com/pauln/moodle into MOODLE_24_STABLE 2013-10-10 12:53:27 +11:00
Sam Hemelryk 49e3cda704 Merge branch 'wip-mdl-41744-m24' of https://github.com/rajeshtaneja/moodle into MOODLE_24_STABLE 2013-10-10 14:39:24 +13:00
Sam Chaffee e8ec840f3c MDL-42065 core_grade: Modified some grade_item queries for improved performance
* Modified 2 queries in grade_item::depends_on to improve performance
* Added additional unit tests to cover those queries better
2013-10-09 12:34:29 -06:00
Alain Corbière 0c018318c6 MDL-41672 Fix html2text processing of multiple occurrences of the same URL 2013-10-09 15:49:21 +02:00
David Mudrák 3bd02768df MDL-41672 Add html2text unit test for multiple occurrences of the same URL 2013-10-09 15:49:12 +02:00
Dan Poltawski 39adfbde72 Merge branch 'w41_MDL-42054_m24_phpmailertesting_i' of https://github.com/skodak/moodle into MOODLE_24_STABLE 2013-10-09 18:20:13 +08:00
Petr Škoda a42e313460 MDL-42054 fix incorrect email redirection in unit tests 2013-10-09 11:57:04 +02:00
Dan Poltawski d6b99cf123 Merge branch 'MDL-39776-24' of git://github.com/phalacee/moodle into MOODLE_24_STABLE 2013-10-09 16:54:30 +08:00
Dan Poltawski 77eb24f886 Merge branch 'm24_MDL-40226_Add_JNLP_MIME_Type_Support' of https://github.com/scara/moodle into MOODLE_24_STABLE 2013-10-09 16:48:44 +08:00
Damyon Wiese d4609de200 Merge branch 'w41_MDL-42047_m24_cohortdel' of https://github.com/skodak/moodle into MOODLE_24_STABLE 2013-10-09 14:44:25 +08:00
Mark Nelson 6c2d9137b3 MDL-37181 backup: stopped setting the status of unscheduled backups to skipped 2013-10-09 14:16:03 +08:00
Damyon Wiese 5dc182dd6e Merge branch 'wip-MDL-41967-24' of git://github.com/abgreeve/moodle into MOODLE_24_STABLE 2013-10-09 13:12:41 +08:00
Jason Fowler 88e2d12038 MDL-39776 Javascript - enable formautosubmit from a select box on android 2013-10-09 11:39:11 +08:00
Charles Fulton b6a84b6fdd MDL-34612 forum: convert default format value during restore 2013-10-08 20:05:35 -07:00
Paul Nicholls 3e2821e6f5 MDL-37153 - assign: Obey grade display settings in submission status
The assignment submission status screen was ignoring the grade item's
display setting, showing scores even if it's set to display letters only.
2013-10-09 16:03:50 +13:00
Tim Lock d93610d4b0 MDL-41908 QuickForm: Fix PEAR Non-static method error 2013-10-09 10:27:30 +08:00
James Henestofel 34d55059cb MDL-42068 Filepicker course listing use setting courselistshortname to show shortname and fullname 2013-10-09 01:27:33 +02:00
Eloy Lafuente (stronk7) 6257097a3f Merge branch 'MDL-42069_24' of https://github.com/appalachianstate/moodle into MOODLE_24_STABLE 2013-10-08 21:27:27 +02:00
Charles Fulton cd35f43eac MDL-34586 assignment: convert default format value during restore 2013-10-08 09:48:56 -07:00
Rajesh Taneja 788105dd3d MDL-41843 IMS-LTI: Fixed exception namespace 2013-10-08 15:56:52 +08:00
Dongsheng Cai 80cee53996 MDL-41843 Uses OAuthException in moodle\mod\lti namespace 2013-10-08 15:56:52 +08:00
Damyon Wiese dd94734d9a Merge branch 'MDL-41520-MOODLE_24_STABLE-mod_lti-completion-view' of github.com:Trii/moodle into MOODLE_24_STABLE 2013-10-08 14:34:49 +08:00
Damyon Wiese 786538f74f Merge branch 'MDL-32570-24' of git://github.com/danpoltawski/moodle into MOODLE_24_STABLE 2013-10-08 13:46:42 +08:00
Dan Poltawski 925ec67b22 Merge branch 'MDL-38655_24' of git://github.com/aolley/moodle into MOODLE_24_STABLE 2013-10-08 13:21:44 +08:00
Marina Glancy b159b57207 Merge branch 'MDL-25176_m24' of https://github.com/merrill-oakland/moodle into MOODLE_24_STABLE 2013-10-08 12:04:12 +11:00
Petr Škoda c01c608fdc MDL-41197 normalize ascii text conversion 2013-10-08 00:04:46 +02:00
Frederic Massart ca887bc9bc MDL-22669 course: Display section number for orphaned activities 2013-10-07 16:52:29 +08:00
Sam Hemelryk 2ff9ac5608 MDL-41197 fix unit tests 2013-10-07 14:16:25 +13:00
Matteo Scaramuccia f63fc5c41a MDL-40226 Files: Added the correct MIME Type for JNLP files.
JNLP stands for Java Network Launch Protocol, used to launch
Java Web Start applications. More details in:
http://docs.oracle.com/javase/tutorial/deployment/webstart/deploying.html
2013-10-06 16:45:16 +02:00
Joshua Johnston d276541169 MDL-41520 LTI: Does not track page views for completion 2013-10-04 09:47:14 -04:00
Fred Woolard 72b266d54e MDL-42069 mod_quiz add lastname sort for manual grading 2013-10-04 09:09:00 -04:00
Petr Škoda 8f3702ee1a MDL-42047 fix cohort method name error after deleting cohort 2013-10-04 11:33:23 +02:00
Petr Škoda 54b951fb5f MDL-41197 ignore all problems when converting texts 2013-10-04 11:13:00 +02:00
Sam Hemelryk 9844660858 weekly release 2.4.6+ 2013-10-04 15:43:43 +13:00
Sam Hemelryk d0012b72ad Merge branch 'install_24_STABLE' of git://git.moodle.org/moodle-install into MOODLE_24_STABLE 2013-10-04 15:43:38 +13:00
Rajesh Taneja 623b678c3e MDL-41744 Users: Convert key to value in bulk upload
Menu profile field expects value, during bulk upload if value is passed by form
then options key is passed. So converting key to value if passed though form
2013-10-03 10:18:55 +08:00
Sam Hemelryk 75f6d03855 Revert "MDL-33569 themes: Labels create extra margin below content."
This reverts commit 05c3b5dd2f.
2013-10-03 14:43:51 +13:00
Eric Merrill 236a2fca9b MDL-25176 forum Redirects for new discussions shouldn't use SESSION
Unset the session->fromdiscussion var, because we know that the correct
path will be computed later.
2013-10-01 21:19:17 -04:00
Tim Lock a7c5e2d24d MDL-41996: Don't show the Review Attempt link if no attempts exist. 2013-10-01 20:05:12 +02:00
Eloy Lafuente (stronk7) 4ae75c1847 Merge branch 'w40_MDL-41999_m24_userpw' of https://github.com/skodak/moodle into MOODLE_24_STABLE 2013-10-01 15:59:24 +02:00
Marina Glancy d7788d69f6 Merge branch 'MDL-32592-24' of git://github.com/danpoltawski/moodle into MOODLE_24_STABLE 2013-10-01 20:49:41 +10:00
Marina Glancy a033a6b4c1 Merge branch 'MDL-39653-24' of git://github.com/danpoltawski/moodle into MOODLE_24_STABLE 2013-10-01 20:44:07 +10:00
Adrian Greeve 0626a71686 MDL-41967 - Gradebook: Fixed an sql syntax error for gradebook custom profile fields. 2013-10-01 18:00:41 +08:00
Dan Poltawski 756fbd91fd MDL-32570 enrol_imsenterprise: don't hardcode default category id 2013-10-01 11:52:46 +08:00
Sam Hemelryk 3b5c7727f2 MDL-41828 mod: fixed navbar when adding modules to a course 2013-10-01 13:34:01 +10:00
Sam Hemelryk e5b13b7fc0 MDL-41900 events: avoid new debug call within unit tests 2013-10-01 16:21:19 +13:00
Sam Hemelryk 49c29a3f46 Merge branch 'MDL-41995_m24' of https://github.com/markn86/moodle into MOODLE_24_STABLE 2013-10-01 14:49:55 +13:00
Sam Hemelryk 92fdea041d Merge branch 'MDL-41900-m24' of git://github.com/micaherne/moodle into MOODLE_24_STABLE 2013-10-01 14:35:27 +13:00
Sam Hemelryk a7fd949571 Merge branch 'MDL-41894-m24' of git://github.com/ankitagarwal/moodle into MOODLE_24_STABLE 2013-10-01 13:44:44 +13:00
AMOS bot 32d77062b4 Automatically generated installer lang files 2013-10-01 00:41:49 +00:00
Sam Hemelryk 92416730d1 Merge branch 'MDL-37973_m24' of https://github.com/merrill-oakland/moodle into MOODLE_24_STABLE 2013-10-01 09:53:19 +13:00
Eloy Lafuente (stronk7) 4b95721a26 Merge branch 'MDL-26408-24' of git://github.com/danpoltawski/moodle into MOODLE_24_STABLE 2013-09-30 16:01:55 +02:00
Marina Glancy 29d526b495 Merge branch 'MDL-41954-workshop-zero-variance_24' of git://github.com/mudrd8mz/moodle into MOODLE_24_STABLE 2013-09-30 16:11:44 +10:00
Adam Olley 227d3fcbd3 MDL-40515: report_log: List activities in optgroups 2013-09-30 11:20:44 +09:30
Mary Evans 05c3b5dd2f MDL-33569 themes: Labels create extra margin below content.
Conflicts:

	theme/bootstrapbase/less/moodle/course.less
2013-09-28 16:15:12 +01:00
Petr Škoda cf55843d07 MDL-41999 do not use $USER->password directly 2013-09-27 10:55:12 +02:00
Marina Glancy c7c613b45b weekly release 2.4.6+ 2013-09-27 14:50:19 +10:00
Marina Glancy 06450ed398 Merge branch 'install_24_STABLE' of git://git.moodle.org/moodle-install into MOODLE_24_STABLE 2013-09-27 14:49:38 +10:00
Dan Poltawski 3d986cf8cd MDL-39653 enrol_imsenterprise: only mail admins on change
The existing beavhiour was sending useless emails to admins and
generating warnings.

Thanks to Matthew Orlando for the suggested fix.
2013-09-27 12:23:37 +08:00
Adam Olley 6e3013be7c MDL-38655: mod_assign: Use correct ordering on cap checks for submission downloads 2013-09-27 12:45:47 +09:30
Mark Nelson 63b66cf276 MDL-41995 calendar: moved the location the page layout was set for the export page
This was done so that the blocks are shown when logged in and viewing this page.
2013-09-26 17:04:30 +08:00
Dan Poltawski aaf95d0161 MDL-32592 enrol_imsenterprise: fix error when category not defined
thanks to Henrik Thorn for the fix
2013-09-26 14:59:08 +08:00
Dan Poltawski 473aab4ffb MDL-26408 enrol_imsenterprise: fix invalid component 2013-09-26 12:21:42 +08:00
Petr Škoda 2504a9d2ec MDL-41223 do not store any form of login URL in $SESSION->wantsurl
Credit goes to Michael Milette, thanks.
2013-09-25 10:58:39 +10:00
Matt Petro a24c22cd12 MDL-41660 backup ims-cc: Use correct temp directory 2013-09-25 02:16:05 +02:00
David Mudrák 2ccad8f967 MDL-41954 Fix the grade for assessment calculation in the Workshop module
In a pretty rare case of zero variance of received assessments, the "distance"
of the evaluated assessment from the referential ("best") one was not increased
regardless it's actual value. This led to higher grades for assessments in
certain situations (see the tracker for a particular example).
2013-09-25 02:03:02 +02:00
Eloy Lafuente (stronk7) b152769f44 Merge branch '40903-24' of git://github.com/samhemelryk/moodle into MOODLE_24_STABLE 2013-09-25 02:00:47 +02:00
Sam Hemelryk 77b4970559 Merge branch 'MDL-41907_m24' of https://github.com/merrill-oakland/moodle into MOODLE_24_STABLE 2013-09-25 10:17:55 +12:00
Marina Glancy 8492c192af Merge branch 'MDL-41929_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-09-24 21:33:12 +10:00
Sam Hemelryk f621e8e3d8 MDL-40903 cached: fixed up versions 2013-09-24 21:13:22 +12:00
Sam Hemelryk 5a804c0f54 MDL-40903 cache: renamed persistcache to staticacceleration 2013-09-24 21:13:22 +12:00
Sam Hemelryk bfff058cc8 MDL-40903 cache: fixed up event invalidation 2013-09-24 21:13:22 +12:00
Marina Glancy 9e72a16e14 MDL-40903 cache: Unittests and small fixes for persistent application cache 2013-09-24 21:13:22 +12:00
Sam Hemelryk 90317c258b MDL-40903 cache: coding style tidyup pre-integration 2013-09-24 21:13:22 +12:00
Sam Hemelryk fcb5548c38 MDL-40903 cache: converted persistent into persistentdata
At the same time all cache instances were made persistent
2013-09-24 21:13:21 +12:00
Ankit Agarwal 654f0c0cf7 MDL-41894 feedback: Remove unused code, which is generating warnings 2013-09-24 15:08:33 +08:00
AMOS bot 402469ce8b Automatically generated installer lang files 2013-09-24 00:42:02 +00:00
Sam Hemelryk fb092979bf Merge branch 'MDL-36465-24' of git://github.com/andrewnicols/moodle into MOODLE_24_STABLE 2013-09-24 08:32:46 +12:00
Tim Hunt 768779972e MDL-41929 quiz statistics, overall stats not displayed. 2013-09-23 18:07:25 +01:00
Marina Glancy b0124c9703 Merge branch 'MDL-41833-m24' of git://github.com/ankitagarwal/moodle into MOODLE_24_STABLE 2013-09-23 19:18:05 +10:00
Andrew Nicols d2674929ba MDL-36465 Course JavaScript: Ensure that the zero section is not draggable 2013-09-23 09:19:11 +01:00
Marina Glancy 47ba8d481e Merge branch 'wip-MDL-41772-24' of git://github.com/abgreeve/moodle into MOODLE_24_STABLE 2013-09-23 14:41:22 +10:00
AMOS bot 814054616f Automatically generated installer lang files 2013-09-21 00:42:40 +00:00
Sam Hemelryk 7bc37de925 weekly release 2.4.6+ 2013-09-20 14:42:53 +12:00
Sam Hemelryk 0f00c5c594 Merge branch 'install_24_STABLE' of git://git.moodle.org/moodle-install into MOODLE_24_STABLE 2013-09-20 14:34:56 +12:00
Eric Merrill 4b8ed14f54 MDL-41907 Repositories: Maintain the sortorder of a file when overwriting it. 2013-09-19 18:47:42 -04:00
Eric Merrill 9840da227e MDL-37973 gradebook Return a maxgrade of '-' if grade type is TEXT
Including tests for correct return from
grade_edit_tree_column_range->get_item_cell()

This commit includes some special code just for 2.4 in the test
related to a bug in assign.
2013-09-19 11:28:40 -04:00
Michael Aherne 4948ac2e0c MDL-41900 events Log handler failures 2013-09-19 15:58:06 +01:00
AMOS bot 954b1b5504 Automatically generated installer lang files 2013-09-19 00:44:12 +00:00
AMOS bot 9e81532432 Automatically generated installer lang files 2013-09-18 00:45:34 +00:00
Eloy Lafuente (stronk7) 6726f0073e Merge branch 'MDL-41728-m24' of git://github.com/sammarshallou/moodle into MOODLE_24_STABLE 2013-09-17 21:18:48 +02:00
Ankit Agarwal 5011fb91ff MDL-41833 feedback: Fix setType() warning when deleting a response in feedback 2013-09-17 15:30:07 +08:00
Eloy Lafuente (stronk7) 657beb8924 Merge branch 'MDL-41595_M24' of git://github.com/lazydaisy/moodle into MOODLE_24_STABLE 2013-09-17 02:15:42 +02:00
Sam Hemelryk 1d5c188798 Merge branch 'MDL-38317-moodle24' of git://github.com/StudiUM/moodle into MOODLE_24_STABLE 2013-09-17 08:38:51 +12:00
Sam Hemelryk ac7cbc012e Merge branch 'MDL-38194-m24' of git://github.com/sammarshallou/moodle into MOODLE_24_STABLE 2013-09-16 13:54:52 +12:00
AMOS bot 05f1cccc37 Automatically generated installer lang files 2013-09-16 00:40:28 +00:00
Sam Hemelryk 1081b8ec84 Merge branch 'm24_MDL-37524' of git://github.com/danmarsden/moodle into MOODLE_24_STABLE 2013-09-16 10:38:25 +12:00
Sam Hemelryk af0a06b521 Merge branch 'wip-MDL-27684-MOODLE_24_STABLE' of git://github.com/satrun77/moodle into MOODLE_24_STABLE 2013-09-16 10:26:50 +12:00
Dan Marsden 9963b0b6a6 MDL-37524 SCORM: mode not calculated correctly. 2013-09-16 10:13:47 +12:00
Sam Hemelryk d7b20f1650 Merge branch 'MDL-29987_24' of https://github.com/bostelm/moodle into MOODLE_24_STABLE 2013-09-16 10:12:51 +12:00
Sam Hemelryk 694cb9b053 Merge branch 'MDL-41534-24' of git://github.com/damyon/moodle into MOODLE_24_STABLE 2013-09-16 09:40:00 +12:00
AMOS bot 14dcbdb0f4 Automatically generated installer lang files 2013-09-15 00:39:09 +00:00
AMOS bot 38753adc60 Merge branch 'MOODLE_24_STABLE' into install_24_STABLE 2013-09-14 00:41:38 +00:00
sam marshall da7c844c30 MDL-38194 Files: Allow download of large backup files
The PHP readfile function does not work for files more than 2GB.
This commit provides a wrapper that can be used so that files less
than 2GB are sent with readfile, and files larger than 2GB are
sent manually.

The change applies to all uses of pluginfile.php, although in
reality, backup files are probably the only ones likely to be more
than two gigabytes.
2013-09-13 16:01:58 +01:00
Jean-Philippe Gaudreau 0f6d896e43 MDL-38317 grade import: Translation support for import mappings form. 2013-09-13 08:51:35 -04:00
Henning Bostelmann 0137a13d55 MDL-29987 File resource: fix problem with PDF display on mobile devices
Setting the default display option for PDF files from DISPLAY_EMBED to DISPLAY_OPEN
2013-09-13 10:28:41 +01:00
Adrian Greeve 254bf485f1 MDL-41772 - mod_data: Fixed database_module comments not being restored. 2013-09-13 15:35:32 +08:00
Damyon Wiese e81fce929a weekly release 2.4.6+ 2013-09-13 14:07:27 +08:00
Mohamed Alsharaf c1536ff1ef MDL-27684 repository: make require_login() throws exception instead of redirect 2013-09-13 16:06:51 +12:00
Damyon Wiese 43e1ed2cf3 MDL-37804 assign: Return proper notice when submissions closed.
MDL-38267 was returning the html page when it should have been adding to the list
of notices and returing false.

Conflicts:

	mod/assign/locallib.php
2013-09-12 10:38:45 +08:00
Damyon Wiese 46f15f03d2 MDL-41534 theme: Missed backporting a style to hide empty table rows 2013-09-12 09:27:02 +08:00
sam marshall 0cddce2c56 MDL-41728 Backup: Unnecessary use of in_array in base_plan
Remove unnecessary use of in_array which causes performance problems
when loading the plan for very large courses.
2013-09-11 14:38:37 +01:00
Dan Poltawski 18cbf0db95 Merge branch 'MDL-38267-24' of git://github.com/damyon/moodle into MOODLE_24_STABLE 2013-09-11 12:00:15 +08:00
Sam Hemelryk 3b2c61fdb8 Merge branch 'MDL-41658_M24' of git://github.com/kordan/moodle into MOODLE_24_STABLE 2013-09-11 09:42:14 +12:00
Matthew Noorenberghe d64a0e9173 MDL-41634 - URL Download Repository doesn't warn when asked to download non-image files 2013-09-11 09:37:40 +12:00
Sam Hemelryk c88b113c1f Merge branch 'MDL-41528_MOODLE_24_STABLE' of https://github.com/nitzo/moodle into MOODLE_24_STABLE 2013-09-11 09:26:02 +12:00
Sam Hemelryk aa6699f4db Merge branch 'MDL-41630-24' of git://github.com/FMCorz/moodle into MOODLE_24_STABLE 2013-09-11 09:20:27 +12:00
Rajesh Taneja 1e557db89d MDL-41590 Enrolments: If course is deleted, then use courseid for reference 2013-09-11 08:47:04 +12:00
Dan Poltawski 5e99c1f9a1 Merge branch 'MDL-40631-24' of git://github.com/damyon/moodle into MOODLE_24_STABLE 2013-09-10 14:32:00 +08:00
Dan Poltawski 84197f41ca Merge branch '41189-24' of git://github.com/samhemelryk/moodle into MOODLE_24_STABLE 2013-09-10 14:12:30 +08:00
Damyon Wiese b604cb81e4 Merge branch 'wip-mdl-23335-m24' of https://github.com/deraadt/moodle into MOODLE_24_STABLE 2013-09-10 12:56:53 +08:00
Damyon Wiese 05f853e2db MDL-41497 auth_db: Fix typo in lang string. 2013-09-10 12:24:55 +08:00
Damyon Wiese a77864208e Merge branch 'MDL-41497-24' of https://github.com/willylee/moodle into MOODLE_24_STABLE 2013-09-10 12:23:17 +08:00
Dan Poltawski 4b3521ec69 Merge branch 'MDL-28561_M24' of git://github.com/lazydaisy/moodle into MOODLE_24_STABLE 2013-09-10 12:05:10 +08:00
Damyon Wiese 294673628e Merge branch 'MDL-41451_24' of https://github.com/pauln/moodle into MOODLE_24_STABLE 2013-09-10 11:58:41 +08:00
Damyon Wiese 081e303415 Merge branch 'MDL-41626-moodle24' of github.com:StudiUM/moodle into MOODLE_24_STABLE 2013-09-10 09:30:14 +08:00
Sam Hemelryk b14d0e4713 Merge branch 'MDL-41600_24' of git://github.com/aolley/moodle into MOODLE_24_STABLE 2013-09-10 13:11:21 +12:00
AMOS bot d2dc75fb4e Automatically generated installer lang files 2013-09-10 00:41:04 +00:00
Adam Olley 7c95cf02af MDL-41600: qformat_blackboard_six Fix test_import_match fail w/ddmatch
With qtype_ddmatch installed, the unit tests for qformat_blackboard_six
fail as they generate ddmatch questions instead of match ones. This
patch checks for ddmatch and changes the test to expect that instead if
its installed.
2013-09-10 09:16:29 +09:30
Sam Hemelryk a7f3f08722 MDL-32862 backup: fixed missing global 2013-09-10 10:40:11 +12:00
Sam Hemelryk 5db72d63c5 Merge branch 'wip-MDL-32862-24' of git://github.com/abgreeve/moodle into MOODLE_24_STABLE 2013-09-10 09:38:23 +12:00
Sam Hemelryk d58d0239db Merge branch 'MDL-29378-survey-24' of git://github.com/mudrd8mz/moodle into MOODLE_24_STABLE 2013-09-10 09:35:50 +12:00
Dan Poltawski e9ea8e9b63 Merge branch 'MDL-41254-m24' of git://github.com/micaherne/moodle into MOODLE_24_STABLE 2013-09-09 18:04:48 +08:00
David Mudrák e523503fb8 MDL-29378 Fix the recent string modification
But accident, I have modified the string 'collesaintro' in the previous patch.
The correct string to be amended is 'collesapintro'.
2013-09-09 11:22:14 +02:00
Dan Poltawski 4da2fefa4d Merge branch 'MDL-37804_24' of github.com:recreate/moodle into MOODLE_24_STABLE 2013-09-09 17:13:49 +08:00
Mary Evans 0f85e6ba0b MDL-41595 mod_book: Book mod does not add TOC to default region 2013-09-09 09:52:43 +01:00
Dan Poltawski 8baa0cab98 Merge branch 'MDL-41163-m24' of git://github.com/sammarshallou/moodle into MOODLE_24_STABLE 2013-09-09 15:39:58 +08:00
Damyon Wiese 5a730d0a80 Merge branch 'wip-MDL-41517-m24' of git://github.com/marinaglancy/moodle into MOODLE_24_STABLE 2013-09-09 12:11:10 +08:00
Damyon Wiese 5a36d6292d Merge branch 'm24_MDL-31232' of git://github.com/danmarsden/moodle into MOODLE_24_STABLE 2013-09-09 11:13:27 +08:00
Sam Hemelryk b7a4701d1f MDL-41417 course: fixed idnumbertaken string 2013-09-09 12:15:59 +12:00
Paul Nicholls 6cb665f18c MDL-41451 - formslib: use create_function instead of inline function
As per MDL-39432, closure-style inline functions can result in fatal
errors when using eAccelerator and thus should be avoided.
2013-09-09 11:41:17 +12:00
Sam Hemelryk eae5890112 Merge branch 'MDL-38794_24' of https://github.com/prateeksachan/moodle into MOODLE_24_STABLE 2013-09-09 11:12:11 +12:00
Sam Hemelryk fd9ecb595f Merge branch 'MDL-41417_m24' of https://github.com/markn86/moodle into MOODLE_24_STABLE 2013-09-09 10:50:56 +12:00
Sam Hemelryk 1fdc20cbdb Merge branch 'MDL-29378-survey-24' of git://github.com/mudrd8mz/moodle into MOODLE_24_STABLE 2013-09-09 10:48:49 +12:00
Sam Hemelryk 1830fc428c MDL-41189 fixed overflow issue with filepicker thumbnail 2013-09-09 08:24:40 +12:00
kordan c53069c60a MDL-41658 theme_formal_white: text in input select is now never centered (fixed at central level) 2013-09-08 21:08:09 +02:00
AMOS bot 97a0c05d46 Automatically generated installer lang files 2013-09-08 00:43:12 +00:00
AMOS bot 700e92b8d4 Merge branch 'MOODLE_24_STABLE' into install_24_STABLE 2013-09-08 00:43:12 +00:00
Eloy Lafuente (stronk7) 28980dbee6 Moodle release 2.4.6 2013-09-07 14:25:39 +02:00
Dan Poltawski 39616d39c4 MDL-41623 rss: clean output rss content 2013-09-07 10:42:02 +08:00
Eloy Lafuente (stronk7) 178af4770e MDL-41623 ensure all links are valid urls
For 23 and 24 we are modifying the default Sanitizer. Note that
for 24 and upwards we are doing the same with our extended
Sanitizer. So this is just an interim hack for those old versions.
2013-09-07 04:06:08 +02:00
Mark Nelson eb57e9e60b MDL-41417 course: allow the use of duplicated idnumbers if they existed before fix 2013-09-06 15:24:43 +08:00
Francis Devine 5f8e23c1a9 MDL-41417 course: prevent duplicate idnumbers being used when updating a course 2013-09-06 15:24:19 +08:00
Adrian Greeve 7ed78289b5 MDL-32862 - Backup: Rewriting resource_old links on backup. 2013-09-06 14:49:08 +08:00
Frederic Massart 77458d700b MDL-41630 oauth: Throw exception instead of dying on error 2013-09-06 14:18:29 +08:00
Paul Nicholls 52b617673c MDL-41451 - Large forms are truncated by max_input_vars
By parsing php://input in chunks, we can bypass max_input_vars for
forms which do not use the "multipart/form-data" enctype.  This can
be (and is) safely skipped if there are fewer than max_input_vars
fields submitted as part of $_POST.
2013-09-06 14:57:03 +12:00
AMOS bot efcbed9b73 Merge branch 'MOODLE_24_STABLE' into install_24_STABLE 2013-09-06 00:47:50 +00:00
Nitzan Bar 2dd8a44c20 MDL-41528 enrol/ldap course default settings when no course template is selected 2013-09-06 02:14:20 +03:00
Jean-Philippe Gaudreau 3b8005fae7 MDL-41626 cas auth: Setting the right url for the multi-authentication page 2013-09-05 16:48:14 -04:00
sam marshall 097abcc59c MDL-41163 Restore: Large course restore timeout on schema page 2013-09-05 17:17:42 +01:00
Dan Poltawski fe38aff3a7 Merge branch 'install_24_STABLE' of git://git.moodle.org/moodle-install into MOODLE_24_STABLE 2013-09-05 14:43:39 +08:00
Dan Poltawski e78a2d0e44 weekly release 2.4.5+ 2013-09-05 13:35:45 +08:00
David Mudrák f257805573 MDL-29378 Code cleanup in the Survey module
While working on the issue, I spotted these two places that were worth of
fixing. The first one is a trivial reminiscence of a previous refactoring,
after which both branches of the if() statement became equal.

The second one is actually a typo as in theory it could generate unexpected
input fields with the name like qPP1. Luckily this never happened due to the
way how survey questions are hardcoded (there are no questions with the type 2
that would require two answers to their subquestions).
2013-09-05 00:09:59 +02:00
David Mudrák 2e5d19ddfc MDL-29378 Fix the form display in the Survey/COLLES P+A module
In MDL-7501, we stopped using rowspanning cells in the form table due to
accessibility. That had introduced a regression so in the COLLES P+A survey,
all the rows were displayed with the same background colour. This patch returns
the previous behaviour that each couple of items can be distinguished by the
background colour.

Also, there is no need to display "I prefer that" and "I found that" as a small
text any more. It had made sense in rowspanning layout but not after MDL-7501
was fixed.

And finally, as all items are enumerated now sequentially, there are actually
48 lines, each couple covering one question in two variants. I think it's
correct to reflect this in the description of the form so the text was slightly
amended.
2013-09-05 00:09:59 +02:00
David Mudrák 708a1cec00 MDL-29378 Fix regression in the Survey/COLLES P+A module
This basically reverts the commit 5196df589b that
I believe was a result of misunderstanding of how question type field is
(ab)used in the Survey module. As it took significant time to get familiar with
the overall logic of questions and their processing in the module, I left my
findings in added inline comments. The point is that it is $question->type that
matters. Types of questions listed as subquestions in the multi field is
irrelevant in that case (and all have it set to 1 IIRC).

This patch re-enables the "COLLES (Preferred and Actual)" survey type that did
not work at all due to regression.
2013-09-05 00:09:59 +02:00
Damyon Wiese 3caeaa448e MDL-41259 ldap: Move on to the next course when create_course fails 2013-09-04 16:16:15 +08:00
Damyon Wiese 3e230a757c MDL-41259 enrol_ldap: Fix for backport branch
Use error_log instead of the newer progress trace.
2013-09-04 12:48:42 +08:00
Damyon Wiese c8b1ecedc7 Merge branch 'MDL-41485-m24' of git://github.com/ankitagarwal/moodle into MOODLE_24_STABLE 2013-09-04 12:26:39 +08:00
Damyon Wiese 4520f30def MDL-41179 assign: Ensure a submission record exists for lock/unlock
Can't change the function params because it is changed in master already.
This will create a draft submission when a student is prevented from submitting
but that is a minor sideeffect and doesn't happen in master.
2013-09-04 11:03:36 +08:00
Dan Poltawski d1af85a398 Merge branch 'wip-mdl-41418-m24' of git://github.com/rajeshtaneja/moodle into MOODLE_24_STABLE 2013-09-04 10:38:34 +08:00
Eloy Lafuente (stronk7) 75cf024576 Merge branch 'MDL-41568-en_fix-24' of git://github.com/mudrd8mz/moodle into MOODLE_24_STABLE 2013-09-03 15:11:22 +02:00
Helen Foster b5f9a3b0e3 MDL-41568 Merge English strings from the en_fix language pack 2013-09-03 12:56:04 +02:00
Mary Evans 53165cbc05 MDL-28561 blocks_rss_client: Fixes lines between RSS feed items are not showing in all themes. 2013-09-03 10:23:55 +01:00
Damyon Wiese 13ad8def1b Merge branch 'MDL-41348_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-09-03 16:10:13 +08:00
Tim Lock f246359c29 MDL-41304: Hide and handle LDAP error when user not in context being checked 2013-09-03 16:05:58 +08:00
Aparup Banerjee 3bc786adb1 MDL-37564 linked dependant plugin component text to plugins DB 2013-09-03 14:57:41 +08:00
Damyon Wiese e75bd18064 Merge branch 'MDL-33472-24' of git://github.com/danpoltawski/moodle into MOODLE_24_STABLE 2013-09-03 14:38:52 +08:00
Damyon Wiese 7a35f9f9fc Merge branch 'm24_MDL-29218_plugin_init_not_blocking_when_false' of https://github.com/scara/moodle into MOODLE_24_STABLE 2013-09-03 14:29:37 +08:00
Damyon Wiese 6026b9157d Merge branch 'MDL-32690_restoreMissingAssignment_24' of https://github.com/moodlerooms/moodle into MOODLE_24_STABLE 2013-09-03 14:16:38 +08:00
Michael de Raadt 557b8de4cf MDL-23335 mod_forum: allow multi-lang filtering of shortened messages
MDL-23335 mod_forum: Correct ordering of filtering and shortening
2013-09-03 13:36:04 +08:00
Dan Poltawski da337c3f39 Merge branch 'w36_MDL-41255_m24_changepw' of https://github.com/skodak/moodle into MOODLE_24_STABLE 2013-09-03 12:59:04 +08:00
Dan Poltawski ef103c84bb Merge branch 'MDL-41428-24' of git://github.com/FMCorz/moodle into MOODLE_24_STABLE 2013-09-03 12:31:12 +08:00
Marina Glancy f68ebb8282 MDL-41517 Do not call fix_course_sortorder unnecessarily
Thanks to Thomas Worthington
2013-09-03 13:55:04 +10:00
Dan Poltawski d65c2e5d44 Merge branch 'wip-MDL-41179-m24' of git://github.com/marinaglancy/moodle into MOODLE_24_STABLE 2013-09-03 11:49:07 +08:00
Dan Poltawski 03b992e43b Merge branch 'wip-MDL-41317-m24' of git://github.com/marinaglancy/moodle into MOODLE_24_STABLE 2013-09-03 10:40:41 +08:00
Dan Poltawski e8bc65a85e Merge branch 'MDL-40214_m24' of https://github.com/markn86/moodle into MOODLE_24_STABLE 2013-09-03 10:07:08 +08:00
Matteo Scaramuccia c7aac02925 MDL-29218 Repository: fixed a typo in the PHPDoc 2013-09-02 23:26:51 +02:00
Matteo Scaramuccia 832a19829b MDL-29218 Repository: $pname, get rid of all the useless code
More details in the Tracker.
2013-09-02 23:26:49 +02:00
Matteo Scaramuccia d0ddf08dc0 MDL-29218 Repository: Hide the repo if repository::plugin_init returns false 2013-09-02 23:26:48 +02:00
prateeksachan 30d3f1d220 MDL-38267 assign: No Submit button after cut-off date
Conflicts:

	mod/assign/locallib.php
	mod/assign/tests/locallib_test.php
2013-09-02 22:49:42 +08:00
Damyon Wiese a7f94caa2e MDL-40631: Prevent students from submitting empty assignments.
Conflicts:

	mod/assign/locallib.php
	mod/assign/tests/locallib_test.php
2013-09-02 22:02:50 +08:00
Michael Aherne aadac9873b MDL-41254 backup Raise time and memory limit in precheck. 2013-09-02 14:06:44 +01:00
Dan Poltawski ed016dd8fc Merge branch 'MDL-41149-24' of git://github.com/damyon/moodle into MOODLE_24_STABLE 2013-09-02 17:25:46 +08:00
Dan Poltawski afe1dde0c8 Merge branch 'MDL-35925-24' of git://github.com/phalacee/moodle into MOODLE_24_STABLE 2013-09-02 15:24:33 +08:00
Nitzan Bar 1fdb431dfe MDL-41259 when duplicate course shortname exists an exception is thrown and sync is aborted 2013-09-02 15:09:06 +08:00
Dan Poltawski 5a407be1d4 Merge branch 'MDL-36093-moodle24' of github.com:StudiUM/moodle into MOODLE_24_STABLE 2013-09-02 14:11:05 +08:00
Dan Poltawski 8793ba310d MDL-40676 tests: fix null byte test. 2013-09-02 13:59:26 +08:00
Petr Škoda 74d458916b MDL-40676 ignore null bytes 2013-09-02 12:28:15 +08:00
Dan Poltawski 370f95edf0 Merge branch 'MDL-41175_M24' of git://github.com/lazydaisy/moodle into MOODLE_24_STABLE 2013-09-02 11:53:00 +08:00
Dan Poltawski 79dc70d99c Merge branch 'MDL-41328-24' of git://github.com/damyon/moodle into MOODLE_24_STABLE 2013-09-02 11:45:08 +08:00
Andrew Nicols 4b23a6fa05 MDL-41328 Editor: Work around another iOS issue with TinyMCE
We apply this only on touchend and not touchstart or touchmove. The
location is not guaranteed until the end of the gesture, and there's no
need to keep applying focus on every move.
2013-09-02 09:41:55 +08:00
Petr Škoda 7a3b3ac4d2 MDL-41255 fix incorrect redirection logic when changing password
Credit goes to Michael Milette.
2013-08-31 11:43:27 +02:00
AMOS bot 85ed2ec89b Merge branch 'MOODLE_24_STABLE' into install_24_STABLE 2013-08-31 00:43:57 +00:00
Willy Lee 4a3728ee50 MDL-41497 auth_db: Added help text for using odbc dsn names instead 2013-08-30 10:25:48 -05:00
Willy Lee c959f27415 MDL-41497 enrol_database: Added help text for using odbc dsn names instead 2013-08-30 09:03:41 -05:00
Ankit Agarwal 2bcfd98eab MDL-41485 calendar: Replace value of action buttons on managesubscription page with int 2013-08-30 17:24:34 +08:00
Dan Marsden e727d2aa2a MDL-31232 SCORM: Wrap suspend_data even when no spaces in value. 2013-08-30 20:37:09 +12:00
Damyon Wiese 6cef890fbc weekly release 2.4.5+ 2013-08-30 09:39:54 +08:00
AMOS bot afd76d0c5d Automatically generated installer lang files 2013-08-30 00:41:50 +00:00
Mark Nielsen 0fc55f1d0a MDL-32690: Restore 1.9 backup into 2.X fails on missing assignment type
Solution is as follows:
* Allow unsupported subplugins to convert from Moodle1 to Moodle2
* On Moodle2 restore hide unsupported subplugins
* Graceful error message in assignment of unsupported subplugins
2013-08-29 08:48:39 -07:00
Jean-Philippe Gaudreau 83f27b6cca MDL-36093 grade export: Fix HTML special characters printed litteraly. 2013-08-28 09:16:34 -04:00
Tim Hunt 530e43776b MDL-41348 question code depends on filelib.
I think this used to work because mod/forum/lib.php used to be included
everywhere, and in turn included lib/formslib.php. We should declare the
dependencey explicitly.
2013-08-28 11:18:25 +01:00
Damyon Wiese 8e4c96c519 MDL-41249 assign: Fix incorrect gradingform restore step
The mapping in the previous patch was wrong - mod assign uses
the area "submissions" but the itemid is the grade->id not the submission->id.
2013-08-28 16:33:32 +08:00
Colin Campbell 7e8638914f MDL-40214 mod_assign: Fixed issue with custom scale being lost during restore. 2013-08-28 10:49:29 +08:00
Marina Glancy 36d31f8081 MDL-41317 Set correct context to send bulk message page 2013-08-28 11:07:37 +10:00
Eloy Lafuente (stronk7) d8669d5bef Merge branch 'MDL-41387_m24' of https://github.com/markn86/moodle into MOODLE_24_STABLE 2013-08-27 21:00:52 +02:00
Eloy Lafuente (stronk7) ee3433a44b Merge branch 'm24_MDL-41410_Move_Comment_To_Appropriate_Place' of https://github.com/scara/moodle into MOODLE_24_STABLE 2013-08-27 19:46:32 +02:00
Dan Poltawski 7d64b40db1 Merge branch 'MDL-41366_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-08-27 18:09:54 +08:00
Damyon Wiese 08d19eaeb9 Merge branch 'MDL-41401-24' of git://github.com/danpoltawski/moodle into MOODLE_24_STABLE 2013-08-27 15:08:43 +08:00
Dan Poltawski e3559db951 MDL-38765 quiz: fix incorrect comment 2013-08-27 13:59:24 +08:00
Dan Poltawski 4c37aadb32 Merge branch 'MDL-38765_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-08-27 13:53:09 +08:00
Damyon Wiese e4e6173568 Merge branch 'MDL-40877-24' of git://github.com/FMCorz/moodle into MOODLE_24_STABLE 2013-08-27 12:50:04 +08:00
Damyon Wiese 58605be7f2 Merge branch 'MDL-40447_M24' of https://github.com/nadavkav/moodle into MOODLE_24_STABLE 2013-08-27 12:29:59 +08:00
Nadav Kavalerchik 9684aab5a2 MDL-37211 Backup: Migrate hard-coded strings to language string for the table header labels on the restore page 2013-08-27 11:58:04 +08:00
Dan Poltawski 4acc7c0106 Merge branch 'wip-MDL-41222-m24' of git://github.com/marinaglancy/moodle into MOODLE_24_STABLE
Conflicts:
	lib/modinfolib.php
2013-08-27 11:08:14 +08:00
Frederic Massart 279f7582a4 MDL-41428 repository_coursefiles: Missing white space in name 2013-08-27 10:31:18 +08:00
Marina Glancy f8758dc3d3 MDL-41179 is_user_access_restricted_by_capability() must look at specified user and not current 2013-08-27 09:50:46 +10:00
Dan Poltawski 0f567efc8f Merge branch 'MDL-41291-24' of git://github.com/mr-russ/moodle into MOODLE_24_STABLE 2013-08-26 18:07:11 +08:00
Damyon Wiese 727c220c7a MDL-41213 filepicker: Version bump for css changes 2013-08-26 16:22:08 +08:00
Damyon Wiese 33fec82b0a Merge branch '41213-24' of git://github.com/samhemelryk/moodle into MOODLE_24_STABLE 2013-08-26 16:20:47 +08:00
Rajesh Taneja ba55a0f6c9 MDL-41418 Administration: Page context should be set before setting page title 2013-08-26 15:27:14 +08:00
Dan Poltawski ea6deb7e09 Merge branch 'MDL-35930_m24' of git://github.com/rwijaya/moodle into MOODLE_24_STABLE 2013-08-26 14:56:45 +08:00
Dan Poltawski 433bba6b2f Merge branch 'MDL-36126_m24' of https://github.com/markn86/moodle into MOODLE_24_STABLE 2013-08-26 14:25:42 +08:00
Mark Nelson 0534f2dd9b MDL-36126 backup: ensure the backup_logs message does not exceed the maximum allowed length in the DB 2013-08-26 20:40:46 +08:00
Damyon Wiese 1e27536646 Merge branch 'mdl24_MDL-29004_wiki-fix-images-in-printer-friendly-view' of https://github.com/brki/moodle into MOODLE_24_STABLE 2013-08-26 13:51:21 +08:00
Dan Poltawski cd118a23e7 Merge branch 'MDL-41249-24' of git://github.com/damyon/moodle into MOODLE_24_STABLE 2013-08-26 13:11:19 +08:00
Damyon Wiese 4e66dc96b3 Merge branch 'wip-MDL-41106-m24' of git://github.com/samhemelryk/moodle into MOODLE_24_STABLE 2013-08-26 09:44:17 +08:00
Damyon Wiese 81ff8adcc5 MDL-36803 tinymce: Version bump for js changes 2013-08-26 09:34:15 +08:00
Damyon Wiese 527b36b905 Merge branch 'MDL-36803-m24' of https://github.com/andrewnicols/moodle into MOODLE_24_STABLE 2013-08-26 09:33:41 +08:00
Russell Smith ab2d7d4f3d MDL-41291 cache: Use fread to avoid race conditions 2013-08-26 10:51:23 +10:00
Sam Hemelryk 426e9c79ac MDL-41106 cache: several fixes for the session cache.
This issue makes several fixes for the session loader and the session store.
 * maxsize argument now works for session caches.
 * fixed performance hole when interation occurs frequently.
 * fixed cache purge bug occuring when multiple caches are defined before being used.
 * improved lastaccess handling.

Big thanks to Marina who contributed the following commits:
 * Always make sure the elements in cache are sorted so we need to remove only elements in the beginning of array
 * Remove expired elements from session store to free memory
 * Minor bug fixes
2013-08-26 09:49:57 +12:00
Sam Hemelryk 2254ea48a9 MDL-41213 filepicker: corrected outline of selected file dialogue 2013-08-26 08:37:12 +12:00
Mary Evans 1be71b3131 MDL-41175 themes: Add/remove group members page broken on small screens. 2013-08-25 17:26:14 +01:00
Damyon Wiese 7064882041 MDL-41149 assign: Group submission updates emailed to wrong person
grade_item_update was altering the userid in the submission record
instead of cloning it. This meant only the last member of a group
recieved all notifications meant for other students in the group.
2013-08-25 22:18:36 +08:00
Damyon Wiese 56f24fadd4 MDL-41249 assign: Restore step missing gradingform mapping
Thanks to Matthieu Raggett for the report and the solution.
2013-08-25 21:25:49 +08:00
Matteo Scaramuccia 91b9fb3749 MDL-41410 Caching: move comment to the appropriate place.
MDL-38162 fixes the issue about testing the connection to the memcached
daemon, which means testing once the connection to the pool of servers
and not to each of the servers while being added to the pool.
It misses to move the comment to that code too.
2013-08-25 14:17:53 +02:00
AMOS bot a8416f35c5 Merge branch 'MOODLE_24_STABLE' into install_24_STABLE 2013-08-24 00:59:07 +00:00
Dan Poltawski 95899cab2f MDL-41401 backup: fix misnamed test method 2013-08-23 15:10:45 +08:00
Dan Poltawski 0d435a3d7c MDL-33472 google plugins: move helper functions to upgradelib.php
upgrade.php is reserved for the upgrade steps only. See also
MDL-34103
2013-08-23 11:34:18 +08:00
Damyon Wiese abb767192f weekly release 2.4.5+ 2013-08-23 10:33:40 +08:00
Mark Nelson f0a60c5f2f MDL-41387 tags: changed character case in string used when deleting a course 2013-08-22 17:40:12 +08:00
Dan Poltawski ee262fa7f5 Revert "MDL-36044 - Delete Icon ("X") blocks Score numbers, when in RTL mode (mod/assign , Rubrics editor)"
This reverts commit 42fabe1e87.
2013-08-22 17:36:39 +08:00
Damyon Wiese c951ff9d39 Merge branch 'wip-MDL-41196-m24' of git://github.com/samhemelryk/moodle into MOODLE_24_STABLE 2013-08-22 11:23:17 +08:00
Dan Poltawski 17f8a9f75f Merge branch 'MDL-30839-24' of git://github.com/phalacee/moodle into MOODLE_24_STABLE 2013-08-22 11:18:10 +08:00
Jason Fowler 1b883b8c20 MDL-30839 Accessibility - Focusing on error on submit 2013-08-22 10:53:18 +08:00
Sam Hemelryk fc4f36be11 MDL-41196 phpmailer: fixed unit test detection 2013-08-22 14:46:42 +12:00
Dan Poltawski 5689cb3a27 Merge branch 'MDL-30839-24' of git://github.com/phalacee/moodle into MOODLE_24_STABLE 2013-08-22 10:15:59 +08:00
Jason Fowler 6050809347 MDL-30839 Fixing extra line breaks in error msg 2013-08-22 09:10:19 +08:00
Tim Hunt f08bce9a54 MDL-40996 & MDL-41162 quiz: fix html_writer::div use in 2.4. 2013-08-22 08:26:01 +12:00
Tim Hunt 67051eb403 MDL-41366 qbehaviour_informationitem fix name capitalisation. 2013-08-21 12:30:06 +01:00
Tim Hunt 6dc4e89073 MDL-38765 quiz view: fix duplicate message.
The "No more attempts are allowed" message was being shown twice. I
checked back, and it has been like that since before the quiz was
converted to use a renderer. Still, it looks horrible, so changing it.
2013-08-21 10:24:32 +01:00
Dan Poltawski 5f6877ddee MDL-41191 mod_forum: avoid DISTINCT on TEXT columns
It is not supported by all db engines
2013-08-21 15:48:09 +08:00
Dan Poltawski 381f53e27e Merge branch 'MDL-30839-24' of git://github.com/phalacee/moodle into MOODLE_24_STABLE 2013-08-21 15:18:03 +08:00
Jason Fowler 466fb01621 MDL-30839 Fixing extra line breaks in error msg 2013-08-21 15:01:59 +08:00
Frederic Massart a8f5f4b6e2 MDL-40877 repository_url: Use textlib functions instead of mb_strlen() 2013-08-21 14:00:40 +08:00
Dan Poltawski af5e39e1b6 Merge branch 'wip-MDL-36690-m24' of git://github.com/marinaglancy/moodle into MOODLE_24_STABLE 2013-08-21 11:36:40 +08:00
Marina Glancy 661d4816df MDL-36690 Do not cache objects inside course.modinfo as they may fail to serialize
convert moodle_url (all other fields are numbers or strings) to string before caching and then back to moodle_url when restoring.
Otherwise serialized modinfo can contain \0 byte which cause problems in Postgres DB
2013-08-21 13:13:35 +10:00
Dan Poltawski 184309fa55 Merge branch 'wip-MDL-32191-m24' of git://github.com/samhemelryk/moodle into MOODLE_24_STABLE 2013-08-21 10:45:07 +08:00
AMOS bot 26af11ece6 Automatically generated installer lang files 2013-08-21 00:43:41 +00:00
Sam Hemelryk 4bc9eec96f Merge branch 'MDL-41162_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-08-21 12:12:43 +12:00
Sam Hemelryk 1eb3364a9e MDL-41157 calendar: added unit test def to phpunit.xml.dist 2013-08-21 11:20:23 +12:00
Sam Hemelryk fef821d726 Merge branch 'm24_MDL-41144' of git://github.com/danmarsden/moodle into MOODLE_24_STABLE 2013-08-21 10:59:34 +12:00
Andrew Nicols 334827b61e MDL-36803 TinyMCE: Fix TinyMCE following touch events on iOS browsers 2013-08-20 23:56:01 +01:00
Sam Hemelryk 69127087c9 Merge branch 'MDL-41157-24' of git://github.com/danpoltawski/moodle into MOODLE_24_STABLE 2013-08-21 10:33:30 +12:00
Sam Hemelryk b43863f6a9 Merge branch 'MDL-41196-m24' of git://github.com/andrewnicols/moodle into MOODLE_24_STABLE 2013-08-21 09:29:31 +12:00
Damyon Wiese 86cef7fbca Merge branch 'MDL-41191-24' of git://github.com/danpoltawski/moodle into MOODLE_24_STABLE 2013-08-20 16:18:36 +08:00
Damyon Wiese b1cd2f8248 Merge branch 'w33_MDL-41112_m24_cachedist' of https://github.com/skodak/moodle into MOODLE_24_STABLE 2013-08-20 15:21:43 +08:00
Jason Fowler 80e86364f4 MDL-35925 - File picker - Adding aria attributes to assist in accessibility 2013-08-20 14:23:23 +08:00
Damyon Wiese 59c487a7f3 Merge branch 'MDL-27595-2_24' of https://github.com/bostelm/moodle into MOODLE_24_STABLE 2013-08-20 13:53:52 +08:00
Damyon Wiese 18c49b1420 Merge branch 'MDL-41036_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-08-20 13:02:26 +08:00
Damyon Wiese d161d6bbe9 Merge branch 'MDL-41122_2.4' of git://github.com/kastashov/moodle into MOODLE_24_STABLE 2013-08-20 12:30:43 +08:00
Dan Poltawski 981ca84aef Merge branch 'MDL-38203_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-08-20 11:36:00 +08:00
Nadav Kavalerchik e8efd1fbe2 MDL-36044 - Delete Icon ("X") blocks Score numbers, when in RTL mode (mod/assign , Rubrics editor) 2013-08-20 11:08:25 +08:00
AMOS bot 796819b631 Automatically generated installer lang files 2013-08-20 00:42:28 +00:00
Marina Glancy a62d50ffb8 MDL-41222 Remove unnecessary course cache rebuild 2013-08-20 10:21:12 +10:00
Dan Poltawski 4b350436cd Merge branch 'MDL-30839-24' of git://github.com/phalacee/moodle into MOODLE_24_STABLE 2013-08-19 17:51:28 +08:00
Damyon Wiese 7452709d69 Merge branch 'm24_MDL-39572' of https://github.com/totara/moodle into MOODLE_24_STABLE 2013-08-19 15:44:17 +08:00
Damyon Wiese 07173cac05 Revert "MDL-41106 cache: several fixes for the session cache."
This reverts commit 4973a0cb41.
This reverts commit e3d9d02381.
This reverts commit b4aba7cac2.
2013-08-19 15:34:00 +08:00
Dan Poltawski ab97bc0a1e Merge branch 'MDL-40893-24' of https://github.com/mr-russ/moodle into MOODLE_24_STABLE 2013-08-19 14:50:18 +08:00
Damyon Wiese 79b958a4a7 Merge branch 'wip-MDL-41106-m24' of git://github.com/samhemelryk/moodle into MOODLE_24_STABLE 2013-08-19 13:51:42 +08:00
Damyon Wiese c93707771f Merge branch 'wip-MDL-36789-m24' of git://github.com/marinaglancy/moodle into MOODLE_24_STABLE 2013-08-19 13:16:39 +08:00
Jason Fowler 790b3da848 MDL-30839 Accessibility, Forms - Improve accessibility or error messages 2013-08-19 09:56:16 +08:00
AMOS bot da51402724 Automatically generated installer lang files 2013-08-19 00:42:38 +00:00
Sam Hemelryk 4973a0cb41 MDL-41106 cache: tidied up several elements 2013-08-19 11:31:37 +12:00
Marina Glancy e3d9d02381 MDL-41106 Cleaning up expired elements in session cache store
- Always make sure the elements in cache are sorted so we need to remove only elements in the beginning of array
- Remove expired elements from session store to free memory
- Minor bug fixes

Conflicts:
	cache/stores/session/lib.php
	cache/stores/session/tests/session_test.php
2013-08-19 11:31:11 +12:00
Andrew Nicols 3822616ba6 MDL-41196 Unit Tests: Add a phpmailer message sink 2013-08-18 16:17:35 +01:00
Nadav Kavalerchik db7d0186ee MDL-40447 Administration: Fix translation: "Profile" should be "Profile Fields" on advanced (more...) user filter form 2013-08-17 23:42:35 +03:00
Frederic Massart d0720e784e MDL-40877 core_text: Added UTF-8 safe strrchr method 2013-08-16 14:20:31 +08:00
Rossiani Wijaya c68f17dfc5 MDL-35930 filepicker filemanaer: make announcement on page change when selecting view files options 2013-08-16 12:14:22 +08:00
AMOS bot 202d7e6ad3 Automatically generated installer lang files 2013-08-16 00:42:58 +00:00
Russell Smith 5821a7c5f1 MDL-40893 backup: cache question answers for performance
To constrain memory we only cache a single question's answers.
A quiz must display this many answers, so it will not result
in undue memory pressure.

We now match on the full answer text rather than the first 255
characters.  This removes the risk of matching questions with the
same start.
2013-08-16 10:06:59 +10:00
Sam Hemelryk b4aba7cac2 MDL-41106 cache: several fixes for the session cache.
This issue makes several fixes for the session loader and the session store.
* maxsize argument now works for session caches.
* fixed performance hole when interation occurs frequently.
* fixed cache purge bug occuring when multiple caches are defined before being used.
* improved lastaccess handling.
2013-08-16 11:59:31 +12:00
Simon Coggins a6bc89e4d2 MDL-39572: Fix sql_order_by_text() to use length argument correctly 2013-08-16 11:28:47 +12:00
Simon Coggins f6868f9c9d MDL-39572: Fix existing tests and add more to demonstrate issue with sql_order_by_text() 2013-08-16 11:28:46 +12:00
Dan Marsden 1fc4e2b414 MDL-41144 enrol_flatfile: ignore deleted users 2013-08-16 09:33:12 +12:00
Dan Marsden 2f64dd6dc8 MDL-37393 SCORM: Fix existing AICC scoes to use correct parent/child relationships 2013-08-16 09:29:58 +12:00
Matteo Scaramuccia 9372820a6e MDL-37393 SCORM: Fixed PHP Strict Standards errors with AICC packages 2013-08-16 09:29:58 +12:00
Jonathon Fowler f2237bd7dc MDL-32191 navigation: Add keys to module and block settings nav nodes 2013-08-16 09:18:50 +12:00
Tim Hunt b014bb8b4c MDL-38203 multianswer qtype: feedback pop-up should be constrained.
So that, when there is a lot of feedback, it is all visible.
2013-08-15 14:16:32 +01:00
Marina Glancy b9f0a2b869 MDL-36789 Quick course cache integrity check for deleted modules 2013-08-15 21:47:50 +10:00
Tim Hunt 8fbb62c9bc MDL-41162 quiz view page: invalid HTML.
We were sometimes outputting nested p tags. Change the outer one to a
div.
2013-08-15 12:41:31 +01:00
Tim Hunt e859dfdfb8 MDL-41036 Question category info should use HTML editor
This is a minimal fix. All this code could do with a clean-up, but at
the moment, it works, so I am not going to touch it.
2013-08-15 11:58:05 +01:00
Henning Bostelmann 0efd7e9d2e MDL-27595 backup: allow course import with warnings
Proceed with import if warnings are found, but display the warnings afterwards
2013-08-15 11:22:19 +01:00
Dan Poltawski 14e8af6687 weekly release 2.4.5+ 2013-08-15 16:43:23 +08:00
Dan Poltawski 0bfeff4c5e Merge branch 'install_24_STABLE' of git://git.moodle.org/moodle-install into MOODLE_24_STABLE 2013-08-15 16:40:29 +08:00
Rossiani Wijaya a60b7797cd MDL-41200 Filepicker: Reduce the string length to fit the dialog size nicely. 2013-08-15 10:50:57 +08:00
Rossiani Wijaya 72e810ca24 MDL-41200 filepicker: change header string to select.
Add length limitation for header, so it fits nicely in mobile devices
2013-08-15 10:48:46 +08:00
AMOS bot c7b085daa0 Automatically generated installer lang files 2013-08-15 00:54:44 +00:00
Dan Poltawski 5fa41023da Merge branch 'MDL-39507_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-08-14 21:58:14 +08:00
Dan Poltawski 376ba9f726 MDL-41191 enrol: unit tests for enrol_get_shared_courses 2013-08-14 21:40:36 +08:00
Tim Hunt 12cc56072a MDL-39507 Question HTML export: fix image handling.
Some code got committed to stable branches that relied on a new API that
was in master only. This fixes it to use the old API.
2013-08-14 11:04:10 +01:00
Dan Poltawski 9ec19c21d2 MDL-41157 calendar: add unit tests for calendar_get_course_cached 2013-08-14 11:06:20 +08:00
Brian King 07b248886d MDL-29004 Wiki: display images in printer-friendly view 2013-08-13 10:10:06 +02:00
Dan Poltawski d835ad6935 MDL-39507 qtype_essay: hacky fix for unit tests
This is just to get the tests passing for integration purposes. Tim
may want to do a robust fix and revert this.
2013-08-13 10:47:46 +08:00
Dan Poltawski 2e91dfc66c Merge branch 'MDL-39507_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-08-13 09:53:31 +08:00
Sam Hemelryk c7f4deecbd Merge branch 'MDL-41045-m24' of git://github.com/sammarshallou/moodle into MOODLE_24_STABLE 2013-08-13 10:19:05 +12:00
Sam Hemelryk 0047905f91 Merge branch 'MDL-39691_24' of git://github.com/jmvedrine/moodle into MOODLE_24_STABLE 2013-08-13 09:40:59 +12:00
Sam Hemelryk 452ff25284 Merge branch 'MDL-41091_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-08-13 09:38:20 +12:00
sam marshall 1a9dc90313 MDL-41050 Progress bar: Width parameter does not work 2013-08-13 09:29:26 +12:00
Sam Hemelryk 3155dcf541 Merge branch 'MDL-41033_m24' of git://github.com/rwijaya/moodle into MOODLE_24_STABLE 2013-08-13 09:21:40 +12:00
Sam Hemelryk 06737a22ea Merge branch 'MDL-40996_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-08-13 09:07:49 +12:00
Sam Hemelryk c5dd64f1e9 Merge branch 'MDL-30895-24' of https://github.com/mouneyrac/moodle into MOODLE_24_STABLE 2013-08-13 08:45:13 +12:00
Sam Hemelryk abafd9a81b NOBUG: fixed whitespace 2013-08-13 08:41:41 +12:00
Sam Hemelryk c41a6dfcd3 Merge branch 'MDL-35931-24' of git://github.com/phalacee/moodle into MOODLE_24_STABLE 2013-08-13 08:37:59 +12:00
Sam Hemelryk 869a5896d0 Merge branch 'MDL-35919-24' of git://github.com/phalacee/moodle into MOODLE_24_STABLE 2013-08-13 08:35:23 +12:00
Sam Hemelryk f568a40ac7 Merge branch 'MDL-35934_m24' of git://github.com/rwijaya/moodle into MOODLE_24_STABLE 2013-08-13 08:31:59 +12:00
Tim Hunt 06a42cff90 MDL-39507 questions: fix pluginfile URLs before format_text.
This commit build's on Jean-Michel's work, tidying up a few lose ends.
2013-08-12 13:13:54 +01:00
Jean-Michel Vedrine cda91161df MDL-39507 questions: fix pluginfile URLs before format_text. 2013-08-12 10:36:40 +01:00
Dan Poltawski aa39783515 Merge branch 'MDL-27655_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-08-12 16:42:07 +08:00
Dan Poltawski f26c65003d Merge branch 'MDL-30001_24' of git://github.com/jmvedrine/moodle into MOODLE_24_STABLE 2013-08-12 16:13:29 +08:00
Dan Poltawski 2b4dbc30ee Merge branch 'wip-mdl-38344-m24' of git://github.com/rajeshtaneja/moodle into MOODLE_24_STABLE 2013-08-12 13:52:49 +08:00
Jason Fowler cdc4b4647d MDL-35919 - Activity Chooser - Adding Aria attributes to improve accessibility 2013-08-12 13:28:03 +08:00
Rossiani Wijaya c6a86e6686 MDL-35934 Filemanager: change the set attribute to use setAttribute() instead of YUI set(). 2013-08-12 12:49:52 +08:00
Kirill Astashov 6796b5630c MDL-41122: Trim on RSS body to prevent Remote RSS block from failing on valid feeds 2013-08-12 12:37:22 +09:30
Jean-Michel Vedrine bfa8f562f7 MDL-39691 Lesson - Email graded essays not working 2013-08-11 08:09:09 +02:00
Jean-Michel Vedrine 390cb87e76 MDL-30001 WEBCT Import does not work for 2.0 2013-08-11 08:06:13 +02:00
Petr Škoda 22ecd9658c MDL-41112 fix theme and js caching info in config-dist.php 2013-08-10 23:49:30 +02:00
Rajesh Taneja ad7577e144 MDL-38344 Calendar: converted name field in event table to text
There is no limitation on length of event name in RFC-2445, so changing type
for name from char to text.
2013-08-09 13:20:41 +08:00
Rossiani Wijaya 498cc62c33 MDL-41033 Filepicker: add ARIA attributes for selecting file in a modal 2013-08-09 10:55:06 +08:00
Rossiani Wijaya ce09c74ab1 MDL-35934 filemanager: Add new string for edit 2013-08-09 10:02:39 +08:00
Rossiani Wijaya 9aa1fe0f77 MDL-35934 Filemanager: update set focus attribute.
Also limit the display string for the dialog header to fit nicely on mobile devices
2013-08-09 10:02:39 +08:00
Rossiani Wijaya 51c14ac9d3 MDL-35934 Filemanager: add aria attributes for editing file/folder.
Add unique reference ids

Conflicts:

	files/renderer.php
	mod/data/field/file/field.class.php
	mod/data/field/picture/field.class.php
2013-08-09 10:02:38 +08:00
Tim Hunt 053617fcb6 MDL-41091 questions: fix get_all_submitted_qt_vars for unit testing. 2013-08-08 14:43:28 +01:00
Jerome Mouneyrac 74f48cfa05 MDL-30895 switch from dl tag to table in the accessible chat 2013-08-08 17:50:58 +08:00
Tim Hunt 1d2247bed6 MDL-40996 quiz show user pic should also show name.
This was a regression introduced by MDL-20636 two years ago!
2013-08-08 09:57:57 +01:00
Tim Hunt 5039961852 MDL-31487 fix FEATURE_CONTROLS_GRADE_VISIBILITY for quiz.
This is a followup to MDL-18301. That fix missed the following points:

1. On the edit categories and items screens, all items had an eye-con to
control the visibility, even if the visibility was controlled by the
module.

2. Changing the visibility of a grade category change the visibility of
all items within it, even if the visibility was controlled by the
module.

3. The quiz ingored $cm->visible when controlling whether its grade item
was visible.
2013-08-08 09:56:53 +01:00
Tim Hunt be09a8982b MDL-27655 improve purge all caches.
If you click the link in the page footer, then it will reliably
redirect you back to the page you were on after purging the caches.

If you go to the purge all caches page in the admin menu, it shows you a
purge button, with no cancel button. Clicking the button purges the
caches and takes you back to the page with the button.
2013-08-08 09:56:32 +01:00
Sam Hemelryk ea3f5b5d95 weekly release 2.4.5+ 2013-08-08 16:25:49 +12:00
Sam Hemelryk a6e4a83d99 Merge branch 'install_24_STABLE' of git://git.moodle.org/moodle-install into MOODLE_24_STABLE 2013-08-08 16:19:42 +12:00
Jason Fowler ae14fe3bb6 MDL-35931 Accessibility - adding focus change when repository is selected 2013-08-08 11:30:39 +08:00
sam marshall 1a60cd4e5c MDL-41045 course_add_cm_to_section should not test for sections unless necessary 2013-08-07 17:20:59 +01:00
Mark Nelson 9e532d0ca3 MDL-40662 block_course_overview: added addinstance capability string 2013-08-07 15:20:07 +12:00
AMOS bot 00410c03d7 Automatically generated installer lang files 2013-08-07 00:43:02 +00:00
Sam Hemelryk b6a2a20236 Merge branch 'MDL-40086-24' of git://github.com/FMCorz/moodle into MOODLE_24_STABLE 2013-08-07 10:36:55 +12:00
Frederic Massart 2980ec2eea MDL-40086 file: Correct ordering of subdirectories
Thanks to Mohamed Alsharaf for the proposed solution.
2013-08-06 13:55:08 +08:00
Sam Hemelryk b19a900a9b Merge branch 'MDL-34989-24' of git://github.com/damyon/moodle into MOODLE_24_STABLE 2013-08-06 17:51:06 +12:00
Ruslan Kabalin 5878abf8c6 MDL-40947: Fix segmentation fault issue in get_fast_modinfo. 2013-08-06 17:42:19 +12:00
Marina Glancy b4b50810d4 Merge branch 'MDL-31226-MOODLE_24_STABLE' of https://github.com/lucisgit/moodle into MOODLE_24_STABLE 2013-08-06 14:40:45 +10:00
Mark Nelson eea2c47d6f MDL-27953 auth: documented the newly introduced function can_be_manually_set() in upgrade.txt 2013-08-06 15:48:19 +12:00
Mark Nielsen 164cc5f0e9 MDL-40870: Icon alt text in External Tool admin settings all read Accept 2013-08-06 14:48:47 +12:00
Sam Hemelryk 504dc60048 Merge branch 'MDL-40662_m24' of https://github.com/markn86/moodle into MOODLE_24_STABLE 2013-08-06 14:39:15 +12:00
Mark Nielsen 052f235f24 MDL-39090: Duplicate parameters in LTI launches
Removed endpoint query string params from body
to prevent param duplication.
2013-08-06 10:24:48 +12:00
Sam Hemelryk ecd106d68d Merge branch 'MDL-27953_m24' of https://github.com/markn86/moodle into MOODLE_24_STABLE 2013-08-06 10:08:39 +12:00
Sam Hemelryk 1498e85483 Merge branch 'w32_MDL-40889_m24_jsminify' of https://github.com/skodak/moodle into MOODLE_24_STABLE 2013-08-06 09:54:48 +12:00
Marina Glancy ebb5c53b51 Merge branch 'MDL-36011-24' of git://github.com/damyon/moodle into MOODLE_24_STABLE 2013-08-05 17:17:33 +10:00
Marina Glancy 93334057de Merge branch 'MDL-30852-24' of git://github.com/damyon/moodle into MOODLE_24_STABLE 2013-08-05 13:53:35 +10:00
Shane Elliott 685ed22b13 MDL-40684 Fix conditional field name for custom user fields 2013-08-05 15:51:30 +12:00
Sam Hemelryk 86ebf30fcf Merge branch 'MDL-35922-24' of git://github.com/phalacee/moodle into MOODLE_24_STABLE 2013-08-05 15:31:59 +12:00
Damyon Wiese 2c6fe0c698 MDL-30852 grade report: More coding guideline cleanups. 2013-08-05 11:24:06 +08:00
Damyon Wiese da6fc6fe17 MDL-30852 grade: Coding style fix for user report. 2013-08-05 11:24:06 +08:00
Steve Bader 8460efc65b MDL-30852 grade report: Add aria attributes
Converted to git branch by Damyon
2013-08-05 11:24:05 +08:00
Damyon Wiese 7d6f0b8224 Merge branch 'MDL-34989-24' of git://github.com/damyon/moodle into MDL-34989-24 2013-08-05 10:44:06 +08:00
Sam Hemelryk 9d146cf08a Merge branch 'MDL-35927_m24' of git://github.com/rwijaya/moodle into MOODLE_24_STABLE 2013-08-05 14:38:31 +12:00
Marina Glancy ac23d64400 Merge branch 'MDL-35981-24' of git://github.com/damyon/moodle into MOODLE_24_STABLE 2013-08-05 12:21:56 +10:00
Damyon Wiese 1c4b87211d MDL-35981 comments: Fix for keyboard control of "add a comment" 2013-08-05 09:51:52 +08:00
Damyon Wiese 461bac938a MDL-35981 comments: Add comment about keycodes for space and enter. 2013-08-05 09:50:59 +08:00
Damyon Wiese be58294484 MDL-35981 comments: Make delete comment keyboard accessible. 2013-08-05 09:50:58 +08:00
Marina Glancy a01c00333c MDL-34785 performance improvement with big list of courses 2013-08-05 10:16:18 +10:00
Ruslan Kabalin 05342e935c MDL-31226: quiz: Fix message for attempts built on previous.
At the moment, when attempt is built on the last one, "not yet answered"
message is shown, which confuses many people. This patch modifies the state to
"complete" for attempt based on previous and modifies the output string.

Many thanks to Tim Hunt for guiding me through quiz infrastructure and some code
suggestions.
2013-08-02 17:01:50 +01:00
Petr Škoda 093aeffbea MDL-40889 prevent 304 when minimising JS 2013-08-02 16:30:05 +02:00
Damyon Wiese 822f3e1178 MDL-36011 tablelib: Make column headers expand/collapse links accessible.
Conflicts:

	theme/base/style/core.css
	theme/bootstrapbase/less/moodle/core.less
	theme/bootstrapbase/style/moodle.css
2013-08-02 11:31:24 +08:00
AMOS bot d6a0927ba1 Automatically generated installer lang files 2013-08-02 00:38:33 +00:00
Sam Hemelryk a3d12f993a weekly release 2.4.5+ 2013-08-02 08:23:56 +12:00
Sam Hemelryk 0460f175d2 Merge branch 'install_24_STABLE' of git://git.moodle.org/moodle-install into MOODLE_24_STABLE 2013-08-02 08:12:13 +12:00
Rossiani Wijaya 5d2b57a822 MDL-35927 filepicker: add aria attribute to display modal error 2013-08-01 15:41:47 +08:00
Mark Nelson 95ddab5f31 MDL-40662 block_course_overview: added addinstance capability to remove debugging message due to system context being used on the 'Default My home page' 2013-08-01 12:51:18 +08:00
Jason Fowler 057def4fa5 MDL-35922 - Adding aria attributes to create-folder modal 2013-07-31 16:41:52 +08:00
Frederic Massart d2a0dce409 MDL-40615 Repository: Updated Amazon S3 library
Fixed insecure use of CURLOPT_SSL_VERIFYHOST
2013-07-30 09:05:09 +12:00
Mark Nelson 574abfafc6 MDL-27953 auth: allowed the LDAP plugin to be manually assigned to uploaded users 2013-07-29 17:08:53 +08:00
Dan Poltawski 65f2bb0984 Merge branch 'MDL-40867_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-07-29 15:25:08 +08:00
Charles Fulton b7ee8b96a9 MDL-40323 report_log: fix strict standards error 2013-07-29 14:00:45 +08:00
Dan Poltawski 49ca7310a3 Merge branch 'MDL-40857_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-07-29 13:56:57 +08:00
Dan Poltawski 29c8710bf5 Merge branch 'MDL-40775_24' of git://github.com/grabs/moodle into MOODLE_24_STABLE 2013-07-29 13:35:23 +08:00
Dan Poltawski 397b5c063e Merge branch 'wip-MDL-29731-m24' of git://github.com/marinaglancy/moodle into MOODLE_24_STABLE 2013-07-29 13:21:20 +08:00
Dan Poltawski 9a17f7d3cc Merge branch 'MDL-36399_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-07-29 12:40:29 +08:00
Dan Poltawski 929088ec57 Merge branch 'MDL-40863_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-07-29 10:10:09 +08:00
Damyon Wiese 336f2df35d MDL-34989 assign: Do not add a param to grading_disabled - cannot be backported.
Conflicts:

	mod/assign/locallib.php
2013-07-29 10:00:10 +08:00
Ashley Holman 214dd19aa2 MDL-34989 assign: Allow students to submit when grade is overriden
Also inform teachers when grading is disabled due to gradebook lock/override.

Conflicts:

	mod/assign/locallib.php
2013-07-29 09:59:43 +08:00
Sam Hemelryk 683fbbb8d7 Merge branch 'MDL-40878_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-07-29 12:54:07 +12:00
Sam Hemelryk 682f6d57cd Merge branch 'w31_MDL-40891_m24_mkdirrace' of https://github.com/skodak/moodle into MOODLE_24_STABLE 2013-07-29 11:52:14 +12:00
Sam Hemelryk dacf5b62e8 Merge branch 'MDL-40727-24' of git://github.com/damyon/moodle into MOODLE_24_STABLE 2013-07-29 11:48:15 +12:00
Sam Hemelryk aa713f26bd Merge branch 'MDL-40854_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-07-29 11:01:33 +12:00
Mark Nielsen 9da794f8aa MDL-40005: LTI module uses Apache specific function for retrieving request headers 2013-07-29 10:54:15 +12:00
AMOS bot b7c61a8b99 Automatically generated installer lang files 2013-07-28 00:42:31 +00:00
AMOS bot 0c3fe2f5f0 Merge branch 'MOODLE_24_STABLE' into install_24_STABLE 2013-07-27 00:43:13 +00:00
Petr Škoda bde942541e MDL-40891 prevent exceptions when creating directories in file store
Even if cache creation fails moodle should continue working.
2013-07-26 20:32:21 +02:00
Petr Škoda 1fed67296c MDL-40891 work around make_writable_directory() race condition
You will still get a "PHP Warning:  mkdir(): File exists" but that should not cause any problems on production sites.
2013-07-26 20:31:52 +02:00
Andreas Grabs 60c61daebe MDL-40775 mod_feedback - Undefined variable in feedback activity 2013-07-26 19:40:14 +02:00
Tim Hunt f30c9280d4 MDL-40854 fix mod/...:view capabilities
Prior to the fix, if you did not have a capability like mod/page:view,
then you woulds still see the link to the Page activity in the course
section, but when you clicked on it, you would run into a
require_capability error.

It is a principle that we never show users a link to a page they are not
allowed to access, therefore, when users do not have mod/...:view, they
should not see the link on the course page.

This patch implements this in the cm_info class, in a similar way to how
access restrictions by groups works.

It does not assume that the mod/...:view capability exists. If the
capability does not exist, then users are not prevented from seeing the
link.
2013-07-26 11:51:31 +01:00
Tim Hunt 82c3032d98 MDL-40857 External tool: fix incorrect moodle_url usage. 2013-07-26 11:41:39 +01:00
Tim Hunt 0d4706dd22 MDL-40857 External tool (LTI) capabilitiy names confusing.
I have improved the names in the language file so that they actually say
what they do (based on my reading of the code). I have also added
comments to access.php explaining each capability.

I have corrected a few of the RISK in access.php which were wrong.

I have changed a couple of the archetypes so that guests cannot launch
LTI activities, and editing teachers cannot do editing things.
2013-07-26 11:41:37 +01:00
Tim Hunt 205a3cd8a0 MDL-40867 fix misleading PHPdocs for _get_coursemodule_info 2013-07-26 10:13:29 +01:00
Tim Hunt da18133994 MDL-40867 External tools should launch pop-ups from the course page
Without this fix, if an LTI tool is set to open in a pop-up, then
clicking the link on the course page opens another almost blank page,
which then tries to open the pop-up, which is almost invariably caught
by your pop-up blocker.

With this fix, clicking the link on the course page opens the pop-up
directly, like for pop-up resources.
2013-07-26 10:13:11 +01:00
Tim Hunt 01a3633cc7 MDL-40863 feedback and LTI mods need get_extra_capabilities fn
Since moodle/site:accessallgroups is relevant to how them.
2013-07-26 10:12:53 +01:00
Tim Hunt 9bec0c088f MDL-36399 LTI editing tool config breaks on Oracle.
Note that this fix will fail if the tool URL is longer than 1333
characters.
2013-07-26 10:11:58 +01:00
Damyon Wiese cd08b5c878 weekly release 2.4.5+ 2013-07-26 11:29:20 +08:00
Marina Glancy 1cdbc04d86 MDL-29731 Bugs in recent activity when using separate groups 2013-07-24 21:52:09 +10:00
Damyon Wiese c8cada1552 MDL-40727 Cache: Fix file cache store on windows. 2013-07-24 17:11:30 +08:00
Nadav Kavalerchik ff77405577 MDL-39704 - Properly align and widen the chat bubbles in mod/chat, when in RTL mode 2013-07-23 23:23:48 +02:00
Eloy Lafuente (stronk7) 8b8bd17aac Merge branch 'w30_MDL-40679_m24_zlib' of https://github.com/skodak/moodle into MOODLE_24_STABLE 2013-07-23 18:21:19 +02:00
Eloy Lafuente (stronk7) 9655e2e335 Merge branch 'MDL-40785_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-07-23 18:01:28 +02:00
Eloy Lafuente (stronk7) 4e60c378cf Merge branch 'wip-MDL-40700-m24' of git://github.com/samhemelryk/moodle into MOODLE_24_STABLE 2013-07-23 13:58:46 +02:00
Dan Poltawski ff1fb4619b Merge branch 'MDL-20609_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-07-23 16:45:58 +08:00
Dan Poltawski 4523e6af16 Merge branch 'MDL-40480_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-07-23 16:38:48 +08:00
Jason Fowler 4f6f2013bf MDL-39748 - Grading Methods - Fixing input field widths for Rubrics 2013-07-23 14:25:06 +08:00
Dan Poltawski 9ed79d1801 MDL-40585 fix trailing whitespace 2013-07-23 13:35:16 +08:00
Dan Poltawski 066c7987b2 Merge branch 'MDL-40585_24' of git://github.com/mr-russ/moodle into MOODLE_24_STABLE 2013-07-23 13:35:07 +08:00
Dan Poltawski bb925bb8ba Merge branch 'MDL-40584_24' of https://github.com/mr-russ/moodle into MOODLE_24_STABLE 2013-07-23 12:38:39 +08:00
Sam Hemelryk 1f3be76708 Merge branch 'MDL-40680-24' of git://github.com/danpoltawski/moodle into MOODLE_24_STABLE 2013-07-23 14:12:35 +12:00
AMOS bot 5e0e88e5a3 Automatically generated installer lang files 2013-07-23 00:39:25 +00:00
Eloy Lafuente (stronk7) 9260f1bdd2 Merge branch 'MDL-40626-24' of git://github.com/danpoltawski/moodle into MOODLE_24_STABLE 2013-07-22 17:41:07 +02:00
Dan Poltawski 9dae491a94 Merge branch 'w30_MDL-38867_m24_gspell' of https://github.com/skodak/moodle into MOODLE_24_STABLE 2013-07-22 17:01:58 +08:00
Damyon Wiese 8e3c3ac499 MDL-40260 Course overview: code tidy for previous commit
Moving this check inside the following if makes it clear which code
branch it applies to.
2013-07-22 16:16:41 +08:00
Damyon Wiese 4cf35a316e Merge branch 'm24_MDL-40260' of git://github.com/danmarsden/moodle into MOODLE_24_STABLE 2013-07-22 16:16:27 +08:00
Damyon Wiese a04662aad4 Merge branch 'wip-MDL-40174-m24' of git://github.com/samhemelryk/moodle into MOODLE_24_STABLE 2013-07-22 16:04:40 +08:00
Dan Poltawski c60752f45c Merge branch 'wip-MDL-37333_M24' of git://github.com/gjb2048/moodle into MOODLE_24_STABLE 2013-07-22 10:31:56 +08:00
Sam Hemelryk a62e342c3d MDL-40174 navigation: don't remove active root nodes without children 2013-07-22 10:49:13 +12:00
Sam Hemelryk ad739cd700 MDL-40700 cache: memcache and memcached stores now allow alphanumext prefixes 2013-07-22 10:41:51 +12:00
Chris Wharton 5886e039ec MDL-40700 cache: Validate memcache key prefix field 2013-07-22 10:41:50 +12:00
Petr Škoda bc6bf8d1e6 MDL-40679 mark zlib extension as recommended 2013-07-20 21:20:40 +02:00
Tim Hunt 0d62d8196e MDL-40785 question instances report: ignore subquestions
We should not count subquestions of cloze questions (parent != 0) but we
do want to count random questions (parent = id).
2013-07-19 15:17:00 +01:00
Tim Hunt 7544d10492 MDL-40480 tablelib: specify charset in XHMTL downloads.
Thanks to Jürgen Zimmer for the suggestion.
2013-07-19 11:46:05 +01:00
Tim Hunt 50a4b42ed7 MDL-20609 quiz tables: improve layout for long cell contents.
By allowing more wrapping.
2013-07-19 11:45:27 +01:00
Petr Škoda 7831560995 MDL-38867 remove Google spell checking option 2013-07-19 09:32:35 +02:00
Tim Lock 58940c96c4 MDL-40626 gradebook: Prevent incorrect override with multiline feedback
The quick grading option doesn't allow mutliline editing.
2013-07-19 12:01:55 +08:00
Damyon Wiese 1a449aa5e7 weekly release 2.4.5+ 2013-07-19 09:50:19 +08:00
Damyon Wiese 855b35604d Merge branch 'install_24_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_24_STABLE 2013-07-19 09:24:02 +08:00
Damyon Wiese 20ea7f2f79 MDL-35851 lesson: Handle importing questions into an empty lesson.
Also - make sure the page we are updating belongs to the lesson.
2013-07-18 16:52:46 +08:00
Gareth J Barnard 2d2b3c39b3 MDL-37333 theme: Fix 'Clear theme caches' redirect. 2013-07-17 17:35:22 +01:00
Damyon Wiese 9f837ac934 MDL-35851 Lesson: Check/fix the page order every time the pages are loaded 2013-07-17 13:04:54 +08:00
Marina Glancy 89478f00cd Merge branch 'MDL-40701-24' of git://github.com/danpoltawski/moodle into MOODLE_24_STABLE 2013-07-17 12:47:43 +10:00
Dan Poltawski e66647085e MDL-40701 mod_assignment: fix refresh events
It was getting the cm event with the wrong id and calling
deprecated functions
2013-07-17 10:31:39 +08:00
Eloy Lafuente (stronk7) d76bba6e24 Merge branch 'w29_MDL-40611_m24_accesslibtest' of https://github.com/skodak/moodle into MOODLE_24_STABLE 2013-07-17 00:32:44 +02:00
Eloy Lafuente (stronk7) d8bbfdfbe0 Merge branch 'MDL-40536-24' of git://github.com/danpoltawski/moodle into MOODLE_24_STABLE 2013-07-17 00:26:57 +02:00
Petr Škoda 405d2962d2 MDL-40423 fix creation of new install.xml in subplugins 2013-07-16 21:56:40 +02:00
Damyon Wiese 4474895d37 Merge branch 'wip-MDL-40621-m24' of git://github.com/marinaglancy/moodle into MOODLE_24_STABLE 2013-07-16 21:31:52 +08:00
Eloy Lafuente (stronk7) d9debeb038 Merge branch 'MDL-40555-24' of git://github.com/FMCorz/moodle into MOODLE_24_STABLE
Conflicts:
	cache/stores/static/lib.php
2013-07-16 09:55:34 +02:00
Marina Glancy 18cf2255f0 Merge branch 'MDL-35851-24' of git://github.com/damyon/moodle into MOODLE_24_STABLE 2013-07-16 16:12:40 +10:00
Damyon Wiese ccf721640c MDL-35851 lesson: removed expensive upgrade step.
Just deal with the bad data when displaying the lesson instead.

Conflicts:

	mod/lesson/db/upgrade.php

Conflicts:

	mod/lesson/db/upgrade.php
	mod/lesson/version.php
2013-07-16 14:08:08 +08:00
Damyon Wiese a2de489c3e Merge branch 'MDL-40195_24' of git://github.com/aolley/moodle into MOODLE_24_STABLE 2013-07-16 13:29:19 +08:00
Damyon Wiese 994d7ebdc3 Merge branch 'w29_MDL-40558_m24_guestdelete' of https://github.com/skodak/moodle into MOODLE_24_STABLE 2013-07-16 11:29:28 +08:00
Matt Debus bc583cacfd MDL-40524: mod_wiki: Display comments in order 2013-07-16 11:26:42 +08:00
Damyon Wiese a7228f586b Merge branch 'MDL-40538_24' of https://github.com/mr-russ/moodle into MOODLE_24_STABLE 2013-07-16 10:26:56 +08:00
Rossiani Wijaya 9f124aa5ad MDL-35851 Lesson module: fix page order id for import questions. Add upgrade script to fix lesson pages corrupted links
Conflicts:

	mod/lesson/db/upgrade.php
	mod/lesson/version.php
2013-07-16 10:07:46 +08:00
Dan Poltawski f620ae6c11 MDL-40680 store_memcached: fix serialiser options
* Use correct lang string for SERIALIZER_IGBINARY
* Use PARAM_INT for the parameter
2013-07-16 09:39:16 +08:00
Sam Hemelryk 5cae1b013f MDL-40555 cache: implemented unit tests for default search functionality 2013-07-16 08:36:19 +08:00
Frederic Massart 76edea3d61 MDL-40555 cache: Static store is searchable 2013-07-16 08:35:08 +08:00
Russell Smith 558f2de1b9 MDL-40584 backup: Query db once per category in precheck
The cache is function local and testing against a large database
indicates 10k questions is a large category.  Restore already
uses MEMORY_EXTRA and that will have enough space for the couple
of megabtyes a local sql hash will introduce.
2013-07-16 08:04:16 +10:00
Eloy Lafuente (stronk7) 174405bd5d Merge branch 'wip-MDL-38747-MOODLE_24_STABLE' of https://github.com/satrun77/moodle into MOODLE_24_STABLE 2013-07-15 17:07:05 +02:00
Russell Smith 1bdb3dcd2b MDL-40585 backup: cache XML parent paths
For $this->groupedpaths, using a key is faster as there is
no need to do in_array searches.

Parent cache allows dirname calls to be substantially reduced.
2048 was chosen as a cache size as this class operates on chunks
of the restore at a time, 8k questions produces a parent cache of
about 500 paths and uses 300K of memory.  Scaling up to 2048 will
use about 1.2M of RAM for really large restores.  This is acceptable
for the 48% function call reduction and the 10% runtime improvement
seen.
2013-07-15 19:23:13 +10:00
Damyon Wiese 643786623e MDL-39563: Change to use $CFG consistently 2013-07-15 15:06:30 +08:00
Damyon Wiese ae5e95af2d Merge branch 'MDL-39563-24' of git://github.com/jleyva/moodle into MOODLE_24_STABLE 2013-07-15 15:06:08 +08:00
Marina Glancy 35dc874292 Merge branch 'MDL-40633_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-07-15 14:45:22 +10:00
Marina Glancy c291dd69ea Merge branch 'wip-MDL-39062-m24' of git://github.com/samhemelryk/moodle into MOODLE_24_STABLE 2013-07-15 12:53:02 +10:00
Daniel Myers 4fae47dedc MDL-40260 block_course_overview: prevent MNET courses from being dimmed 2013-07-15 13:55:57 +12:00
AMOS bot 688c3bffbd Automatically generated installer lang files 2013-07-15 00:44:27 +00:00
Sam Hemelryk 6026121e10 MDL-39062 cache: version bump to update definitions 2013-07-15 12:02:23 +12:00
Sam Hemelryk 762789f5d7 MDL-39062 cache: persist keys now set properly 2013-07-15 12:02:01 +12:00
Petr Škoda f25af6571f MDL-40611 fix context cache size expectation 2013-07-13 15:40:26 +02:00
Tim Hunt e4f1467a75 MDL-40633 filter_urltolink breaking some image links.
This was a regression caused by MDL-22390. HTML like
<img src="http://www.example.com/logo.gif" />
was being broken.
2013-07-12 11:43:47 +01:00
Petr Škoda ddc6c118c6 MDL-40558 skip admins and guest when deleting incomplete users 2013-07-12 12:38:26 +02:00
Petr Škoda 12de66b2bf MDL-40569 fix empty CSS files after cache purging 2013-07-12 12:35:19 +02:00
Dan Poltawski 514132f8a8 MDL-40536 course/externallib fix incorrect variable
Fixes test_import_course_invalid_deletecontent_option() from the
previous commit.
2013-07-12 16:40:59 +08:00
Dan Poltawski c181c6137d MDL-40536 course: unit tests for course_external::import_course
Basic import operations and a specific test case which identifies
a bug.
2013-07-12 16:40:59 +08:00
Mohamed Alsharaf 3bf3451872 MDL-38747 blocks: course format options numsections is required to display the block 2013-07-12 20:27:24 +12:00
Damyon Wiese 2c66b71ab4 weekly release 2.4.5+ 2013-07-12 09:51:49 +08:00
Damyon Wiese 95455fc76a Merge branch 'install_24_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_24_STABLE 2013-07-12 09:42:53 +08:00
AMOS bot 658c7b8a7a Automatically generated installer lang files 2013-07-12 00:46:02 +00:00
Juan Leyva ee2316f022 MDL-39563 Fixing mobilecssurl is not being returned in WebService phpunit tests 2013-07-11 16:28:42 +02:00
Marina Glancy dd0f944141 MDL-40621 fixed small bug in function editor_tinymce_plugin::fix_row() 2013-07-11 16:45:48 +10:00
Marina Glancy 537d8f8a58 Merge branch 'MDL-38366-24' of git://github.com/FMCorz/moodle into MOODLE_24_STABLE 2013-07-10 16:26:59 +10:00
Frederic Massart 2a2d53bd97 MDL-38366 repository_filesystem: Prevent use of empty subdir 2013-07-10 13:49:38 +08:00
Marina Glancy 114c924d94 Merge branch 'm24_MDL-39832_Fix_Chrome_Issues_ETag_XSendfile_2ndRound' of https://github.com/scara/moodle into MOODLE_24_STABLE 2013-07-10 12:03:57 +10:00
Raymond Wijaya 622425d2fb MDL-40093 mod/assign: Remove count of drafts in offline assignment's grading summary screen 2013-07-10 11:36:53 +10:00
Russell Smith 2215cc347a MDL-40538 caching: Use isset for performance
isset is much faster than array_key_exists. For caches we need to
ensure as much performance as possible. To all null to continue to
be stored and provide correct results, non ttl also now saves in
$this->store[$key][0].  As isset($this->store[$key]) will return
true in all cases.

time() as found in cache::now() can be slow on some platforms and
we shouldn't bother checking it unless needed. It also stops non-ttl
caches paying the ttl price.

Unit tests were adjusted to ensure null is still handled correctly
when we are only using isset.
2013-07-10 10:42:51 +10:00
Marina Glancy ed79029f0e Merge branch 'MDL-40441_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-07-10 10:03:44 +10:00
Sam Hemelryk 286232d695 Merge branch 'w28_MDL-40450_m24_tinymcebuttons' of https://github.com/skodak/moodle into MOODLE_24_STABLE 2013-07-10 11:01:48 +12:00
Sam Hemelryk 97d98e9920 Merge branch 'MDL-40527_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-07-10 10:30:29 +12:00
Sam Hemelryk 3b0c725de1 Merge branch 'm24_MDL-40512' of git://github.com/danmarsden/moodle into MOODLE_24_STABLE 2013-07-10 10:09:49 +12:00
Damyon Wiese 4dcd073864 Merge branch 'MDL-39420_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-07-09 22:44:21 +08:00
Damyon Wiese 800c5757c3 Merge branch 'MDL-36479_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-07-09 22:27:59 +08:00
Tim Hunt 4cc817aa33 MDL-39420 multichoice: fix layout of multi-line choices. 2013-07-09 11:57:07 +01:00
Tim Hunt 41ffd24e82 MDL-40441 fix obscure notice in the quiz.
This can only happen if you have both a user with both a real attempt
and a preview, and then edit the quiz settings.

Also clean up this code a bit.
2013-07-09 10:45:33 +01:00
Damyon Wiese 1f304be72c Merge branch 'MDL-40443_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-07-09 15:16:32 +08:00
Jamie Pratt 304343830b MDL-40176 mock_submit method for testing
Conflicts:

	lib/formslib.php
2013-07-09 15:09:56 +08:00
Damyon Wiese d3dc9a334c Merge branch 'MDL-40499_24' of git://github.com/jmvedrine/moodle into MOODLE_24_STABLE 2013-07-09 13:27:05 +08:00
prateeksachan bb6cacb913 MDL-40386: Fix for updating timemodified field in book_chapters 2013-07-09 12:35:18 +08:00
Jamie Pratt 4eff6ed9fe MDL-40388 Reset globals after each unit test 2013-07-09 11:56:53 +08:00
Tony Levi 954ba4bce4 MDL-40035: Avoid rebuild_course_cache always for empty course 2013-07-09 13:55:46 +10:00
Damyon Wiese b7aac8b6d1 Merge branch 'MDL-40318_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-07-09 11:13:23 +08:00
Marina Glancy be9cd2ff26 Merge branch 'MDL-40434_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-07-09 11:33:20 +10:00
Tim Lock b719bf20b4 MDL-40436: auth_ldap: Fixed warning when adding new LDAP users 2013-07-08 23:02:22 +08:00
Adam Olley d79c15550f MDL-40195: mod_assign: Display grades when quickgrading to 2 decimal places 2013-07-08 20:07:12 +09:30
Damyon Wiese 92cfad95c8 Merge branch 'MDL-38314-24' of git://github.com/FMCorz/moodle into MOODLE_24_STABLE 2013-07-08 16:40:39 +08:00
Frederic Massart f4f853f8cd MDL-38314 repository: Removed >= 2.5 code logic 2013-07-08 16:40:21 +08:00
Damyon Wiese 51cefce972 Merge branch 'MDL-38314-24' of git://github.com/FMCorz/moodle into MOODLE_24_STABLE
Conflicts:
	version.php
2013-07-08 15:16:42 +08:00
Petr Škoda f0be68a15e MDL-40450 update links to TinyMCE 3.x docs 2013-07-07 16:12:29 +02:00
Matteo Scaramuccia c8d8b400f9 MDL-39832 Files: Fixed ETag format according with RFC2616.
ETag must be double quoted,
http://tools.ietf.org/html/rfc2616#section-3.11:

      entity-tag = [ weak ] opaque-tag
      weak       = "W/"
      opaque-tag = quoted-string
2013-07-07 09:19:15 +02:00
Matteo Scaramuccia 6ef0160a64 MDL-39832 Files: Revert MDL-39688 commit, 7c742620d2
MDL-39688 has been successful in providing a solution for the issue but further
investigations done in MDL-39832 have got the evidence that the given solution
is more likely a workaround.
2013-07-07 09:19:14 +02:00
Eloy Lafuente (stronk7) 919251f295 Moodle release 2.4.5 2013-07-06 17:56:11 +02:00
Tim Hunt 712bcc3e09 MDL-40527 enrol meta: respect $CFG->courselistshortnames
Thanks to James Henestofel for working this out in MDL-37558. That issue
got complex, so I am just submitting this simple part of it for
integration.
2013-07-05 15:37:09 +01:00
Dan Marsden ed928e942c MDL-40512 SCORM: prevent undefined warning 2013-07-05 12:09:59 +12:00
Jean-Michel Vedrine a16ec93666 MDL-40499 Edit question from 1.9 backup breaks if images in subdirs 2013-07-04 15:07:46 +02:00
Tim Hunt 28c8189c7f MDL-40443 setType notice in quiz reports. 2013-07-04 12:34:55 +01:00
Tim Hunt c004ced96b MDL-40318 quiz intro comprising just an impage was not shown
Also, ensure that we don't output an empty box if there are no access
messages.
2013-07-04 12:34:21 +01:00
Tim Hunt ef84ab84bf MDL-36479 quiz regrade: use progress bar to prevent time-outs 2013-07-04 12:33:25 +01:00
Damyon Wiese b5906ea400 weekly release 2.4.4+ 2013-07-04 15:33:31 +08:00
Damyon Wiese 76e6fbd776 MDL-40308: Fix javascript for lti mod_form
It was toggling the state of the hidden input - not the checkbox.
2013-07-04 13:47:36 +08:00
Frederic Massart 7e51747ede MDL-38314 repository: Improving performance of upgrade script 2013-07-03 16:28:28 +08:00
Frederic Massart 22785530b9 MDL-38314 repository: Remove orphan repository instances 2013-07-03 16:28:25 +08:00
Frederic Massart d8732ee8b7 MDL-38314 repository: Delete repository instances on context deletion 2013-07-03 16:27:08 +08:00
Frederic Massart c11ea21997 MDL-38314 repository: Unit Tests for delete_all_for_context() 2013-07-03 16:27:08 +08:00
Michael Aherne 1619a06942 MDL-40275 core Improve documentation for block_base::has_config() 2013-07-02 21:53:17 +02:00
Eloy Lafuente (stronk7) bc6835b1d1 MDL-37516 Translate fieldnames on output only.
This reverts a change performed by the previous commit where user
fieldnames were being translated (and cached) when fetched,
causing the information to remain static later, not responding
to language switches (and perhaps leading to other problems if those
structures are used lated for DB / $USER comparisons.

With the commit, the translation happens on output, so no
potential interferences will happen and, also, the information
changes dynamically on lang switching.
2013-07-02 21:03:10 +02:00
sam marshall 122d59390f MDL-37516 Conditional activities: user field condition display fixes 2013-07-02 21:03:04 +02:00
Eloy Lafuente (stronk7) cb4beb2d2c Merge branch 'MDL-40439-en_fix_24' of git://github.com/mudrd8mz/moodle into MOODLE_24_STABLE 2013-07-02 13:48:02 +02:00
Helen Foster c3f4867a41 MDL-40439 Merge English strings from the en_fix language pack 2013-07-02 11:51:45 +02:00
Tim Hunt ca6904b6c9 MDL-40434 calculatedmulti multiple-response questions not randomised 2013-07-02 08:24:01 +01:00
Damyon Wiese 955172a5a0 Merge branch 'wip-MDL-40353-m24' of git://github.com/marinaglancy/moodle into MOODLE_24_STABLE 2013-07-02 14:29:28 +08:00
Dan Poltawski d1e2ee9eec Merge branch 'MDL-40297_24' of git://github.com/stronk7/moodle into MOODLE_24_STABLE 2013-07-02 13:43:57 +08:00
Andreas Grabs 5832a8f737 MDL-39570 mod_feedback - Missing privilege check 2013-07-02 13:35:49 +08:00
Dan Poltawski 1edad3fd90 Merge branch 'w27_MDL-40399_m24_msarrayshift' of https://github.com/skodak/moodle into MOODLE_24_STABLE 2013-07-02 13:33:49 +08:00
Dan Marsden 01d2c82e1b MDL-39628 Chat: check mod/chat:chat capability when using daemon.
Thanks to Francois Gauthier for report/fix.
2013-07-02 12:20:25 +08:00
Jason Fowler 4b450df00d MDL-37818 - RSS - Prevent access to blocks while RSS context errors are displayed 2013-07-02 10:04:21 +08:00
Dan Poltawski e09fc9f3c1 Merge branch 'w27_MDL-40266_m24_arrayshift' of https://github.com/skodak/moodle into MOODLE_24_STABLE 2013-07-02 09:55:33 +08:00
Eloy Lafuente (stronk7) ea0b123d07 Merge branch 'get_users_by_capability_fix_m24' of http://github.com/timgus/moodle into MOODLE_24_STABLE 2013-07-02 00:46:51 +02:00
Rossiani Wijaya 301d9518ed MDL-39546 Lesson module: removed duplicate to decode special characters 2013-07-02 09:36:06 +12:00
Rossiani Wijaya 3c108a95df MDL-39546 Lesson module: fixed matching question issues. 2013-07-02 09:35:52 +12:00
Eloy Lafuente (stronk7) 8ae15861de Merge branch 'w27_MDL-39754_m24_evn26' of https://github.com/skodak/moodle into MOODLE_24_STABLE 2013-07-01 23:14:16 +02:00
Petr Škoda ec99b59381 MDL-39754 copy 2.5 requirements to Moodle 2.6
Optional features and warnings may be added later,
but we need at least required environment for 2.5.1

This includes database family cleanup and more realistic memory requirement.
2013-07-01 10:03:51 +02:00
Petr Škoda 1596dca3d0 MDL-40266 improve emulate_bound_params() for mssql driver
Looping over large numbers of items with array_shift() is expensive.
Reverse the array and fetch items from the top of the pile.

Credit goes to Martin Langhoff for original mysqli fix.
2013-07-01 08:53:28 +02:00
Petr Škoda ba8a53a4f9 MDL-40266 improve emulate_bound_params() for sqlsrv driver
Looping over large numbers of items with array_shift() is expensive.
Reverse the array and fetch items from the top of the pile.

Credit goes to Martin Langhoff for original mysqli fix.
2013-07-01 08:53:27 +02:00
Mark Nielsen 86e56e40bd MDL-40308: Privacy settings do not change
Update LTI mod form so checkboxes always submit their value.
2013-07-01 11:27:32 +08:00
Dan Poltawski 3db9731fb6 Merge branch 'wip-MDL-40344-m24' of git://github.com/samhemelryk/moodle into MOODLE_24_STABLE 2013-07-01 11:22:20 +08:00
Sam Hemelryk 3d6b490b81 NOBUG: fixed whitespace 2013-07-01 13:24:50 +12:00
Martin Langhoff 2122af37b6 MDL-40266 improve emulate_bound_params() for mysqli
Looping over large numbers of items with array_shift() is expensive.
Reverse the array and fetch items from the top of the pile.
2013-06-30 18:40:18 +02:00
Eloy Lafuente (stronk7) c45ca47759 MDL-40297 whitespace, comments & var names cleanup 2013-06-30 16:49:13 +02:00
Dmytro Vorona d121290607 MDL-40297 Hide empty categories in my courses
This is a followup of MDL-38631 were was detected that
whith categories being displayed in my courses, some of
them, not having courses for the user, were still shown.

With this patch, any category in the tree, not having courses
is automatically hidden, any depth.
2013-06-30 16:49:08 +02:00
David Mudrák bdd014e2c2 MDL-35206 Fix the links list enumeration in the html2text library 2013-06-28 13:14:48 +02:00
Sam Hemelryk 7bcdac4882 MDL-40344 navigation: expandable branch id is now properly unique 2013-06-28 09:58:59 +12:00
Eloy Lafuente (stronk7) c982630a94 weekly release 2.4.4+ 2013-06-27 20:11:52 +02:00
Eloy Lafuente (stronk7) dc56547079 Merge branch 'install_24_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_24_STABLE 2013-06-27 20:05:24 +02:00
Marina Glancy fe4bb9a3f6 MDL-40353 fixed wrong redirection on course group page 2013-06-27 13:50:43 +10:00
AMOS bot 96cf04159c Automatically generated installer lang files 2013-06-27 00:40:26 +00:00
Eloy Lafuente (stronk7) 1de08a0e60 Merge branch 'MDL-40264-m24-essay-zero' of git://github.com/ktemkin/moodle into MOODLE_24_STABLE 2013-06-24 21:23:34 +02:00
Eloy Lafuente (stronk7) 4207e4771a Merge branch 'MDL-34610_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-06-24 20:21:47 +02:00
Eloy Lafuente (stronk7) 81c7328717 Merge branch 'MDL-40255_M24' of git://github.com/lazydaisy/moodle into MOODLE_24_STABLE 2013-06-24 19:26:32 +02:00
Matteo Scaramuccia da660f362b MDL-40200 Administration: Return the invalid user message and stop there
To avoid adding duplicate code, 'invalid user' and 'user deleted' checks
have been merged together.
2013-06-24 19:01:08 +02:00
Sam Chaffee 4417a705cf MDL-40258: Fixed invalid json string error in file-picker 2013-06-24 18:57:08 +02:00
Ankit Agarwal cc6641f040 MDL-40250 phpunit: Add unit tests for core_files_external::upload() 2013-06-24 18:10:04 +02:00
Jason Fowler 6e4059838c MDL-39044 - Course Completion - Replaceing strtolower with multibyte safe textlib::strtolower
Conflicts:
	blocks/completionstatus/details.php
2013-06-24 15:46:34 +12:00
Sam Hemelryk 211c473452 Merge branch 'MDL-39760-MOODLE_24_STABLE' of https://github.com/lucisgit/moodle into MOODLE_24_STABLE
Conflicts:
	mod/assign/locallib.php
2013-06-24 14:29:21 +12:00
Sam Hemelryk 9505fcffe4 Merge branch 'MDL-39280-24' of git://github.com/FMCorz/moodle into MOODLE_24_STABLE 2013-06-24 14:08:47 +12:00
Sam Hemelryk 7759839612 MDL-38347 fixed whitespace 2013-06-24 11:29:34 +12:00
Sam Hemelryk 9cf6081027 Merge branch 'wip-MDL-38347-stable24' of git://github.com/phalacee/moodle into MOODLE_24_STABLE 2013-06-24 11:21:54 +12:00
Sam Hemelryk 6d4fe99033 Merge branch 'MDL-28124_M24' of git://github.com/lazydaisy/moodle into MOODLE_24_STABLE 2013-06-24 10:29:06 +12:00
Amanda Doughty bf296d3cf3 MDL-38376 mod_assign: Feedback displayed when Grade set to hidden 2013-06-24 10:19:53 +12:00
Mary Evans 98159ddec2 MDL-40255 theme_boxxie/theme_formfactor: Added block-region class to layout files to enable dnd file uploader to work. 2013-06-22 21:26:20 +01:00
Marina Glancy 2c8e21ac35 MDL-38631 link categories in My courses only when needed 2013-06-22 16:21:30 +10:00
Dmytro Vorona 073a972375 MDL-38631 Fixed faulty add_category call, introduced in 758103 2013-06-22 16:21:29 +10:00
Tim Hunt 40818b7d48 MDL-34610 remove legacy IE CSS. It breaks form layout 2013-06-21 21:57:45 +01:00
Kyle Temkin b64526c715 MDL-40264 fix essay handling of zero-string response
Fixes an inappropriate behavior of the is_complete_response() function
for the Essay question type, which caused the string "0" to be
inappropriately marked as an incomplete response.

Also adds a set of unit tests for the Essay question type's
is_complete_response.
2013-06-21 03:28:59 -04:00
Dan Poltawski 8be321e3d9 weekly release 2.4.4+ 2013-06-21 13:29:18 +08:00
Tim Gus 134a6ddcf0 MDL-40259 - For SCORM reports limit fields returned from
get_users_by_capability to user ID to decrease memory utilization
2013-06-20 15:56:47 -04:00
Ruslan Kabalin 478cac84e1 MDL-39760: mod_assign: Add few more callback methods.
Adds lock, unlock and release_to_draft. All of them accept single parameter -
an assign_submission record.
2013-06-19 15:35:17 +01:00
Ruslan Kabalin c07c4324c7 MDL-39760: mod_assign: Make submit_for_grading accept submission as parameter. 2013-06-19 15:35:16 +01:00
Marina Glancy bebd6a6cef Merge branch 'MDL-40207-24' of git://github.com/danpoltawski/moodle into MOODLE_24_STABLE 2013-06-18 15:39:55 +10:00
Marina Glancy 272105604a Merge branch 'MDL-39650-24' of git://github.com/FMCorz/moodle into MOODLE_24_STABLE 2013-06-18 14:13:10 +10:00
Ruslan Kabalin 8401eb9425 MDL-33546: course: Fix current week hightlighting after dragging the section 2013-06-18 13:04:43 +10:00
Marina Glancy 2e6cc99352 Merge branch 'MDL-40165-m24' of git://github.com/andrewnicols/moodle into MOODLE_24_STABLE 2013-06-18 12:56:20 +10:00
Sam Hemelryk 23f186b5c8 Merge branch 'MDL-40036-24' of git://github.com/FMCorz/moodle into MOODLE_24_STABLE 2013-06-18 13:58:48 +12:00
Marina Glancy af06f5def5 Merge branch 'MDL-38079_24' of git://github.com/mr-russ/moodle into MOODLE_24_STABLE 2013-06-18 11:14:52 +10:00
Sam Hemelryk 46c30b7e1b Merge branch 'wip-mdl-39863-m24' of git://github.com/rajeshtaneja/moodle into MOODLE_24_STABLE 2013-06-18 11:19:22 +12:00
Sam Hemelryk c8802b6e6c Merge branch 'MDL-40109_24' of git://github.com/dmonllao/moodle into MOODLE_24_STABLE 2013-06-18 11:07:48 +12:00
Eloy Lafuente (stronk7) 392aa3ff35 Merge branch 'MDL-33562-24' of git://github.com/danpoltawski/moodle into MOODLE_24_STABLE
Conflicts:
	version.php
2013-06-18 00:46:59 +02:00
Sam Hemelryk 5008f4fffd Merge branch 'MDL-30132_M24' of git://github.com/lazydaisy/moodle into MOODLE_24_STABLE 2013-06-18 10:26:27 +12:00
Sam Hemelryk 7b8783b751 Merge branch 'wip-MDL-40159-m24' of git://github.com/marinaglancy/moodle into MOODLE_24_STABLE 2013-06-18 09:04:27 +12:00
Russell Smith 8fb30e9d1f MDL-38079 mod_feedback - Hide "add question to activity" button 2013-06-17 20:00:05 +10:00
Marina Glancy dfdea57b26 MDL-40159 Fixing bug with empty variable, regression from MDL-21097 2013-06-17 14:26:10 +10:00
Sam Hemelryk c4eab12234 Merge branch 'm24_MDL-40095_Completion_locked_Error_on_save' of https://github.com/scara/moodle into MOODLE_24_STABLE 2013-06-17 16:09:52 +12:00
Sam Hemelryk 57efe7bdba Merge branch 'MDL-21933_24' of https://github.com/mr-russ/moodle into MOODLE_24_STABLE 2013-06-17 15:45:16 +12:00
Sam Hemelryk 11270c4b2d Merge branch 'wip-MDL-40091-MOODLE_24_STABLE' of git://github.com/satrun77/moodle into MOODLE_24_STABLE 2013-06-17 15:43:07 +12:00
Dan Poltawski f7c0e172c6 MDL-40207 simplepie: reduce false failures in unit tests
The simplepie tests time out too quickly due to a low connect timeout,
to fix this, I converted the unit tests to use a high timeout value.
2013-06-17 10:59:41 +08:00
Sam Hemelryk 79cb5006f9 Merge branch 'MDL-39761-MOODLE_24_STABLE' of https://github.com/lucisgit/moodle into MOODLE_24_STABLE 2013-06-17 14:26:13 +12:00
Sam Hemelryk bea68c50d6 MDL-40142 navigation: fixed chainable issue with navigation JS 2013-06-17 09:15:20 +12:00
Mary Evans 288ab0b16c MDL-28124 admin/tool/customlang: Changed page layout from 'standard' to 'report'. 2013-06-15 00:12:01 +01:00
Mohamed Alsharaf 4978c2ae05 MDL-40091 book: revision must be incremented after editing a chapter 2013-06-14 21:27:09 +12:00
Marina Glancy f5dd4b478c weekly release 2.4.4+ 2013-06-14 13:49:30 +10:00
Andrew Nicols bcdda24942 MDL-40165 Backup: Split out test classes into multiple files 2013-06-13 08:58:02 +01:00
Dan Poltawski 8c12e634ea Revert "MDL-39832 Files: Revert MDL-39688 commit, 7c742620d26bdba53e136fda293d33b5271ce241"
This reverts commit 6c227b64e2.
2013-06-13 13:57:32 +08:00
Dan Poltawski 433222d6c0 Revert "MDL-39832 Files: Fixed ETag format according with RFC2616."
This reverts commit 20043f4392.
2013-06-13 13:57:30 +08:00
Russell Smith d39e66a6cd MDL-21933 course: Allow users to search participants course permission
Capability checks are performed at the top of the page and do not need
to be completed again.

Search is an expected feature for users and it was confusion to only
appear after 3 pages.  This has been changed to enable search when
there are more records than are visible on the screen.  If users
are unable to use browser search, they will be able to use Moodle's
search.
2013-06-13 12:44:17 +10:00
Mary Evans bce7ef0bd5 MDL-30312 User: Changed page layout from mydashboard to mypublic in user/profile.php 2013-06-12 21:27:17 +01:00
Dan Poltawski 6e74e428af Merge branch 'MDL-39472-m24' of git://github.com/sammarshallou/moodle into MOODLE_24_STABLE 2013-06-12 14:16:43 +08:00
Sam Hemelryk 0ad16081a2 Merge branch 'MDL-39964-24' of git://github.com/danpoltawski/moodle into MOODLE_24_STABLE 2013-06-12 09:02:27 +12:00
Sam Hemelryk 8fd47854a6 Merge branch 'MDL-25901-24' of git://github.com/danpoltawski/moodle into MOODLE_24_STABLE 2013-06-12 09:00:01 +12:00
Dan Poltawski e7d8c56098 Merge branch 'wip-MDL-40100-m24' of git://github.com/samhemelryk/moodle into MOODLE_24_STABLE 2013-06-11 15:36:37 +08:00
Sam Hemelryk ffb486a996 Merge branch 'MDL-26925-24' of git://github.com/danpoltawski/moodle into MOODLE_24_STABLE 2013-06-11 17:31:24 +12:00
Sam Hemelryk 2a31efea1b Merge branch 'MDL-39505-migrate-file-backport_24' of git://github.com/mudrd8mz/moodle into MOODLE_24_STABLE 2013-06-11 17:16:15 +12:00
Sam Hemelryk c1dfb624bf Merge branch 'MDL-22390_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-06-11 17:07:33 +12:00
Dan Poltawski 1ebac4eab3 Merge branch 'm24_MDL-40002_ETag_value_must_be_a_quoted-string' of https://github.com/scara/moodle into MOODLE_24_STABLE 2013-06-11 12:54:48 +08:00
Rajesh Taneja c5250462f6 MDL-39863 Administration: Show confirmation/notice and don't redirect automatically 2013-06-11 10:24:53 +08:00
Marina Glancy 351f4729e2 Merge branch 'MDL-39412_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-06-11 12:02:01 +10:00
Sam Hemelryk b26a15ff67 Merge branch 'MDL-39454-m24' of git://github.com/sammarshallou/moodle into MOODLE_24_STABLE 2013-06-11 12:26:42 +12:00
Matteo Scaramuccia f41aaa2551 MDL-40095 SCORM: Trivial comments tidy up 2013-06-10 21:05:05 +02:00
Matteo Scaramuccia dc44a83f83 MDL-40095 SCORM: Fixed DML error when saving with completion options locked
Regression caused by MDL-38315.
2013-06-10 21:04:54 +02:00
Dan Poltawski a3ad98f25d Merge branch 'MDL-39947_24' of https://github.com/aolley/moodle into MOODLE_24_STABLE 2013-06-10 16:20:45 +08:00
Dan Poltawski 9ab6e7d851 Merge branch 'm24_MDL-39832_Fix_Chrome_Issues_ETag_XSendfile' of https://github.com/scara/moodle into MOODLE_24_STABLE 2013-06-10 15:43:15 +08:00
Dan Poltawski 24e89189a7 Merge branch 'MDL-40018_M24' of git://github.com/lazydaisy/moodle into MOODLE_24_STABLE 2013-06-10 15:00:32 +08:00
David Mudrák 48919dba12 MDL-40080 Remove unused strings from the core_hub subsystem 2013-06-10 14:42:10 +08:00
David Monllao 3f7511f022 MDL-40109 format_weeks: Removing extra space 2013-06-10 13:31:54 +08:00
Dan Poltawski e4737333eb Merge branch 'MDL-39667-24' of git://github.com/FMCorz/moodle into MOODLE_24_STABLE 2013-06-10 12:51:44 +08:00
Dan Poltawski e9ec512875 Merge branch 'w24_MDL-28394_m24_enrolrestore' of git://github.com/skodak/moodle into MOODLE_24_STABLE 2013-06-10 12:17:14 +08:00
Dan Poltawski 60a6533433 Merge branch 'm24_MDL-37968' of git://github.com/danmarsden/moodle into MOODLE_24_STABLE 2013-06-10 12:10:15 +08:00
Sam Hemelryk 4fe8c2c799 Merge branch 'MDL-40009_m24' of https://github.com/markn86/moodle into MOODLE_24_STABLE 2013-06-10 15:54:52 +12:00
Sam Hemelryk 5dbb8b3909 Merge branch 'w24_MDL-39549_m24_cohortsearch' of git://github.com/skodak/moodle into MOODLE_24_STABLE 2013-06-10 15:47:49 +12:00
Sam Hemelryk e7b6fc35bf Merge branch 'MDL-39971_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-06-10 15:09:28 +12:00
Sam Hemelryk 1db4d513a7 Merge branch 'w24_MDL-32480_m24_imscp' of git://github.com/skodak/moodle into MOODLE_24_STABLE 2013-06-10 14:40:53 +12:00
Sam Hemelryk 4964633e3a Merge branch 'MDL-36090_log2_24' of git://github.com/andyjdavis/moodle into MOODLE_24_STABLE 2013-06-10 12:30:46 +12:00
Sam Hemelryk 5dc899f004 MDL-40100 cache: removed unneeded includes from add instance forms 2013-06-10 10:26:35 +12:00
Matteo Scaramuccia 8348ec06ea MDL-40002 Files: ETag value must be a quoted-string.
ETag value must be double quoted, http://tools.ietf.org/html/rfc2616#section-3.11.
More details about potential impacts in MDL-39832: shortly, at least when using
HTTP Partial GET Requests (HTTP Status: 206) plus X-Sendfile HTTP Header.
In this commit, the impact is to be RFC2616 compliant when using the ETag Header.
2013-06-09 10:19:03 +02:00
Tim Hunt d80b2c736e MDL-22390 autolink filter: handle URLs in brackets better.
This breaks some legitimate URLs like
http://en.wikipedia.org/wiki/Slash_(punctuation).
This is a necessary trade-off. Many other web systems do not handle that
case correctly either. The work-around it so escape the ) as %29.

This commit also improves the way the unit tests for this work.

It also fixes a couple of other tricky cases that were spotted in
the forums while this was being discussed. See the new test cases.
2013-06-08 16:55:00 +01:00
Petr Škoda 69d963254e MDL-39549 fix cohort search in course categories 2013-06-07 22:08:50 +02:00
Petr Škoda 24c954c181 MDL-28394 fix enrolment method restore logic
This patch fixes:
* missing enrolment methods after 1.9 backup restore - defaults are added
* enrolment methods are restored only when users option is enabled
* manual enrolment override option is disabled if users not available
2013-06-07 10:04:06 +02:00
Petr Škoda 1cf70434e2 MDL-32480 allow external https links in IMSCP too 2013-06-07 09:59:50 +02:00
Nicolas Dunand 0454409240 MDL-32480 fix display of IMS content packages with external links 2013-06-07 09:59:49 +02:00
Dan Marsden 13cea3d030 MDL-37968 course_overview: add dim class to hidden courses for teachers. 2013-06-07 14:40:01 +12:00
Matteo Scaramuccia 20043f4392 MDL-39832 Files: Fixed ETag format according with RFC2616.
ETag must be double quoted,
http://tools.ietf.org/html/rfc2616#section-3.11:

      entity-tag = [ weak ] opaque-tag
      weak       = "W/"
      opaque-tag = quoted-string
2013-06-06 23:09:46 +02:00
Matteo Scaramuccia 6c227b64e2 MDL-39832 Files: Revert MDL-39688 commit, 7c742620d2
MDL-39688 has been successful in providing a solution for the issue but further
investigations done in MDL-39832 have got the evidence that the given solution
is more likely a workaround.
2013-06-06 23:09:45 +02:00
Petr Škoda d4eb62d66b MDL-37780 fix 1.9 restore on windows 2013-06-06 12:26:29 +02:00
Dan Poltawski 031e2352da MDL-26925 User selector: Set label when no results
Thanks to Jonathon Fowler for the fix!
2013-06-06 14:09:59 +08:00
Frederic Massart 29c2cafaee MDL-40036 user: Respect capability to ignore user quota 2013-06-06 12:43:10 +08:00
Dan Poltawski 6c413970b7 weekly release 2.4.4+ 2013-06-06 12:00:38 +08:00
Dan Poltawski 60fcc78c1f Merge branch 'install_24_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_24_STABLE 2013-06-06 11:55:29 +08:00
Dan Poltawski 91f07e7e8b MDL-25901 rss: do not copyright html tag
They copyright field does not permit html, it should be plain text
2013-06-06 11:30:50 +08:00
Eloy Lafuente (stronk7) 520f292699 Merge branch 'wip-MDL-21097-m24' of git://github.com/marinaglancy/moodle into MOODLE_24_STABLE 2013-06-05 10:36:31 +02:00
Marina Glancy 82f43805fe MDL-21097 Correctly check capabilities for frontpage editing mode 2013-06-05 18:07:43 +10:00
Dan Poltawski cbb612d2bf MDL-39964 report_progress: don't browser sniff for SVG support
Use feature detection, its more robust and better practice.
2013-06-05 15:40:55 +08:00
Dan Poltawski 64a21db766 Merge branch 'wip-MDL-21097-m24' of git://github.com/marinaglancy/moodle into MOODLE_24_STABLE 2013-06-05 13:10:46 +08:00
Marina Glancy 84031db72b MDL-21097 corrected course editing roles 2013-06-05 14:25:13 +10:00
Andrew Davis 4dd5ce20ff MDL-36090 core_grade: added logging of overriding of student grades 2013-06-05 08:58:16 +08:00
Eloy Lafuente (stronk7) 960a321544 Merge branch 'mdl24-MDL-39409-auth-cas-use-moodle-web-proxy' of https://github.com/brki/moodle into MOODLE_24_STABLE 2013-06-05 02:46:40 +02:00
Eloy Lafuente (stronk7) 13c6a81607 Merge branch 'w23_MDL-39416_m24_pagelog' of git://github.com/skodak/moodle into MOODLE_24_STABLE 2013-06-05 02:43:59 +02:00
Eloy Lafuente (stronk7) f078a515c7 Merge branch 'MDL-38731-24' of git://github.com/danpoltawski/moodle into MOODLE_24_STABLE 2013-06-05 02:31:04 +02:00
Eloy Lafuente (stronk7) 58d9daa435 Merge branch 'MDL-37332-24' of git://github.com/danpoltawski/moodle into MOODLE_24_STABLE 2013-06-05 02:27:41 +02:00
Eloy Lafuente (stronk7) 416b9b3803 Merge branch 'm24_MDL-38545_PHP_Strict_error' of https://github.com/scara/moodle into MOODLE_24_STABLE 2013-06-05 02:23:21 +02:00
Eloy Lafuente (stronk7) b0237a093f Merge branch 'wip-MDL-21097-m24' of git://github.com/marinaglancy/moodle into MOODLE_24_STABLE 2013-06-05 01:43:25 +02:00
Mary Evans b9cdd1150e MDL-40018 theme_sky_high: Fixed footer in admin pages. 2013-06-05 00:20:56 +01:00
Mark Nelson 118242be26 MDL-40009 notes: corrected the form element names passed to setType 2013-06-04 18:08:50 +08:00
Dan Poltawski 7165b1586f Merge branch 'MDL-39945_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-06-04 15:54:12 +08:00
Dan Poltawski 09b91f0fff Merge branch 'MDL-39835_M24' of github.com:lazydaisy/moodle into MOODLE_24_STABLE 2013-06-04 14:45:09 +08:00
Dan Poltawski d000c1a380 Merge branch 'MDL-39536-24' of git://github.com/FMCorz/moodle into MOODLE_24_STABLE 2013-06-04 13:20:56 +08:00
Frederic Massart e4ddfbe0f8 MDL-39536 completion: Unit tests for get_activities and has_activities 2013-06-04 12:57:53 +08:00
Frederic Massart 25f9cba3d2 MDL-39536 completion: Prevent DB call when fetching activities 2013-06-04 12:57:53 +08:00
David Mudrák b9e16a5137 MDL-39939 Fix the basic SCORM report plugin name 2013-06-04 12:27:51 +08:00
Dan Poltawski 4802b1ed8e Merge branch 'MDL-39317-24' of git://github.com/damyon/moodle into MOODLE_24_STABLE 2013-06-04 11:26:45 +08:00
Dan Poltawski 0dc499ec7f Merge branch 'MDL-39743-24' of git://github.com/damyon/moodle into MOODLE_24_STABLE 2013-06-04 11:03:55 +08:00
Dan Poltawski 4c8664099e Merge branch 'wip_24_mdl-34085' of https://github.com/iarenaza/moodle into MOODLE_24_STABLE 2013-06-04 10:43:18 +08:00
AMOS bot d86662e14e Automatically generated installer lang files 2013-06-04 00:46:36 +00:00
Marina Glancy fc97a877fd MDL-39801 navigation_node::remove does not allow to insert nodes afterwards 2013-06-04 02:03:31 +02:00
Marina Glancy d60d1d0db8 MDL-39801 navigation_node::remove fails if first child does not have a key 2013-06-04 02:03:24 +02:00
Eloy Lafuente (stronk7) 4746dc557a MDL-39764 style: phpdoc changed to inline comments 2013-06-04 01:44:20 +02:00
Eloy Lafuente (stronk7) b4a8c66cca Merge branch 'wip-MDL-39764_M24_3' of git://github.com/gjb2048/moodle into MOODLE_24_STABLE 2013-06-04 01:44:11 +02:00
Gareth J Barnard b0997b27fc MDL-39764 course_format: Allow courses to have numsections > maxsections. 2013-06-03 23:57:52 +01:00
Eloy Lafuente (stronk7) d4ef1bbbcf MDL-39465 Show env. info instead of part twice. 2013-06-04 00:51:04 +02:00
Eloy Lafuente (stronk7) 771b35c6fe Merge branch 'w23_MDL-39465_m24_environment' of git://github.com/skodak/moodle into MOODLE_24_STABLE 2013-06-04 00:01:16 +02:00
Eloy Lafuente (stronk7) 613b32bbb8 Merge branch 'MDL-39166-m24' of https://github.com/jfilip/moodle into MOODLE_24_STABLE 2013-06-03 23:55:41 +02:00
Eloy Lafuente (stronk7) 813db77aa2 Merge branch 'wip-MDL-39710-m24' of git://github.com/marinaglancy/moodle into MOODLE_24_STABLE 2013-06-03 23:22:44 +02:00
Eloy Lafuente (stronk7) e4c30d9639 Merge branch 'MDL-39932_24' of git://github.com/grabs/moodle into MOODLE_24_STABLE 2013-06-03 19:10:55 +02:00
Eloy Lafuente (stronk7) 954e384783 Merge branch 'MDL-39487_24' of https://github.com/IOC/moodle into MOODLE_24_STABLE 2013-06-03 19:03:38 +02:00
Petr Škoda d1bb51aaad MDL-39416 do not try to get detailed perflog info before PAGE int 2013-06-02 13:30:02 +02:00
Mary Evans 4db0ad5756 MDL-39835 theme_sky_high: Fix for footer to display correctly in higher resolutions. 2013-06-01 22:02:37 +01:00
Petr Škoda 29b18e6c68 MDL-39465 detect environment problems in tests
This should help explain why something else fails.
2013-05-31 22:04:02 +02:00
Tim Hunt 93cf55eb72 MDL-39971 each attempt builds on last broken for previews. 2013-05-31 20:33:38 +01:00
Marina Glancy 8069eac74b MDL-39710 Don't display rubric and guide preview unless option checked 2013-05-31 16:09:21 +10:00
Russell Boyatt 74d4a8e314 Fixing MDL-39710: setting to limit student access to rubric now checked. 2013-05-31 16:06:42 +10:00
Dan Poltawski 8228d7a653 MDL-38731 course: split course group settings header
Allow translators to translate the heading differently.

AMOS BEGIN
  CPY [groups,group],[groupsettingsheader,group]
AMOS END

Conflicts:
	course/edit_form.php
2013-05-31 12:14:19 +08:00
Dan Poltawski 9e5d7687e3 MDL-37332 portfolio: don't add double slashes
get_filepath() always returns trailing slash.

This breaks windows export - thanks to Jason Platts
2013-05-31 11:52:57 +08:00
Marina Glancy db13f65136 MDL-21097 Correctly check capabilities for course settings items
- Make sure that items in course settings (and frontpage settings) are shown depending on user capabilities
- Make sure user is able to turn editing on on the page even if he has only limited number of seciton/modules capabilities
2013-05-31 13:21:03 +10:00
Frederic Massart 734581a35e MDL-39650 form: Type can be set on repeated elements in a group 2013-05-31 11:05:08 +08:00
Dan Poltawski 20431aacf8 MDL-33562 lib: remove deleted user tokens 2013-05-31 10:28:29 +08:00
Dan Poltawski 27bab164f2 MDL-33562 lib: remove private keys when user deleted 2013-05-31 10:27:01 +08:00
AMOS bot 48dedbe914 Automatically generated installer lang files 2013-05-31 00:43:09 +00:00
Adam Olley 752fb7113d MDL-39947 mod_forum: Add safety check to variable assignment when counting unread posts 2013-05-31 09:50:35 +09:30
Andreas Grabs a33fc4907e MDL-39932 mod_feedback - Mapping Feedback when Course is Deleted - thx to David N. Johnson 2013-05-30 23:12:54 +02:00
Tim Hunt c0f5255cb9 MDL-39945 qtype multichoice was not comparing blank responses correctly. 2013-05-30 19:47:58 +01:00
Iñaki Arenaza aefa1b0e3e MDL-34085 Fix the backup options names in core_course_duplicate_course
Fix the option names to match those used by the backup subsystem.
2013-05-30 17:49:07 +02:00
Damyon Wiese ae61eea349 weekly release 2.4.4+ 2013-05-30 12:09:01 +08:00
Damyon Wiese b78cd7b0c9 Merge branch 'install_24_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_24_STABLE 2013-05-30 11:27:20 +08:00
AMOS bot 8574fb6f41 Automatically generated installer lang files 2013-05-30 00:38:23 +00:00
William Tam 5f11ce035d MDL-37804 mod/assign: Students no longer able to submit files after due date with Prevent late submissions turned on. 2013-05-29 13:30:41 -07:00
Damyon Wiese 7bf288a640 MDL-39317 assign: Fix for submitted filter on grading table.
Some old upgraded assignments have no timecreated column so use
a different one to check for a valid submission.
2013-05-29 14:50:48 +08:00
Ashley Holman 24a3f392ba MDL-39743 assign: Fix missing capability check for "grant extension"
Conflicts:

	mod/assign/locallib.php
2013-05-29 12:08:40 +08:00
AMOS bot 7500249a74 Automatically generated installer lang files 2013-05-29 00:39:23 +00:00
Eloy Lafuente (stronk7) 847f1dd489 Merge branch 'w22_MDL-39676_m24_whereparam' of git://github.com/skodak/moodle into MOODLE_24_STABLE 2013-05-28 15:34:13 +02:00
Jason Fowler fce7fd554c MDL-38347 - Calendar - Fixing arrow output on Android devices 2013-05-28 15:26:36 +08:00
Petr Škoda d04e51bd18 MDL-39802 ignore deleted users in meta enrolments 2013-05-28 10:05:15 +08:00
Petr Škoda 6134a1f844 MDL-39802 ignore deleted users in cohort enrolments 2013-05-28 10:05:11 +08:00
Petr Škoda 5ffd03ea74 MDL-39802 ignore deleted users in category enrolments 2013-05-28 10:05:08 +08:00
Damyon Wiese 4fffc06f65 Merge branch 'w22_MDL-39802_m24_deletedusers' of git://github.com/skodak/moodle into MOODLE_24_STABLE 2013-05-28 09:55:50 +08:00
AMOS bot 48f747b8da Automatically generated installer lang files 2013-05-28 00:38:16 +00:00
Eloy Lafuente (stronk7) c8b05c3e83 Merge branch 'wip-MDL-39456-m24' of git://github.com/samhemelryk/moodle into MOODLE_24_STABLE 2013-05-28 01:02:49 +02:00
Damyon Wiese 1deb9c4d18 Merge branch 'MDL-39640-24' of git://github.com/FMCorz/moodle into MOODLE_24_STABLE 2013-05-27 16:16:45 +08:00
Dan Poltawski b3ae0c52bf Merge branch 'MDL-38239-moodle24' of git://github.com/StudiUM/moodle into MOODLE_24_STABLE 2013-05-27 14:13:52 +08:00
Dan Poltawski a67482cb0e Merge branch 'w22_MDL-39688_m24_etag' of git://github.com/skodak/moodle into MOODLE_24_STABLE 2013-05-27 13:43:45 +08:00
Petr Škoda cd9dab04b9 MDL-38408 validate PayPal dates and costs always 2013-05-25 22:16:45 +02:00
Petr Škoda 829b842997 MDL-39676 improve get_role_users() unit tests 2013-05-25 10:13:26 +02:00
Petr Škoda 02338685a8 MDL-39676 fix get_role_users() parameter typo 2013-05-25 09:31:29 +02:00
Petr Škoda 7c742620d2 MDL-39688 do not set Etag when sending http ranges 2013-05-25 09:12:51 +02:00
Petr Škoda 7934b786a9 MDL-39802 fix sloppy user deleting and creating in imsenterprise plugin 2013-05-24 21:18:23 +02:00
Petr Škoda 43b13e92b8 MDL-39802 add cli script for fixing of all deleted users
Use this script if something just set the user.deleted flag instead of calling the delete_user() method.
2013-05-24 21:18:22 +02:00
Damyon Wiese bf2bee168a weekly release 2.4.4+ 2013-05-24 13:25:45 +08:00
Damyon Wiese 5c9ce5a281 Merge branch 'install_24_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_24_STABLE 2013-05-24 13:11:49 +08:00
Sam Hemelryk 89ad278957 MDL-39456 cachestore_file: added reference to global $CFG
By holding onto a reference of the global $CFG object we
can be sure that it isn't destroyed before we are done
with it.
This allows for caches to be used within destructors for
purposes such as delayed writes.
2013-05-24 09:51:06 +12:00
Eloy Lafuente (stronk7) a3106cf3eb Merge branch 'wip-MDL-39177-m24' of git://github.com/marinaglancy/moodle into MOODLE_24_STABLE 2013-05-23 16:00:16 +02:00
Marina Glancy 58c28d44e0 MDL-39177 make sure we don't remove existing directories when cleaning up unzip 2013-05-23 19:19:05 +10:00
Sam Hemelryk 1fdba7b992 MDL-39673 css: removed unused chunk array search
Cherry-picked from MDL-39326
2013-05-23 13:20:28 +08:00
Sam Hemelryk f8e60e04b9 MDL-39673 css: no passed the no svg key to chunking when required
Cherry-picked from MDL-39326
2013-05-23 13:20:28 +08:00
Sam Hemelryk 713b818c40 MDL-39673 css: implemented chunking of large sheets
Cherry-picked from MDL-38441
2013-05-23 13:20:06 +08:00
AMOS bot 038fd6e78f Automatically generated installer lang files 2013-05-22 08:26:05 +00:00
Eloy Lafuente (stronk7) 4453f3255f MDL-36482 Fix slipped error, thanks Petr! 2013-05-22 04:13:53 +02:00
Eloy Lafuente (stronk7) be06282e1b Merge branch 'wip-MDL-39177-m24' of git://github.com/marinaglancy/moodle into MOODLE_24_STABLE 2013-05-22 02:19:40 +02:00
Gilles-Philippe Leblanc e60224a32a MDL-38239 gradebook: Importing grades from a .txt file with commas for decimals causes an error 2013-05-21 14:13:16 -04:00
Marina Glancy 0733e9883a MDL-39177 Updating userid when file is overwritten 2013-05-21 10:50:52 +10:00
Eloy Lafuente (stronk7) ec01b3201d Merge branch 'MDL-36482_24' of https://github.com/mr-russ/moodle into MOODLE_24_STABLE 2013-05-21 02:28:20 +02:00
Eloy Lafuente (stronk7) 5efc195a32 Merge branch 'MDL-26120_24' of https://github.com/jacks92/moodle into MOODLE_24_STABLE 2013-05-21 00:55:27 +02:00
Eloy Lafuente (stronk7) f0697b7088 Merge branch 'MDL-31209-24' of git://github.com/mouneyrac/moodle into MOODLE_24_STABLE 2013-05-20 19:05:31 +02:00
Ruslan Kabalin 8a06e21c2a MDL-39761: mod_assign: Always check submission plugin status and visibility. 2013-05-20 16:45:43 +01:00
Damyon Wiese 17bca7a2b9 MDL-39412 Prevent developer warnings on upgrade from 24 to master 2013-05-20 12:42:55 +01:00
Tim Hunt c22a0ad980 MDL-39412 disabling manual graded behaviour refinements
1. Change behaviour admin settings so you can only select enabled
behaviours.
2. During the upgrade, change admin settings that might be currently set
to manual graded, so that instead they are set to deferredfeedback (if
that is available. If not, we just take the first alphabetically.)
2013-05-20 12:42:15 +01:00
Tim Hunt 617947c0b7 MDL-39412 question behaviours: hide manual graded option
The ability to set all your quiz questions to require manual grading is
an interesting possibility, but practically almost useless.

If you set that accidentally, then you are badly stuck. There is no way
to fix it after the students have answered the quiz.

Therefore, we should set the config option to hide that option from the
UI. We do this for all Moodle sites as part of the upgrade, not just for
new installs.

If any admin wants to re-enable this, they can later.
2013-05-20 12:26:06 +01:00
Dan Poltawski fad64c0d6b Merge branch 'w18_MDL-39374_m24_folderlog' of git://github.com/skodak/moodle into MOODLE_24_STABLE 2013-05-20 17:58:41 +08:00
Dan Poltawski 8fedda2fc4 Merge branch 'MDL-35859_idnumber_24' of https://github.com/andyjdavis/moodle into MOODLE_24_STABLE 2013-05-20 16:39:04 +08:00
Damyon Wiese b27636c4db Merge branch 'MDL-38498-24' of git://github.com/FMCorz/moodle into MOODLE_24_STABLE 2013-05-20 16:13:15 +08:00
Frederic Massart 0db0bcd60b MDL-38498 repository: Unit tests for repository::check_capability()
Conflicts:

	repository/tests/repository_test.php
2013-05-20 16:03:11 +08:00
Dan Poltawski 133defa353 Merge branch 'MDL-27748_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-05-20 15:47:34 +08:00
Dan Poltawski de78a8b251 Merge branch 'MDL-39728_24' of git://github.com/timhunt/moodle into MOODLE_24_STABLE 2013-05-20 15:29:13 +08:00
Troy Lee 6b3ca4dd2c MDL-36020 overview/report: fix quiz regrade session lock 2013-05-20 12:42:47 +08:00
Damyon Wiese 512f5d9086 Merge branch 'MDL-39363-m24' of git://github.com/ankitagarwal/moodle into MOODLE_24_STABLE 2013-05-20 12:14:35 +08:00
Dan Poltawski dfd948b0f0 Merge branch 'MDL-39198_M24' of git://github.com/kordan/moodle into MOODLE_24_STABLE 2013-05-20 11:48:33 +08:00
Dan Poltawski 6336c04705 Merge branch 'MDL-38369-24' of git://github.com/FMCorz/moodle into MOODLE_24_STABLE 2013-05-20 10:25:52 +08:00
Tim Hunt 0377e4fbc9 MDL-27748 question: grade options should be localised.
question_bank::fraction_options should use format_float to display
decimal pionts correctly.
2013-05-19 23:45:48 +01:00
Tim Hunt 18d5870e8b MDL-39728 List all the classes in question/type/questionbase.php
This should make it easier for people to understand the type hierarchy.
2013-05-18 09:25:17 +01:00
AMOS bot d55eadbc92 Automatically generated installer lang files 2013-05-18 00:41:35 +00:00
Damyon Wiese a1972f5717 Merge branch 'MDL-28250-24' of git://github.com/danpoltawski/moodle into MOODLE_24_STABLE 2013-05-17 11:49:08 +08:00
Petr Škoda 0571a6856d MDL-39678 fix YUI 20130515 vulnerability 2013-05-15 22:00:10 +02:00
Petr Škoda 3c61d125c4 MDL-39374 log only real folder edits
Credit goes to Florian Zillner, thanks.
2013-05-15 21:37:25 +02:00
Dan Poltawski 8fec03bc81 MDL-28250 license: upgrade old versions of cc-nc
The url was incorectly defined in previous versions
2013-05-15 11:24:53 +01:00
Wojciech Galiszek ef5ec161ee MDL-28250 license: Correct cc-nc url 2013-05-15 11:22:56 +01:00
AMOS bot 167c498cc8 Automatically generated installer lang files 2013-05-15 00:39:22 +00:00
Frederic Massart 235aa1b1d1 MDL-39667 repository: Correct check for uniqueness of the name 2013-05-14 16:29:20 +08:00
Jerome Mouneyrac 4205983fad MDL-31209 web service error message: Indication about the service not containg the web service function is confusing 2013-05-14 15:44:32 +08:00
Marina Glancy 0408edbb13 MDL-39177 More comments about confusing files.source field 2013-05-14 17:05:40 +10:00
Marina Glancy fb69297c66 MDL-39177 Ensure files are overwritten correctly on unzip 2013-05-14 17:05:40 +10:00
Marina Glancy 3557f63112 MDL-39177 Perform all checks on draftfile area before saving the files 2013-05-14 17:05:40 +10:00
Marina Glancy bb597bbc1a MDL-39177 Remove code duplication 2013-05-14 17:05:39 +10:00
Marina Glancy 73e7cca3c2 MDL-39177 Update file in filearea only if original is present
Now when file was deleted in filemanager and new file with the same file was uploaded the references will be converted to copies exactly like UI warns in filemanager.
Also do not delete original information from draftfiles.
2013-05-14 17:05:39 +10:00
Marina Glancy 949a68d987 MDL-39177 Discard file origin when moving/renaming a file in filemanager
Created one function that handles file update to be used from both JS and nonJS filepicker
2013-05-14 17:05:39 +10:00
Marina Glancy 7a73b806c3 MDL-39177 Original info is not preserved when overwriting a file in filemanager
original file location is used by filemanager to indicate that file is a source of reference and file the list of referencing files
2013-05-14 17:05:39 +10:00
Marina Glancy eb30de6812 MDL-39177 File reference is not updated when overwriting the file 2013-05-14 17:05:38 +10:00
Marina Glancy 313b6da1b2 MDL-33719 When overwriting a file the filemanager is not refreshed 2013-05-14 17:04:34 +10:00
AMOS bot bcd8c30b45 Automatically generated installer lang files 2013-05-14 00:37:45 +00:00
Frederic Massart fbe50c0945 MDL-39640 repository: Prevent notice when editing an instance 2013-05-13 17:31:29 +08:00
Ankit Agarwal a87523d86e MDL-39363 scorm: Accept 0 as a valid score 2013-05-13 11:49:12 +08:00
Andrew Davis f34634eaf3 MDL-35859 core_grade:fixed an optional parameter call to use the array version 2013-05-13 09:53:24 +08:00
Frederic Massart 84d356f73c MDL-39280 form: Multiple select support disabledIf with multiple values 2013-05-10 09:36:45 +08:00
Kordan 6642c7d756 MDL-39198 theme_formal_white: resized and relocated the "Add..." drop down menu of the "Add a block" pseudo block 2013-05-09 14:02:54 +02:00
Russell Smith cd8f8a8cb5 MDL-36482 activities block: Allow mod display without intro's 2013-05-09 09:59:41 +10:00
Jayesh Anandani c2fd66ab6e MDL-26120_24 mod_forum: use correct object 2013-05-08 23:50:58 +05:30
Juan Leyva 3cba96e344 MDL-39563 Fixing mobilecssurl is not being returned in WebService get_siteinfo 2013-05-08 12:08:06 +02:00
sam marshall e5bc3e3dde MDL-39472 MUC: Optimise cache::get_from_persist_cache 2013-05-08 10:17:58 +01:00
Albert Gasset 2fc7799975 MDL-39487 mod/assign: fixed ID number of grade item changing 2013-05-03 11:08:19 +02:00
sam marshall 02d61e0481 MDL-39454 Accesslib: is_siteadmin is a bit slow 2013-05-02 10:47:21 +01:00
Frederic Massart a67e827913 MDL-38369 repository: Remove output before redirect 2013-05-02 12:03:56 +08:00
Brian King a7fce60867 MDL-39409 auth/cas pass web proxy settings along to phpCAS 2013-04-29 17:51:43 +02:00
Justin Filip 61c9217b2a MDL-39166 auth_ldap Add triggers for user created/updated events. 2013-04-24 16:16:39 -04:00
prateeksachan 004f868825 MDL-38794 passed overflowdiv parameter 2013-04-17 20:36:28 +05:30
Matteo Scaramuccia 5c2a800bfa MDL-38545 Reports: PHP Strict Standards error in graph.php 2013-04-02 22:12:47 +02:00
605 changed files with 14938 additions and 5810 deletions
+91
View File
@@ -0,0 +1,91 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This script fixed incorrectly deleted users.
*
* @package core
* @subpackage cli
* @copyright 2013 Petr Skoda (http://skodak.org)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define('CLI_SCRIPT', true);
require(__DIR__.'/../../config.php');
require_once($CFG->libdir.'/clilib.php');
// Now get cli options.
list($options, $unrecognized) = cli_get_params(array('help'=>false),
array('h'=>'help'));
if ($unrecognized) {
$unrecognized = implode("\n ", $unrecognized);
cli_error(get_string('cliunknowoption', 'admin', $unrecognized));
}
if ($options['help']) {
$help =
"Fix incorrectly deleted users.
This scripts detects users that are marked as deleted instead
of calling delete_user().
Deleted users do not have original username, idnumber or email,
we must also delete all roles, enrolments, group memberships, etc.
Please note this script does not delete any public information
such as forum posts.
Options:
-h, --help Print out this help
Example:
\$sudo -u www-data /usr/bin/php admin/cli/fix_deleted_users.php
";
echo $help;
die;
}
cli_heading('Looking for sloppy user deletes');
// Look for sloppy deleted users where somebody only flipped the deleted flag.
$sql = "SELECT *
FROM {user}
WHERE deleted = 1 AND email LIKE '%@%' AND username NOT LIKE '%@%'";
$rs = $DB->get_recordset_sql($sql);
foreach ($rs as $user) {
echo "Redeleting user $user->id: $user->username ($user->email)\n";
delete_user($user);
}
cli_heading('Deleting all leftovers');
$DB->set_field('user', 'idnumber', '', array('deleted'=>1));
$DB->delete_records_select('role_assignments', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
$DB->delete_records_select('cohort_members', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
$DB->delete_records_select('groups_members', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
$DB->delete_records_select('user_enrolments', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
$DB->delete_records_select('user_preferences', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
$DB->delete_records_select('user_info_data', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
$DB->delete_records_select('user_lastaccess', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
$DB->delete_records_select('external_tokens', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
$DB->delete_records_select('external_services_users', "userid IN (SELECT id FROM {user} WHERE deleted = 1)");
exit(0);
+115
View File
@@ -892,4 +892,119 @@
</PHP_SETTING>
</PHP_SETTINGS>
</MOODLE>
<MOODLE version="2.6" requires="2.2">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mysql" version="5.1.33" />
<VENDOR name="postgres" version="8.3" />
<VENDOR name="mssql" version="9.0" />
<VENDOR name="oracle" version="10.2" />
</DATABASE>
<PHP version="5.3.3" level="required">
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
<ON_CHECK message="pcreunicodewarning" />
</FEEDBACK>
</PCREUNICODE>
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="required">
<FEEDBACK>
<ON_ERROR message="iconvrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="optional">
<FEEDBACK>
<ON_CHECK message="mbstringrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="required">
<FEEDBACK>
<ON_ERROR message="curlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="optional">
<FEEDBACK>
<ON_CHECK message="opensslrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="tokenizer" level="optional">
<FEEDBACK>
<ON_CHECK message="tokenizerrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="xmlrpc" level="optional">
<FEEDBACK>
<ON_CHECK message="xmlrpcrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="soap" level="optional">
<FEEDBACK>
<ON_CHECK message="soaprecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="ctype" level="required">
<FEEDBACK>
<ON_ERROR message="ctyperequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zip" level="required">
<FEEDBACK>
<ON_ERROR message="ziprequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zlib" level="optional">
</PHP_EXTENSION>
<PHP_EXTENSION name="gd" level="required">
<FEEDBACK>
<ON_ERROR message="gdrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="simplexml" level="required">
<FEEDBACK>
<ON_ERROR message="simplexmlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="spl" level="required">
<FEEDBACK>
<ON_ERROR message="splrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="pcre" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="dom" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xml" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="intl" level="optional">
<FEEDBACK>
<ON_CHECK message="intlrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="json" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="hash" level="required"/>
</PHP_EXTENSIONS>
<PHP_SETTINGS>
<PHP_SETTING name="memory_limit" value="64M" level="required">
<FEEDBACK>
<ON_ERROR message="settingmemorylimit" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="safe_mode" value="0" level="optional">
<FEEDBACK>
<ON_CHECK message="settingsafemode" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="file_uploads" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="settingfileuploads" />
</FEEDBACK>
</PHP_SETTING>
</PHP_SETTINGS>
</MOODLE>
</COMPATIBILITY_MATRIX>
+30 -30
View File
@@ -27,37 +27,37 @@ require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
$confirm = optional_param('confirm', 0, PARAM_BOOL);
$returnurl = optional_param('returnurl', null, PARAM_LOCALURL);
// If we have got here as a confirmed aciton, do it.
if ($confirm && isloggedin() && confirm_sesskey()) {
require_capability('moodle/site:config', context_system::instance());
// Valid request. Purge, and redirect the user back to where they came from.
purge_all_caches();
if ($returnurl) {
$returnurl = $CFG->wwwroot . $returnurl;
} else {
$returnurl = new moodle_url('/admin/purgecaches.php');
}
redirect($returnurl, get_string('purgecachesfinished', 'admin'));
}
// Otherwise, show a button to actually purge the caches.
admin_externalpage_setup('purgecaches');
require_login();
require_capability('moodle/site:config', context_system::instance());
if ($confirm) {
require_sesskey();
// Valid request. Purge, and redisplay the form so it is easy to purge again
// in the near future.
purge_all_caches();
redirect(new moodle_url('/admin/purgecaches.php'), get_string('purgecachesfinished', 'admin'));
} else {
// Show a confirm form.
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('purgecaches', 'admin'));
$url = new moodle_url('/admin/purgecaches.php', array('sesskey'=>sesskey(), 'confirm'=>1));
$button = new single_button($url, get_string('purgecaches','admin'), 'post');
// Cancel button takes them back to the page the were on, if possible,
// otherwise to the site home page.
$return = new moodle_url('/');
if (isset($_SERVER['HTTP_REFERER']) and !empty($_SERVER['HTTP_REFERER'])) {
if ($_SERVER['HTTP_REFERER'] !== "$CFG->wwwroot/$CFG->admin/purgecaches.php") {
$return = $_SERVER['HTTP_REFERER'];
}
}
echo $OUTPUT->confirm(get_string('purgecachesconfirm', 'admin'), $button, $return);
echo $OUTPUT->footer();
$actionurl = new moodle_url('/admin/purgecaches.php', array('sesskey'=>sesskey(), 'confirm'=>1));
if ($returnurl) {
$actionurl->param('returnurl', $returnurl);
}
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('purgecaches', 'admin'));
echo $OUTPUT->box_start('generalbox', 'notice');
echo html_writer::tag('p', get_string('purgecachesconfirm', 'admin'));
echo $OUTPUT->single_button($actionurl, get_string('purgecaches', 'admin'), 'post');
echo $OUTPUT->box_end();
echo $OUTPUT->footer();
+3 -1
View File
@@ -918,9 +918,11 @@ class core_admin_renderer extends plugin_renderer_base {
} else {
$str = 'otherplugin';
}
$componenturl = new moodle_url('https://moodle.org/plugins/view.php?plugin='.$component);
$componenturl = html_writer::tag('a', $component, array('href' => $componenturl->out()));
$requires[] = html_writer::tag('li',
get_string($str, 'core_plugin',
array('component' => $component, 'version' => $requiredversion)),
array('component' => $componenturl, 'version' => $requiredversion)),
array('class' => $class));
}
+5 -3
View File
@@ -140,8 +140,10 @@ if (($action == 'edit') || ($action == 'new')) {
$success = $repositorytype->update_options($settings);
} else {
$type = new repository_type($plugin, (array)$fromform, $visible);
$type->create();
$success = true;
if (!$repoid = $type->create()) {
$success = false;
}
$data = data_submitted();
}
if ($success) {
@@ -286,9 +288,9 @@ if (($action == 'edit') || ($action == 'new')) {
// Get list of used plug-ins
$instances = repository::get_types();
// Array to store plugins being used
$alreadyplugins = array();
if (!empty($instances)) {
// Array to store plugins being used
$alreadyplugins = array();
$totalinstances = count($instances);
$updowncount = 1;
foreach ($instances as $i) {
+1 -1
View File
@@ -32,7 +32,7 @@ $lng = required_param('lng', PARAM_LANG);
$currentpage = optional_param('p', 0, PARAM_INT);
$translatorsubmitted = optional_param('translatorsubmitted', 0, PARAM_BOOL);
$PAGE->set_pagelayout('standard');
$PAGE->set_pagelayout('report'); // Allows for wide page contents.
$PAGE->set_url('/admin/tool/customlang/edit.php', array('lng' => $lng));
navigation_node::override_active_url(new moodle_url('/admin/tool/customlang/index.php'));
$PAGE->set_title(get_string('pluginname', 'tool_customlang'));
@@ -23,7 +23,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
$string['install'] = 'Install selected language pack';
$string['install'] = 'Install selected language pack(s)';
$string['installedlangs'] = 'Installed language packs';
$string['langimport'] = 'Language import utility';
$string['langimportdisabled'] = 'Language import feature has been disabled. You have to update your language packs manually at the file-system level. Do not forget to purge string caches after you do so.';
@@ -37,7 +37,7 @@ $string['missinglangparent'] = 'Missing parent language <em>{$a->parent}</em> of
$string['nolangupdateneeded'] = 'All your language packs are up to date, no update is needed';
$string['pluginname'] = 'Language packs';
$string['purgestringcaches'] = 'Purge string caches';
$string['remotelangnotavailable'] = 'Because Moodle can not connect to download.moodle.org, we are unable to do language pack installation automatically. Please download the appropriate zip file(s) from http://download.moodle.org, copy them to your {$a} directory and unzip them manually.';
$string['remotelangnotavailable'] = 'Because Moodle cannot connect to download.moodle.org, it is not possible for language packs to be installed automatically. Please download the appropriate ZIP file(s) from <a href="http://download.moodle.org/langpack/">download.moodle.org/langpack</a>, copy them to your {$a} directory and unzip them manually.';
$string['uninstall'] = 'Uninstall selected language pack';
$string['uninstallconfirm'] = 'You are about to completely uninstall language pack {$a}, are you sure?';
$string['updatelangs'] = 'Update all installed language packs';
+18 -4
View File
@@ -98,12 +98,16 @@ $STD_FIELDS = array('id', 'firstname', 'lastname', 'username', 'email',
$PRF_FIELDS = array();
if ($prof_fields = $DB->get_records('user_info_field')) {
foreach ($prof_fields as $prof_field) {
$PRF_FIELDS[] = 'profile_field_'.$prof_field->shortname;
if ($proffields = $DB->get_records('user_info_field')) {
foreach ($proffields as $key => $proffield) {
$profilefieldname = 'profile_field_'.$proffield->shortname;
$PRF_FIELDS[] = $profilefieldname;
// Re-index $proffields with key as shortname. This will be
// used while checking if profile data is key and needs to be converted (eg. menu profile field)
$proffields[$profilefieldname] = $proffield;
unset($proffields[$key]);
}
}
unset($prof_fields);
if (empty($iid)) {
$mform1 = new admin_uploaduser_form1();
@@ -331,6 +335,16 @@ if ($formdata = $mform2->is_cancelled()) {
if (isset($formdata->$field)) {
// process templates
$user->$field = uu_process_template($formdata->$field, $user);
// Form contains key and later code expects value.
// Convert key to value for required profile fields.
require_once($CFG->dirroot.'/user/profile/field/'.$proffields[$field]->datatype.'/field.class.php');
$profilefieldclass = 'profile_field_'.$proffields[$field]->datatype;
$profilefield = new $profilefieldclass($proffields[$field]->id);
if (method_exists($profilefield, 'convert_external_data')) {
$user->$field = $profilefield->edit_save_data_preprocess($user->$field, null);
}
$formdefaults[$field] = true;
}
}
+2 -2
View File
@@ -321,8 +321,8 @@ function uu_process_template_callback($username, $firstname, $lastname, $block)
* @return array type=>name
*/
function uu_supported_auths() {
// only following plugins are guaranteed to work properly
$whitelist = array('manual', 'nologin', 'none', 'email');
// Only the following plugins are guaranteed to work properly.
$whitelist = array('email', 'ldap', 'manual', 'nologin', 'none');
$plugins = get_enabled_auth_plugins();
$choices = array();
foreach ($plugins as $plugin) {
@@ -118,7 +118,8 @@ class create_xml_file extends XMLDBAction {
function get_plugin_type($dirpath) {
global $CFG;
$dirpath = $CFG->dirroot.$dirpath;
$plugintypes = get_plugin_types();
// Reverse order so that we get subplugin matches.
$plugintypes = array_reverse(get_plugin_types());
foreach ($plugintypes as $plugintype => $pluginbasedir) {
if (substr($dirpath, 0, strlen($pluginbasedir)) == $pluginbasedir) {
return $plugintype;
+28 -14
View File
@@ -33,24 +33,38 @@ $string['confirmdeleteindex'] = 'Are you absolutely sure that you want to delete
$string['confirmdeletekey'] = 'Are you absolutely sure that you want to delete the key:';
$string['confirmdeletetable'] = 'Are you absolutely sure that you want to delete the table:';
$string['confirmdeletexmlfile'] = 'Are you absolutely sure that you want to delete the file:';
$string['confirmcheckbigints'] = 'This functionality will search for <a href="http://tracker.moodle.org/browse/MDL-11038">potential wrong integer fields</a> in your Moodle server, generating (but not executing!) automatically the needed SQL statements to have all the integers in your DB properly defined.<br /><br />
Once generated you can copy such statements and execute them safely with your favourite SQL interface (don\'t forget to backup your data before doing that).<br /><br />
It\'s highly recommended to be running the latest (+ version) available of your Moodle release (1.8, 1.9, 2.x ...) before executing the search of wrong integers.<br /><br />
$string['confirmcheckbigints'] = 'This functionality will search for <a href="http://tracker.moodle.org/browse/MDL-11038">potential wrong integer fields</a> in your Moodle server, generating (but not executing!) automatically the needed SQL statements to have all the integers in your DB properly defined.
Once generated you can copy such statements and execute them safely with your favourite SQL interface (don\'t forget to backup your data before doing that).
It\'s highly recommended to be running the latest (+ version) available of your Moodle release before executing the search of wrong integers.
This functionality doesn\'t perform any action against the DB (just reads from it), so can be safely executed at any moment.';
$string['confirmcheckdefaults'] = 'This functionality will search for inconsistent default values in your Moodle server, generating (but not executing!) the needed SQL statements to have all the default values properly defined.<br /><br />
Once generated you can copy such statements and execute them safely with your favourite SQL interface (don\'t forget to backup your data before doing that).<br /><br />
It\'s highly recommended to be running the latest (+ version) available of your Moodle release (1.8, 1.9, 2.x ...) before executing the search of inconsistent default values.<br /><br />
$string['confirmcheckdefaults'] = 'This functionality will search for inconsistent default values in your Moodle server, generating (but not executing!) the needed SQL statements to have all the default values properly defined.
Once generated you can copy such statements and execute them safely with your favourite SQL interface (don\'t forget to backup your data before doing that).
It\'s highly recommended to be running the latest (+ version) available of your Moodle release before executing the search of inconsistent default values.
This functionality doesn\'t perform any action against the DB (just reads from it), so can be safely executed at any moment.';
$string['confirmcheckforeignkeys'] = 'This functionality will search for potential violations of the foreign keys defined in the install.xml definitions. (Moodle does not currently generate actual foreign key constraints in the database, which is why invalid data may be present.)<br /><br />
It\'s highly recommended to be running the latest (+ version) available of your Moodle release (1.8, 1.9, 2.x ...) before executing the search of missing indexes.<br /><br />
$string['confirmcheckforeignkeys'] = 'This functionality will search for potential violations of the foreign keys defined in the install.xml definitions. (Moodle does not currently generate actual foreign key constraints in the database, which is why invalid data may be present.)
It\'s highly recommended to be running the latest (+ version) available of your Moodle release before executing the search of missing indexes.
This functionality doesn\'t perform any action against the DB (just reads from it), so can be safely executed at any moment.';
$string['confirmcheckindexes'] = 'This functionality will search for potential missing indexes in your Moodle server, generating (but not executing!) automatically the needed SQL statements to keep everything updated.<br /><br />
Once generated you can copy such statements and execute them safely with your favourite SQL interface (don\'t forget to backup your data before doing that).<br /><br />
It\'s highly recommended to be running the latest (+ version) available of your Moodle release (1.8, 1.9, 2.x ...) before executing the search of missing indexes.<br /><br />
$string['confirmcheckindexes'] = 'This functionality will search for potential missing indexes in your Moodle server, generating (but not executing!) automatically the needed SQL statements to keep everything updated.
Once generated you can copy such statements and execute them safely with your favourite SQL interface (don\'t forget to backup your data before doing that).
It\'s highly recommended to be running the latest (+ version) available of your Moodle release before executing the search of missing indexes.
This functionality doesn\'t perform any action against the DB (just reads from it), so can be safely executed at any moment.';
$string['confirmcheckoraclesemantics'] = 'This functionality will search for <a href="http://tracker.moodle.org/browse/MDL-29322">Oracle varchar2 columns using BYTE semantics</a> in your Moodle server, generating (but not executing!) automatically the needed SQL statements to have all the columns converted to use CHAR semantics instead (better for cross-db compatibility and increased contents max. length).<br /><br />
Once generated you can copy such statements and execute them safely with your favourite SQL interface (don\'t forget to backup your data before doing that).<br /><br />
It\'s highly recommended to be running the latest (+ version) available of your Moodle release (2.2, 2.3, 2.x ...) before executing the search of BYTE semantics.<br /><br />
$string['confirmcheckoraclesemantics'] = 'This functionality will search for <a href="http://tracker.moodle.org/browse/MDL-29322">Oracle varchar2 columns using BYTE semantics</a> in your Moodle server, generating (but not executing!) automatically the needed SQL statements to have all the columns converted to use CHAR semantics instead (better for cross-db compatibility and increased contents max. length).
Once generated you can copy such statements and execute them safely with your favourite SQL interface (don\'t forget to backup your data before doing that).
It\'s highly recommended to be running the latest (+ version) available of your Moodle release before executing the search of BYTE semantics.
This functionality doesn\'t perform any action against the DB (just reads from it), so can be safely executed at any moment.';
$string['confirmrevertchanges'] = 'Are you absolutely sure that you want to revert changes performed over:';
$string['create'] = 'Create';
+2
View File
@@ -376,7 +376,9 @@
echo $OUTPUT->heading('<a href="'.$securewwwroot.'/user/editadvanced.php?id=-1">'.get_string('addnewuser').'</a>');
}
if (!empty($table)) {
echo html_writer::start_tag('div', array('class'=>'no-overflow'));
echo html_writer::table($table);
echo html_writer::end_tag('div');
echo $OUTPUT->paging_bar($usercount, $page, $perpage, $baseurl);
if (has_capability('moodle/user:create', $sitecontext)) {
echo $OUTPUT->heading('<a href="'.$securewwwroot.'/user/editadvanced.php?id=-1">'.get_string('addnewuser').'</a>');
+11 -3
View File
@@ -23,6 +23,7 @@ echo $OUTPUT->header();
//TODO: add support for large number of users
if ($confirm and confirm_sesskey()) {
$notifications = '';
list($in, $params) = $DB->get_in_or_equal($SESSION->bulk_users);
$rs = $DB->get_recordset_select('user', "id $in", $params, '', 'id, username, secret, confirmed, auth, firstname, lastname');
foreach ($rs as $user) {
@@ -32,12 +33,19 @@ if ($confirm and confirm_sesskey()) {
$auth = get_auth_plugin($user->auth);
$result = $auth->user_confirm($user->username, $user->secret);
if ($result != AUTH_CONFIRM_OK && $result != AUTH_CONFIRM_ALREADY) {
echo $OUTPUT->notification(get_string('usernotconfirmed', '', fullname($user, true)));
$notifications .= $OUTPUT->notification(get_string('usernotconfirmed', '', fullname($user, true)));
}
}
$rs->close();
redirect($return, get_string('changessaved'));
echo $OUTPUT->box_start('generalbox', 'notice');
if (!empty($notifications)) {
echo $notifications;
} else {
echo $OUTPUT->notification(get_string('changessaved'), 'notifysuccess');
}
$continue = new single_button(new moodle_url($return), get_string('continue'), 'post');
echo $OUTPUT->render($continue);
echo $OUTPUT->box_end();
} else {
list($in, $params) = $DB->get_in_or_equal($SESSION->bulk_users);
$userlist = $DB->get_records_select_menu('user', "id $in", $params, 'fullname', 'id,'.$DB->sql_fullname().' AS fullname');
+11 -4
View File
@@ -23,20 +23,27 @@ echo $OUTPUT->header();
//TODO: add support for large number of users
if ($confirm and confirm_sesskey()) {
$notifications = '';
list($in, $params) = $DB->get_in_or_equal($SESSION->bulk_users);
$rs = $DB->get_recordset_select('user', "id $in", $params);
foreach ($rs as $user) {
if (!is_siteadmin($user) and $USER->id != $user->id and delete_user($user)) {
unset($SESSION->bulk_users[$user->id]);
} else {
echo $OUTPUT->notification(get_string('deletednot', '', fullname($user, true)));
$notifications .= $OUTPUT->notification(get_string('deletednot', '', fullname($user, true)));
}
}
$rs->close();
session_gc(); // remove stale sessions
redirect($return, get_string('changessaved'));
echo $OUTPUT->box_start('generalbox', 'notice');
if (!empty($notifications)) {
echo $notifications;
} else {
echo $OUTPUT->notification(get_string('changessaved'), 'notifysuccess');
}
$continue = new single_button(new moodle_url($return), get_string('continue'), 'post');
echo $OUTPUT->render($continue);
echo $OUTPUT->box_end();
} else {
list($in, $params) = $DB->get_in_or_equal($SESSION->bulk_users);
$userlist = $DB->get_records_select_menu('user', "id $in", $params, 'fullname', 'id,'.$DB->sql_fullname().' AS fullname');
+4 -4
View File
@@ -1370,7 +1370,7 @@ class CASClient
/**
* This method is used to validate a ST; halt on failure, and sets $validate_url,
* $text_reponse and $tree_response on success. These parameters are used later
* $text_response and $tree_response on success. These parameters are used later
* by CASClient::validatePGT() for CAS proxies.
* Used for all CAS 1.0 validations
* @param $validate_url the URL of the request to the CAS server.
@@ -1500,7 +1500,7 @@ class CASClient
/**
* This method is used to validate a SAML TICKET; halt on failure, and sets $validate_url,
* $text_reponse and $tree_response on success. These parameters are used later
* $text_response and $tree_response on success. These parameters are used later
* by CASClient::validatePGT() for CAS proxies.
*
* @param $validate_url the URL of the request to the CAS server.
@@ -2160,7 +2160,7 @@ class CASClient
if ($this->_cas_server_cert != '' && $this->_cas_server_ca_cert != '') {
// This branch added by IDMS. Seems phpCAS implementor got a bit confused about the curl options CURLOPT_SSLCERT and CURLOPT_CAINFO
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_SSLCERT, $this->_cas_server_cert);
curl_setopt($ch, CURLOPT_CAINFO, $this->_cas_server_ca_cert);
curl_setopt($ch, CURLOPT_VERBOSE, '1');
@@ -2172,7 +2172,7 @@ class CASClient
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
curl_setopt($ch, CURLOPT_CAINFO, $this->_cas_server_ca_cert);
} else {
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
}
+23 -2
View File
@@ -125,7 +125,7 @@ class auth_plugin_cas extends auth_plugin_ldap {
// test pgtIou parameter for proxy mode (https connection
// in background from CAS server to the php server)
if ($authCAS != 'CAS' && !isset($_GET['pgtIou'])) {
$PAGE->set_url('/auth/cas/auth.php');
$PAGE->set_url('/login/index.php');
$PAGE->navbar->add($CASform);
$PAGE->set_title("$site->fullname: $CASform");
$PAGE->set_heading($site->fullname);
@@ -162,7 +162,7 @@ class auth_plugin_cas extends auth_plugin_ldap {
*
*/
function connectCAS() {
global $PHPCAS_CLIENT;
global $CFG, $PHPCAS_CLIENT;
if (!is_object($PHPCAS_CLIENT)) {
// Make sure phpCAS doesn't try to start a new PHP session when connecting to the CAS server.
@@ -173,6 +173,27 @@ class auth_plugin_cas extends auth_plugin_ldap {
}
}
// If Moodle is configured to use a proxy, phpCAS needs some curl options set.
if (!empty($CFG->proxyhost) && !is_proxybypass($this->config->hostname)) {
phpCAS::setExtraCurlOption(CURLOPT_PROXY, $CFG->proxyhost);
if (!empty($CFG->proxyport)) {
phpCAS::setExtraCurlOption(CURLOPT_PROXYPORT, $CFG->proxyport);
}
if (!empty($CFG->proxytype)) {
// Only set CURLOPT_PROXYTYPE if it's something other than the curl-default http
if ($CFG->proxytype == 'SOCKS5') {
phpCAS::setExtraCurlOption(CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
}
}
if (!empty($CFG->proxyuser) and !empty($CFG->proxypassword)) {
phpCAS::setExtraCurlOption(CURLOPT_PROXYUSERPWD, $CFG->proxyuser.':'.$CFG->proxypassword);
if (defined('CURLOPT_PROXYAUTH')) {
// any proxy authentication if PHP 5.1
phpCAS::setExtraCurlOption(CURLOPT_PROXYAUTH, CURLAUTH_BASIC | CURLAUTH_NTLM);
}
}
}
if($this->config->certificate_check && $this->config->certificate_path){
phpCAS::setCasServerCACert($this->config->certificate_path);
}else{
+1 -1
View File
@@ -307,7 +307,7 @@ if (!ldap_paged_results_supported($config->ldap_version)) {
<label for="bind_pw"><?php print_string('auth_ldap_bind_pw_key', 'auth_ldap') ?></label>
</td>
<td>
<input name="bind_pw" id="bind_pw" type="password" size="30" value="<?php echo $config->bind_pw?>" />
<input name="bind_pw" id="bind_pw" type="password" size="30" value="<?php echo $config->bind_pw?>" autocomplete="off"/>
<?php if (isset($err['bind_pw'])) { echo $OUTPUT->error_text($err['bind_pw']); } ?>
</td>
<td>
+1 -1
View File
@@ -124,7 +124,7 @@
<tr valign="top" class="required">
<td align="right"><label for="pass"><?php print_string("auth_dbpass_key", "auth_db") ?></label></td>
<td>
<input id="pass" name="pass" type="text" size="30" value="<?php echo $config->pass?>" />
<input id="pass" name="pass" type="password" size="30" value="<?php p($config->pass)?>" autocomplete="off"/>
<?php
if (isset($err["pass"])) {
+2 -2
View File
@@ -36,13 +36,13 @@ $string['auth_dbfieldpass'] = 'Name of the field containing passwords';
$string['auth_dbfieldpass_key'] = 'Password field';
$string['auth_dbfielduser'] = 'Name of the field containing usernames';
$string['auth_dbfielduser_key'] = 'Username field';
$string['auth_dbhost'] = 'The computer hosting the database server.';
$string['auth_dbhost'] = 'The computer hosting the database server. Use a system DSN entry if using ODBC.';
$string['auth_dbhost_key'] = 'Host';
$string['auth_dbchangepasswordurl_key'] = 'Password-change URL';
$string['auth_dbinsertuser'] = 'Inserted user {$a->name} id {$a->id}';
$string['auth_dbinsertuserduplicate'] = 'Error inserting user {$a->username} - user with this username was already created through \'{$a->auth}\' plugin.';
$string['auth_dbinsertusererror'] = 'Error inserting user {$a}';
$string['auth_dbname'] = 'Name of the database itself';
$string['auth_dbname'] = 'Name of the database itself. Leave empty if using an ODBC DSN.';
$string['auth_dbname_key'] = 'DB name';
$string['auth_dbpass'] = 'Password matching the above username';
$string['auth_dbpass_key'] = 'Password';
+1 -1
View File
@@ -61,7 +61,7 @@
<tr valign="top" class="required">
<td align="right"><label for="passwd"><?php print_string("auth_fcpasswd_key", "auth_fc") ?>:</label></td>
<td>
<input name="passwd" id="passwd" type="password" size="30" maxlength="12" value="<?php echo $config->passwd?>" />
<input name="passwd" id="passwd" type="password" size="30" maxlength="12" value="<?php echo $config->passwd?>" autocomplete="off"/>
<?php if (isset($err["passwd"])) echo $OUTPUT->error_text($err["passwd"]); ?>
</td>
<td>
+12
View File
@@ -564,6 +564,8 @@ class auth_plugin_ldap extends auth_plugin_base {
if ($user->firstaccess == 0) {
$DB->set_field('user', 'firstaccess', time(), array('id'=>$user->id));
}
$euser = $DB->get_record('user', array('id' => $user->id));
events_trigger('user_updated', $euser);
return AUTH_CONFIRM_OK;
}
} else {
@@ -736,6 +738,8 @@ class auth_plugin_ldap extends auth_plugin_base {
$updateuser->auth = 'nologin';
$DB->update_record('user', $updateuser);
echo "\t"; print_string('auth_dbsuspenduser', 'auth_db', array('name'=>$user->username, 'id'=>$user->id)); echo "\n";
$euser = $DB->get_record('user', array('id' => $user->id));
events_trigger('user_updated', $euser);
}
}
} else {
@@ -761,6 +765,8 @@ class auth_plugin_ldap extends auth_plugin_base {
$updateuser->auth = $this->authtype;
$DB->update_record('user', $updateuser);
echo "\t"; print_string('auth_dbreviveduser', 'auth_db', array('name'=>$user->username, 'id'=>$user->id)); echo "\n";
$euser = $DB->get_record('user', array('id' => $user->id));
events_trigger('user_updated', $euser);
}
} else {
print_string('nouserentriestorevive', 'auth_ldap');
@@ -874,6 +880,8 @@ class auth_plugin_ldap extends auth_plugin_base {
$id = $DB->insert_record('user', $user);
echo "\t"; print_string('auth_dbinsertuser', 'auth_db', array('name'=>$user->username, 'id'=>$id)); echo "\n";
$euser = $DB->get_record('user', array('id' => $id));
events_trigger('user_created', $euser);
if (!empty($this->config->forcechangepassword)) {
set_user_preference('auth_forcepasswordchange', 1, $id);
}
@@ -944,6 +952,10 @@ class auth_plugin_ldap extends auth_plugin_base {
}
}
}
if (!empty($updatekeys)) {
$euser = $DB->get_record('user', array('id' => $userid));
events_trigger('user_updated', $euser);
}
} else {
return false;
}
+1 -1
View File
@@ -209,7 +209,7 @@ if (!ldap_paged_results_supported($config->ldap_version)) {
<label for="bind_pw"><?php print_string('auth_ldap_bind_pw_key', 'auth_ldap') ?></label>
</td>
<td>
<input name="bind_pw" id="bind_pw" type="password" size="30" value="<?php echo $config->bind_pw?>" />
<input name="bind_pw" id="bind_pw" type="password" size="30" value="<?php echo $config->bind_pw?>" autocomplete="off"/>
<?php if (isset($err['bind_pw'])) { echo $OUTPUT->error_text($err['bind_pw']); } ?>
</td>
<td>
-1
View File
@@ -1,7 +1,6 @@
This files describes API changes in /auth/* - plugins,
information provided here is intended especially for developers.
=== 2.4 ===
required changes in code:
@@ -335,6 +335,9 @@ class restore_controller extends backup implements loggable {
if ($this->status != backup::STATUS_NEED_PRECHECK) {
throw new restore_controller_exception('cannot_precheck_wrong_status', $this->status);
}
// Basic/initial prevention against time/memory limits
set_time_limit(1 * 60 * 60); // 1 hour for 1 course initially granted
raise_memory_limit(MEMORY_EXTRA);
$this->precheck = restore_prechecks_helper::execute_prechecks($this, $droptemptablesafter);
if (!array_key_exists('errors', $this->precheck)) { // No errors, can be executed
$this->set_status(backup::STATUS_AWAITING);
+1 -1
View File
@@ -139,7 +139,7 @@ class imscc11_backup_convert extends backup_execution_step {
require_once($CFG->dirroot . '/backup/cc/cc_includes.php');
$tempdir = $CFG->dataroot . '/temp/backup/' . uniqid('', true);
$tempdir = $CFG->tempdir . '/backup/' . uniqid('', true);
if (mkdir($tempdir, 0777, true)) {
+7 -3
View File
@@ -1210,12 +1210,16 @@ class moodle1_file_manager implements loggable {
*/
public function migrate_file($sourcepath, $filepath = '/', $filename = null, $sortorder = 0, $timecreated = null, $timemodified = null) {
$sourcefullpath = $this->basepath.'/'.$sourcepath;
// Normalise Windows paths a bit.
$sourcepath = str_replace('\\', '/', $sourcepath);
if ($sourcefullpath !== clean_param($sourcefullpath, PARAM_PATH)) {
throw new moodle1_convert_exception('file_invalid_path', $sourcefullpath);
// PARAM_PATH must not be used on full OS path!
if ($sourcepath !== clean_param($sourcepath, PARAM_PATH)) {
throw new moodle1_convert_exception('file_invalid_path', $sourcepath);
}
$sourcefullpath = $this->basepath.'/'.$sourcepath;
if (!is_readable($sourcefullpath)) {
throw new moodle1_convert_exception('file_not_readable', $sourcefullpath);
}
+29 -14
View File
@@ -113,31 +113,46 @@ if ($backup->get_stage() == backup_ui::STAGE_FINAL) {
// Mark the UI finished.
$rc->finish_ui();
// Execute prechecks
$warnings = false;
if (!$rc->execute_precheck()) {
$precheckresults = $rc->get_precheck_results();
if (is_array($precheckresults) && !empty($precheckresults['errors'])) {
fulldelete($tempdestination);
if (is_array($precheckresults)) {
if (!empty($precheckresults['errors'])) { // If errors are found, terminate the import.
fulldelete($tempdestination);
echo $OUTPUT->header();
echo $renderer->precheck_notices($precheckresults);
echo $OUTPUT->continue_button(new moodle_url('/course/view.php', array('id'=>$course->id)));
echo $OUTPUT->footer();
die();
echo $OUTPUT->header();
echo $renderer->precheck_notices($precheckresults);
echo $OUTPUT->continue_button(new moodle_url('/course/view.php', array('id'=>$course->id)));
echo $OUTPUT->footer();
die();
}
if (!empty($precheckresults['warnings'])) { // If warnings are found, go ahead but display warnings later.
$warnings = $precheckresults['warnings'];
}
}
} else {
if ($restoretarget == backup::TARGET_CURRENT_DELETING || $restoretarget == backup::TARGET_EXISTING_DELETING) {
restore_dbops::delete_course_content($course->id);
}
// Execute the restore
$rc->execute_plan();
}
if ($restoretarget == backup::TARGET_CURRENT_DELETING || $restoretarget == backup::TARGET_EXISTING_DELETING) {
restore_dbops::delete_course_content($course->id);
}
// Execute the restore.
$rc->execute_plan();
// Delete the temp directory now
fulldelete($tempdestination);
// Display a notification and a continue button
echo $OUTPUT->header();
echo $OUTPUT->notification(get_string('importsuccess', 'backup'),'notifysuccess');
if ($warnings) {
echo $OUTPUT->box_start();
echo $OUTPUT->notification(get_string('warning'), 'notifywarning');
echo html_writer::start_tag('ul', array('class'=>'list'));
foreach ($warnings as $warning) {
echo html_writer::tag('li', $warning);
}
echo html_writer::end_tag('ul');
echo $OUTPUT->box_end();
}
echo $OUTPUT->notification(get_string('importsuccess', 'backup'), 'notifysuccess');
echo $OUTPUT->continue_button(new moodle_url('/course/view.php', array('id'=>$course->id)));
echo $OUTPUT->footer();
+15 -1
View File
@@ -37,6 +37,7 @@ class create_and_clean_temp_stuff extends backup_execution_step {
backup_helper::check_and_create_backup_dir($this->get_backupid());// Create backup temp dir
backup_helper::clear_backup_dir($this->get_backupid()); // Empty temp dir, just in case
backup_helper::delete_old_backup_dirs(time() - (4 * 60 * 60)); // Delete > 4 hours temp dirs
backup_controller_dbops::drop_backup_ids_temp_table($this->get_backupid()); // Drop ids temp table
backup_controller_dbops::create_backup_ids_temp_table($this->get_backupid()); // Create ids temp table
}
}
@@ -1626,7 +1627,20 @@ class backup_zip_contents extends backup_execution_step {
$zippacker = get_file_packer('application/zip');
// Zip files
$zippacker->archive_to_pathname($files, $zipfile);
$result = $zippacker->archive_to_pathname($files, $zipfile, true, $this);
// Something went wrong.
if ($result === false) {
@unlink($zipfile);
throw new backup_step_exception('error_zip_packing', '', 'An error was encountered while trying to generate backup zip');
}
// Read to make sure it is a valid backup. Refer MDL-37877 . Delete it, if found not to be valid.
try {
backup_general_helper::get_backup_information_from_mbz($zipfile);
} catch (backup_helper_exception $e) {
@unlink($zipfile);
throw new backup_step_exception('error_zip_packing', '', $e->debuginfo);
}
}
}
@@ -35,7 +35,7 @@ global $LINKS_ENCODERS_CACHE;
$LINKS_ENCODERS_CACHE = array();
/**
* Class implementing the @xml_contenttrasnformed logic to be applied in moodle2 backups
* Class implementing the @xml_contenttransformed logic to be applied in moodle2 backups
*
* TODO: Finish phpdocs
*/
@@ -61,13 +61,13 @@ class backup_xml_transformer extends xml_contenttransformer {
// Array or object, debug and try our best recursively, shouldn't happen but...
if (is_array($content)) {
debugging('Backup XML transformer should process arrays but plain content always', DEBUG_DEVELOPER);
debugging('Backup XML transformer should not process arrays but plain content only', DEBUG_DEVELOPER);
foreach($content as $key => $plaincontent) {
$content[$key] = $this->process($plaincontent);
}
return $content;
} else if (is_object($content)) {
debugging('Backup XML transformer should not process objects but plain content always', DEBUG_DEVELOPER);
debugging('Backup XML transformer should not process objects but plain content only', DEBUG_DEVELOPER);
foreach((array)$content as $key => $plaincontent) {
$content[$key] = $this->process($plaincontent);
}
+14 -2
View File
@@ -73,8 +73,20 @@ class restore_course_task extends restore_task {
$this->add_step(new restore_course_legacy_files_step('legacy_files'));
// Restore course enrolments (plugins and membership). Conditionally prevented for any IMPORT/HUB operation
if ($this->plan->get_mode() != backup::MODE_IMPORT && $this->plan->get_mode() != backup::MODE_HUB) {
// Deal with enrolment methods and user enrolments.
if ($this->plan->get_mode() == backup::MODE_IMPORT) {
// No need to do anything with enrolments.
} else if (!$this->get_setting_value('users') or $this->plan->get_mode() == backup::MODE_HUB) {
if ($this->get_target() == backup::TARGET_CURRENT_ADDING or $this->get_target() == backup::TARGET_EXISTING_ADDING) {
// Keep current enrolments unchanged.
} else {
// If no instances yet add default enrol methods the same way as when creating new course in UI.
$this->add_step(new restore_default_enrolments_step('default_enrolments'));
}
} else {
// Restore course enrolment data.
$this->add_step(new restore_enrolments_structure_step('course_enrolments', 'enrolments.xml'));
}
@@ -143,6 +143,9 @@ class restore_final_task extends restore_task {
$rules[] = new restore_log_rule('course', 'report stats', 'report/stats/index.php?id={course}', '{course}');
$rules[] = new restore_log_rule('course', 'view section', 'view.php?id={course}&sectionid={course_section}', '{course_section}');
// module 'grade' rules
$rules[] = new restore_log_rule('grade', 'update', 'report/grader/index.php?id={course}', null);
// module 'user' rules
$rules[] = new restore_log_rule('user', 'view', 'view.php?id={user}&course={course}', '{user}');
$rules[] = new restore_log_rule('user', 'change password', 'view.php?id={user}&course={course}', '{user}');
+24 -18
View File
@@ -35,6 +35,18 @@ defined('MOODLE_INTERNAL') || die();
*/
abstract class restore_qtype_plugin extends restore_plugin {
/*
* A simple answer to id cache for a single questions answers.
* @var array
*/
private $questionanswercache = array();
/*
* The id of the current question in the questionanswercache.
* @var int
*/
private $questionanswercacheid = null;
/**
* Add to $paths the restore_path_elements needed
* to handle question_answers for a given question
@@ -147,38 +159,32 @@ abstract class restore_qtype_plugin extends restore_plugin {
// The question existed, we need to map the existing question_answers
} else {
// Look in question_answers by answertext matching
$sql = 'SELECT id
FROM {question_answers}
WHERE question = ?
AND ' . $DB->sql_compare_text('answer', 255) . ' = ' . $DB->sql_compare_text('?', 255);
$params = array($newquestionid, $data->answertext);
$newitemid = $DB->get_field_sql($sql, $params);
// Not able to find the answer, let's try cleaning the answertext
// of all the question answers in DB as slower fallback. MDL-30018.
if (!$newitemid) {
// Have we cached the current question?
if ($this->questionanswercacheid !== $newquestionid) {
// The question changed, purge and start again!
$this->questionanswercache = array();
$params = array('question' => $newquestionid);
$answers = $DB->get_records('question_answers', $params, '', 'id, answer');
$this->questionanswercacheid = $newquestionid;
// Cache all cleaned answers for a simple text match.
foreach ($answers as $answer) {
// Clean in the same way than {@link xml_writer::xml_safe_utf8()}.
// MDL-30018: Clean in the same way as {@link xml_writer::xml_safe_utf8()}.
$clean = preg_replace('/[\x-\x8\xb-\xc\xe-\x1f\x7f]/is','', $answer->answer); // Clean CTRL chars.
$clean = preg_replace("/\r\n|\r/", "\n", $clean); // Normalize line ending.
if ($clean === $data->answertext) {
$newitemid = $data->id;
}
$this->questionanswercache[$clean] = $answer->id;
}
}
// If we haven't found the newitemid, something has gone really wrong, question in DB
// is missing answers, exception
if (!$newitemid) {
if (!isset($this->questionanswercache[$data->answertext])) {
// If we haven't found the matching answer, something has gone really wrong, the question in the DB
// is missing answers, throw an exception.
$info = new stdClass();
$info->filequestionid = $oldquestionid;
$info->dbquestionid = $newquestionid;
$info->answer = $data->answertext;
throw new restore_step_exception('error_question_answers_missing_in_db', $info);
}
$newitemid = $this->questionanswercache[$data->answertext];
}
// Create mapping (we'll use this intensively when restoring question_states. And also answerfeedback files)
$this->set_mapping('question_answer', $oldid, $newitemid);
@@ -115,6 +115,7 @@ class restore_root_task extends restore_task {
$rootenrolmanual = new restore_users_setting('enrol_migratetomanual', base_setting::IS_BOOLEAN, false);
$rootenrolmanual->set_ui(new backup_setting_ui_checkbox($rootenrolmanual, get_string('rootenrolmanual', 'backup')));
$rootenrolmanual->get_ui()->set_changeable(enrol_is_enabled('manual'));
$rootenrolmanual->get_ui()->set_changeable($changeable);
$this->add_setting($rootenrolmanual);
$users->add_dependency($rootenrolmanual);
@@ -161,6 +161,9 @@ class restore_section_task extends restore_task {
$section_included = new restore_section_included_setting($settingname, base_setting::IS_BOOLEAN, true);
if (is_number($this->info->title)) {
$label = get_string('includesection', 'backup', $this->info->title);
} elseif (empty($this->info->title)) { // Don't throw error if title is empty, gracefully continue restore.
$this->log('Section title missing in backup for section id '.$this->info->sectionid, backup::LOG_WARNING, $this->name);
$label = get_string('unnamedsection', 'backup');
} else {
$label = $this->info->title;
}
+23
View File
@@ -1616,6 +1616,29 @@ class restore_ras_and_caps_structure_step extends restore_structure_step {
}
}
/**
* If no instances yet add default enrol methods the same way as when creating new course in UI.
*/
class restore_default_enrolments_step extends restore_execution_step {
public function define_execution() {
global $DB;
$course = $DB->get_record('course', array('id'=>$this->get_courseid()), '*', MUST_EXIST);
if ($DB->record_exists('enrol', array('courseid'=>$this->get_courseid(), 'enrol'=>'manual'))) {
// Something already added instances, do not add default instances.
$plugins = enrol_get_plugins(true);
foreach ($plugins as $plugin) {
$plugin->restore_sync_course($course);
}
} else {
// Looks like a newly created course.
enrol_course_updated(true, $course, null);
}
}
}
/**
* This structure steps restores the enrol plugins and their underlying
* enrolments, performing all the mappings and/or movements required
@@ -164,8 +164,10 @@ abstract class backup_controller_dbops extends backup_dbops {
$dbman = $DB->get_manager(); // We are going to use database_manager services
$targettablename = 'backup_ids_temp';
$table = new xmldb_table($targettablename);
$dbman->drop_table($table); // And drop it
if ($dbman->table_exists($targettablename)) {
$table = new xmldb_table($targettablename);
$dbman->drop_table($table); // And drop it
}
}
/**
+22 -6
View File
@@ -614,13 +614,20 @@ abstract class restore_dbops {
} else {
self::set_backup_ids_record($restoreid, 'question_category', $category->id, $matchcat->id, $targetcontext->id);
$questions = self::restore_get_questions($restoreid, $category->id);
// Collect all the questions for this category into memory so we only talk to the DB once.
$questioncache = $DB->get_records_sql_menu("SELECT ".$DB->sql_concat('stamp', "' '", 'version').", id
FROM {question}
WHERE category = ?", array($matchcat->id));
foreach ($questions as $question) {
$matchq = $DB->get_record('question', array(
'category' => $matchcat->id,
'stamp' => $question->stamp,
'version' => $question->version));
if (isset($questioncache[$question->stamp." ".$question->version])) {
$matchqid = $questioncache[$question->stamp." ".$question->version];
} else {
$matchqid = false;
}
// 5a) No match, check if user can add q
if (!$matchq) {
if (!$matchqid) {
// 6a) User can, mark the q to be created
if ($canadd) {
// Nothing to mark, newitemid means create
@@ -645,7 +652,7 @@ abstract class restore_dbops {
// 5b) Match, mark q to be mapped
} else {
self::set_backup_ids_record($restoreid, 'question', $question->id, $matchq->id);
self::set_backup_ids_record($restoreid, 'question', $question->id, $matchqid);
}
}
}
@@ -901,6 +908,15 @@ abstract class restore_dbops {
}
if (empty($file->repositoryid)) {
// If contenthash is empty then gracefully skip adding file.
if (empty($file->contenthash)) {
$result = new stdClass();
$result->code = 'file_missing_in_backup';
$result->message = sprintf('missing file (%s) contenthash in backup for component %s', $file->filename, $component);
$result->level = backup::LOG_WARNING;
$results[] = $result;
continue;
}
// this is a regular file, it must be present in the backup pool
$backuppath = $basepath . backup_file_manager::get_backup_content_file_location($file->contenthash);
@@ -26,101 +26,6 @@ defined('MOODLE_INTERNAL') || die();
// Include all the needed stuff
global $CFG;
require_once($CFG->dirroot . '/backup/util/includes/backup_includes.php');
require_once($CFG->dirroot . '/backup/util/includes/restore_includes.php');
/**
* Restore dbops tests (all).
*/
class restore_dbops_testcase extends advanced_testcase {
/**
* Verify the xxx_ids_cached (in-memory backup_ids cache) stuff works as expected.
*
* Note that those private implementations are tested here by using the public
* backup_ids API and later performing low-level tests.
*/
public function test_backup_ids_cached() {
global $DB;
$dbman = $DB->get_manager(); // We are going to use database_manager services.
$this->resetAfterTest(true); // Playing with temp tables, better reset once finished.
// Some variables and objects for testing.
$restoreid = 'testrestoreid';
$mapping = new stdClass();
$mapping->itemname = 'user';
$mapping->itemid = 1;
$mapping->newitemid = 2;
$mapping->parentitemid = 3;
$mapping->info = 'info';
// Create the backup_ids temp tables used by restore.
restore_controller_dbops::create_restore_temp_tables($restoreid);
// Send one mapping using the public api with defaults.
restore_dbops::set_backup_ids_record($restoreid, $mapping->itemname, $mapping->itemid);
// Get that mapping and verify everything is returned as expected.
$result = restore_dbops::get_backup_ids_record($restoreid, $mapping->itemname, $mapping->itemid);
$this->assertSame($mapping->itemname, $result->itemname);
$this->assertSame($mapping->itemid, $result->itemid);
$this->assertSame(0, $result->newitemid);
$this->assertSame(null, $result->parentitemid);
$this->assertSame(null, $result->info);
// Drop the backup_xxx_temp temptables manually, so memory cache won't be invalidated.
$dbman->drop_table(new xmldb_table('backup_ids_temp'));
$dbman->drop_table(new xmldb_table('backup_files_temp'));
// Verify the mapping continues returning the same info,
// now from cache (the table does not exist).
$result = restore_dbops::get_backup_ids_record($restoreid, $mapping->itemname, $mapping->itemid);
$this->assertSame($mapping->itemname, $result->itemname);
$this->assertSame($mapping->itemid, $result->itemid);
$this->assertSame(0, $result->newitemid);
$this->assertSame(null, $result->parentitemid);
$this->assertSame(null, $result->info);
// Recreate the temp table, just to drop it using the restore API in
// order to check that, then, the cache becomes invalid for the same request.
restore_controller_dbops::create_restore_temp_tables($restoreid);
restore_controller_dbops::drop_restore_temp_tables($restoreid);
// No cached info anymore, so the mapping request will arrive to
// DB leading to error (temp table does not exist).
try {
$result = restore_dbops::get_backup_ids_record($restoreid, $mapping->itemname, $mapping->itemid);
$this->fail('Expecting an exception, none occurred');
} catch (Exception $e) {
$this->assertTrue($e instanceof dml_exception);
$this->assertSame('Table "backup_ids_temp" does not exist', $e->getMessage());
}
// Create the backup_ids temp tables once more.
restore_controller_dbops::create_restore_temp_tables($restoreid);
// Send one mapping using the public api with complete values.
restore_dbops::set_backup_ids_record($restoreid, $mapping->itemname, $mapping->itemid,
$mapping->newitemid, $mapping->parentitemid, $mapping->info);
// Get that mapping and verify everything is returned as expected.
$result = restore_dbops::get_backup_ids_record($restoreid, $mapping->itemname, $mapping->itemid);
$this->assertSame($mapping->itemname, $result->itemname);
$this->assertSame($mapping->itemid, $result->itemid);
$this->assertSame($mapping->newitemid, $result->newitemid);
$this->assertSame($mapping->parentitemid, $result->parentitemid);
$this->assertSame($mapping->info, $result->info);
// Finally, drop the temp tables properly and get the DB error again (memory caches empty).
restore_controller_dbops::drop_restore_temp_tables($restoreid);
try {
$result = restore_dbops::get_backup_ids_record($restoreid, $mapping->itemname, $mapping->itemid);
$this->fail('Expecting an exception, none occurred');
} catch (Exception $e) {
$this->assertTrue($e instanceof dml_exception);
$this->assertSame('Table "backup_ids_temp" does not exist', $e->getMessage());
}
}
}
/**
* Backup dbops tests (all).
@@ -0,0 +1,122 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package core_backup
* @category phpunit
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
// Include all the needed stuff
global $CFG;
require_once($CFG->dirroot . '/backup/util/includes/restore_includes.php');
/**
* Restore dbops tests (all).
*/
class restore_dbops_testcase extends advanced_testcase {
/**
* Verify the xxx_ids_cached (in-memory backup_ids cache) stuff works as expected.
*
* Note that those private implementations are tested here by using the public
* backup_ids API and later performing low-level tests.
*/
public function test_backup_ids_cached() {
global $DB;
$dbman = $DB->get_manager(); // We are going to use database_manager services.
$this->resetAfterTest(true); // Playing with temp tables, better reset once finished.
// Some variables and objects for testing.
$restoreid = 'testrestoreid';
$mapping = new stdClass();
$mapping->itemname = 'user';
$mapping->itemid = 1;
$mapping->newitemid = 2;
$mapping->parentitemid = 3;
$mapping->info = 'info';
// Create the backup_ids temp tables used by restore.
restore_controller_dbops::create_restore_temp_tables($restoreid);
// Send one mapping using the public api with defaults.
restore_dbops::set_backup_ids_record($restoreid, $mapping->itemname, $mapping->itemid);
// Get that mapping and verify everything is returned as expected.
$result = restore_dbops::get_backup_ids_record($restoreid, $mapping->itemname, $mapping->itemid);
$this->assertSame($mapping->itemname, $result->itemname);
$this->assertSame($mapping->itemid, $result->itemid);
$this->assertSame(0, $result->newitemid);
$this->assertSame(null, $result->parentitemid);
$this->assertSame(null, $result->info);
// Drop the backup_xxx_temp temptables manually, so memory cache won't be invalidated.
$dbman->drop_table(new xmldb_table('backup_ids_temp'));
$dbman->drop_table(new xmldb_table('backup_files_temp'));
// Verify the mapping continues returning the same info,
// now from cache (the table does not exist).
$result = restore_dbops::get_backup_ids_record($restoreid, $mapping->itemname, $mapping->itemid);
$this->assertSame($mapping->itemname, $result->itemname);
$this->assertSame($mapping->itemid, $result->itemid);
$this->assertSame(0, $result->newitemid);
$this->assertSame(null, $result->parentitemid);
$this->assertSame(null, $result->info);
// Recreate the temp table, just to drop it using the restore API in
// order to check that, then, the cache becomes invalid for the same request.
restore_controller_dbops::create_restore_temp_tables($restoreid);
restore_controller_dbops::drop_restore_temp_tables($restoreid);
// No cached info anymore, so the mapping request will arrive to
// DB leading to error (temp table does not exist).
try {
$result = restore_dbops::get_backup_ids_record($restoreid, $mapping->itemname, $mapping->itemid);
$this->fail('Expecting an exception, none occurred');
} catch (Exception $e) {
$this->assertTrue($e instanceof dml_exception);
$this->assertSame('Table "backup_ids_temp" does not exist', $e->getMessage());
}
// Create the backup_ids temp tables once more.
restore_controller_dbops::create_restore_temp_tables($restoreid);
// Send one mapping using the public api with complete values.
restore_dbops::set_backup_ids_record($restoreid, $mapping->itemname, $mapping->itemid,
$mapping->newitemid, $mapping->parentitemid, $mapping->info);
// Get that mapping and verify everything is returned as expected.
$result = restore_dbops::get_backup_ids_record($restoreid, $mapping->itemname, $mapping->itemid);
$this->assertSame($mapping->itemname, $result->itemname);
$this->assertSame($mapping->itemid, $result->itemid);
$this->assertSame($mapping->newitemid, $result->newitemid);
$this->assertSame($mapping->parentitemid, $result->parentitemid);
$this->assertSame($mapping->info, $result->info);
// Finally, drop the temp tables properly and get the DB error again (memory caches empty).
restore_controller_dbops::drop_restore_temp_tables($restoreid);
try {
$result = restore_dbops::get_backup_ids_record($restoreid, $mapping->itemname, $mapping->itemid);
$this->fail('Expecting an exception, none occurred');
} catch (Exception $e) {
$this->assertTrue($e instanceof dml_exception);
$this->assertSame('Table "backup_ids_temp" does not exist', $e->getMessage());
}
}
}
+68 -38
View File
@@ -32,11 +32,11 @@ defined('MOODLE_INTERNAL') || die();
*/
abstract class backup_cron_automated_helper {
/** automated backups are active and ready to run */
/** Automated backups are active and ready to run */
const STATE_OK = 0;
/** automated backups are disabled and will not be run */
/** Automated backups are disabled and will not be run */
const STATE_DISABLED = 1;
/** automated backups are all ready running! */
/** Automated backups are all ready running! */
const STATE_RUNNING = 2;
/** Course automated backup completed successfully */
@@ -49,6 +49,8 @@ abstract class backup_cron_automated_helper {
const BACKUP_STATUS_SKIPPED = 3;
/** Course automated backup had warnings */
const BACKUP_STATUS_WARNING = 4;
/** Course automated backup has yet to be run */
const BACKUP_STATUS_NOTYETRUN = 5;
/** Run if required by the schedule set in config. Default. **/
const RUN_ON_SCHEDULE = 0;
@@ -119,12 +121,13 @@ abstract class backup_cron_automated_helper {
$rs = $DB->get_recordset('course');
foreach ($rs as $course) {
$backupcourse = $DB->get_record('backup_courses', array('courseid'=>$course->id));
$backupcourse = $DB->get_record('backup_courses', array('courseid' => $course->id));
if (!$backupcourse) {
$backupcourse = new stdClass;
$backupcourse->courseid = $course->id;
$DB->insert_record('backup_courses',$backupcourse);
$backupcourse = $DB->get_record('backup_courses', array('courseid'=>$course->id));
$backupcourse->laststatus = self::BACKUP_STATUS_NOTYETRUN;
$DB->insert_record('backup_courses', $backupcourse);
$backupcourse = $DB->get_record('backup_courses', array('courseid' => $course->id));
}
// The last backup is considered as successful when OK or SKIPPED.
@@ -132,19 +135,23 @@ abstract class backup_cron_automated_helper {
$backupcourse->laststatus == self::BACKUP_STATUS_OK) && (
$backupcourse->laststarttime > 0 && $backupcourse->lastendtime > 0);
// Skip courses that do not yet need backup.
$skipped = !(($backupcourse->nextstarttime > 0 && $backupcourse->nextstarttime < $now) || $rundirective == self::RUN_IMMEDIATELY);
$skippedmessage = 'Does not require backup';
// Assume that we are not skipping anything.
$skipped = false;
$skippedmessage = '';
// Check if we are going to be running the backup now.
$shouldrunnow = (($backupcourse->nextstarttime > 0 && $backupcourse->nextstarttime < $now)
|| $rundirective == self::RUN_IMMEDIATELY);
// If config backup_auto_skip_hidden is set to true, skip courses that are not visible.
if (!$skipped && $config->backup_auto_skip_hidden) {
if ($shouldrunnow && $config->backup_auto_skip_hidden) {
$skipped = ($config->backup_auto_skip_hidden && !$course->visible);
$skippedmessage = 'Not visible';
}
// If config backup_auto_skip_modif_days is set to true, skip courses
// that have not been modified since the number of days defined.
if (!$skipped && $lastbackupwassuccessful && $config->backup_auto_skip_modif_days) {
if ($shouldrunnow && !$skipped && $lastbackupwassuccessful && $config->backup_auto_skip_modif_days) {
$sqlwhere = "course=:courseid AND time>:time AND ".$DB->sql_like('action', ':action', false, true, true);
$timenotmodifsincedays = $now - ($config->backup_auto_skip_modif_days * DAYSECS);
// Check log if there were any modifications to the course content.
@@ -159,8 +166,9 @@ abstract class backup_cron_automated_helper {
// If config backup_auto_skip_modif_prev is set to true, skip courses
// that have not been modified since previous backup.
if (!$skipped && $lastbackupwassuccessful && $config->backup_auto_skip_modif_prev) {
if ($shouldrunnow && !$skipped && $lastbackupwassuccessful && $config->backup_auto_skip_modif_prev) {
// Check log if there were any modifications to the course content.
$sqlwhere = "course=:courseid AND time>:time AND ".$DB->sql_like('action', ':action', false, true, true);
$params = array('courseid' => $course->id,
'time' => $backupcourse->laststarttime,
'action' => '%view%');
@@ -170,16 +178,17 @@ abstract class backup_cron_automated_helper {
$skippedmessage = 'Not modified since previous backup';
}
// Skip courses not needed for backup.
if ($skipped) {
// Output the next execution time when it has been updated.
if ($backupcourse->nextstarttime != $nextstarttime) {
mtrace('Backup of \'' . $course->fullname . '\' is scheduled on ' . $showtime);
}
// Check if the course is not scheduled to run right now.
if (!$shouldrunnow) {
$backupcourse->nextstarttime = $nextstarttime;
$DB->update_record('backup_courses', $backupcourse);
mtrace('Skipping ' . $course->fullname . ' (Not scheduled for backup until ' . $showtime . ')');
} else if ($skipped) { // Must have been skipped for a reason.
$backupcourse->laststatus = self::BACKUP_STATUS_SKIPPED;
$backupcourse->nextstarttime = $nextstarttime;
$DB->update_record('backup_courses', $backupcourse);
mtrace('Skipping '.$course->fullname.' ('.$skippedmessage.')');
mtrace('Skipping ' . $course->fullname . ' (' . $skippedmessage . ')');
mtrace('Backup of \'' . $course->fullname . '\' is scheduled on ' . $showtime);
} else {
// Backup every non-skipped courses.
mtrace('Backing up '.$course->fullname.'...');
@@ -223,16 +232,17 @@ abstract class backup_cron_automated_helper {
$count = backup_cron_automated_helper::get_backup_status_array();
$haserrors = ($count[self::BACKUP_STATUS_ERROR] != 0 || $count[self::BACKUP_STATUS_UNFINISHED] != 0);
//Build the message text
//Summary
$message .= get_string('summary')."\n";
// Build the message text.
// Summary.
$message .= get_string('summary') . "\n";
$message .= "==================================================\n";
$message .= " ".get_string('courses').": ".array_sum($count)."\n";
$message .= " ".get_string('ok').": ".$count[self::BACKUP_STATUS_OK]."\n";
$message .= " ".get_string('skipped').": ".$count[self::BACKUP_STATUS_SKIPPED]."\n";
$message .= " ".get_string('error').": ".$count[self::BACKUP_STATUS_ERROR]."\n";
$message .= " ".get_string('unfinished').": ".$count[self::BACKUP_STATUS_UNFINISHED]."\n";
$message .= " ".get_string('warning').": ".$count[self::BACKUP_STATUS_WARNING]."\n\n";
$message .= ' ' . get_string('courses') . '; ' . array_sum($count) . "\n";
$message .= ' ' . get_string('ok') . '; ' . $count[self::BACKUP_STATUS_OK] . "\n";
$message .= ' ' . get_string('skipped') . '; ' . $count[self::BACKUP_STATUS_SKIPPED] . "\n";
$message .= ' ' . get_string('error') . '; ' . $count[self::BACKUP_STATUS_ERROR] . "\n";
$message .= ' ' . get_string('unfinished') . '; ' . $count[self::BACKUP_STATUS_UNFINISHED] . "\n";
$message .= ' ' . get_string('warning') . '; ' . $count[self::BACKUP_STATUS_WARNING] . "\n";
$message .= ' ' . get_string('backupnotyetrun') . '; ' . $count[self::BACKUP_STATUS_NOTYETRUN]."\n\n";
//Reference
if ($haserrors) {
@@ -295,7 +305,8 @@ abstract class backup_cron_automated_helper {
self::BACKUP_STATUS_OK => 0,
self::BACKUP_STATUS_UNFINISHED => 0,
self::BACKUP_STATUS_SKIPPED => 0,
self::BACKUP_STATUS_WARNING => 0
self::BACKUP_STATUS_WARNING => 0,
self::BACKUP_STATUS_NOTYETRUN => 0
);
$statuses = $DB->get_records_sql('SELECT DISTINCT bc.laststatus, COUNT(bc.courseid) AS statuscount FROM {backup_courses} bc GROUP BY bc.laststatus');
@@ -371,7 +382,11 @@ abstract class backup_cron_automated_helper {
$outcome = self::BACKUP_STATUS_OK;
$config = get_config('backup');
$bc = new backup_controller(backup::TYPE_1COURSE, $course->id, backup::FORMAT_MOODLE, backup::INTERACTIVE_NO, backup::MODE_AUTOMATED, $userid);
$dir = $config->backup_auto_destination;
$storage = (int)$config->backup_auto_storage;
$bc = new backup_controller(backup::TYPE_1COURSE, $course->id, backup::FORMAT_MOODLE, backup::INTERACTIVE_NO,
backup::MODE_AUTOMATED, $userid);
try {
@@ -392,27 +407,28 @@ abstract class backup_cron_automated_helper {
}
}
// Set the default filename
// Set the default filename.
$format = $bc->get_format();
$type = $bc->get_type();
$id = $bc->get_id();
$users = $bc->get_plan()->get_setting('users')->get_value();
$anonymised = $bc->get_plan()->get_setting('anonymize')->get_value();
$bc->get_plan()->get_setting('filename')->set_value(backup_plan_dbops::get_default_backup_filename($format, $type, $id, $users, $anonymised));
$bc->get_plan()->get_setting('filename')->set_value(backup_plan_dbops::get_default_backup_filename($format, $type,
$id, $users, $anonymised));
$bc->set_status(backup::STATUS_AWAITING);
$bc->execute_plan();
$results = $bc->get_results();
$outcome = self::outcome_from_results($results);
$file = $results['backup_destination']; // may be empty if file already moved to target location
$dir = $config->backup_auto_destination;
$storage = (int)$config->backup_auto_storage;
$file = $results['backup_destination']; // May be empty if file already moved to target location.
if (!file_exists($dir) || !is_dir($dir) || !is_writable($dir)) {
$dir = null;
}
if ($file && !empty($dir) && $storage !== 0) {
$filename = backup_plan_dbops::get_default_backup_filename($format, $type, $course->id, $users, $anonymised, !$config->backup_shortname);
// Copy file only if there was no error.
if ($file && !empty($dir) && $storage !== 0 && $outcome != self::BACKUP_STATUS_ERROR) {
$filename = backup_plan_dbops::get_default_backup_filename($format, $type, $course->id, $users, $anonymised,
!$config->backup_shortname);
if (!$file->copy_content_to($dir.'/'.$filename)) {
$outcome = self::BACKUP_STATUS_ERROR;
}
@@ -428,6 +444,20 @@ abstract class backup_cron_automated_helper {
$outcome = self::BACKUP_STATUS_ERROR;
}
// Delete the backup file immediately if something went wrong.
if ($outcome === self::BACKUP_STATUS_ERROR) {
// Delete the file from file area if exists.
if (!empty($file)) {
$file->delete();
}
// Delete file from external storage if exists.
if ($storage !== 0 && !empty($filename) && file_exists($dir.'/'.$filename)) {
@unlink($dir.'/'.$filename);
}
}
$bc->destroy();
unset($bc);
@@ -524,7 +554,7 @@ abstract class backup_cron_automated_helper {
public static function set_state_running($running = true) {
if ($running === true) {
if (self::get_automated_backup_state() === self::STATE_RUNNING) {
throw new backup_exception('backup_automated_already_running');
throw new backup_helper_exception('backup_automated_already_running');
}
set_config('backup_auto_running', '1', 'backup');
} else {
@@ -59,7 +59,13 @@ class database_logger extends base_logger {
if ($this->levelcol) {
$columns[$this->levelcol] = $level;
}
$columns[$this->messagecol] = $message; //TODO: should this be cleaned?
$message = clean_param($message, PARAM_NOTAGS);
// Check if the message exceeds the 255 character limit in the database,
// if it does, shorten it so that it can be inserted successfully.
if (textlib::strlen($message) > 255) {
$message = textlib::substr($message, 0, 252) . '...';
}
$columns[$this->messagecol] = $message;
return $this->insert_log_record($this->logtable, $columns);
}
@@ -69,6 +75,6 @@ class database_logger extends base_logger {
// to preserve DB logs if the whole backup/restore transaction is
// rollback
global $DB;
return $DB->insert_record($this->logtable, $columns, false); // Don't return inserted id
return $DB->insert_record($table, $columns, false); // Don't return inserted id
}
}
+11 -7
View File
@@ -60,13 +60,17 @@ abstract class base_plan implements checksumable, executable {
$task->set_plan($this);
// Append task settings to plan array, if not present, for comodity
foreach ($task->get_settings() as $key => $setting) {
if (!in_array($setting, $this->settings)) {
$name = $setting->get_name();
if (!isset($this->settings[$name])) {
$this->settings[$name] = $setting;
} else {
throw new base_plan_exception('multiple_settings_by_name_found', $name);
}
// Check if there is already a setting for this name.
$name = $setting->get_name();
if (!isset($this->settings[$name])) {
// There is no setting, so add it.
$this->settings[$name] = $setting;
} else if ($this->settings[$name] != $setting) {
// If the setting already exists AND it is not the same setting,
// then throw an error. (I.e. you're allowed to add the same
// setting twice, but cannot add two different ones with same
// name.)
throw new base_plan_exception('multiple_settings_by_name_found', $name);
}
}
}
@@ -69,7 +69,7 @@ class backup_base_optigroup_testcase extends basic_testcase {
/**
* Incorrect creation tests (attributes and final elements)
*/
function itest_wrong_creation() {
function test_wrong_creation() {
// Create instance with invalid name
try {
+2 -2
View File
@@ -73,7 +73,7 @@ class core_backup_renderer extends plugin_renderer_base {
*/
public function backup_details($details, $nextstageurl) {
$yestick = $this->output->pix_icon('i/valid', get_string('yes'));
$notick = $this->output->pix_icon('i/valid', get_string('no'));
$notick = $this->output->pix_icon('i/invalid', get_string('no'));
$html = html_writer::start_tag('div', array('class'=>'backup-restore'));
@@ -140,7 +140,7 @@ class core_backup_renderer extends plugin_renderer_base {
}
if (empty($table)) {
$table = new html_table();
$table->head = array('Module', 'Title', 'Userinfo');
$table->head = array(get_string('module','backup'), get_string('title','backup'), get_string('userinfo','backup'));
$table->colclasses = array('modulename', 'moduletitle', 'userinfoincluded');
$table->align = array('left','left', 'center');
$table->attributes = array('class'=>'activitytable generaltable');
+15 -7
View File
@@ -475,8 +475,9 @@ class restore_ui_stage_schema extends restore_ui_stage {
if ($this->stageform === null) {
$form = new restore_schema_form($this, $PAGE->url);
$tasks = $this->ui->get_tasks();
$content = '';
$courseheading = false;
$allsettings = array();
foreach ($tasks as $task) {
if (!($task instanceof restore_root_task)) {
if (!$courseheading) {
@@ -484,13 +485,11 @@ class restore_ui_stage_schema extends restore_ui_stage {
$form->add_heading('coursesettings', get_string('coursesettings', 'backup'));
$courseheading = true;
}
// First add each setting
// Put each setting into an array of settings to add. Adding
// a setting individually is a very slow operation, so we add
// them all in a batch later on.
foreach ($task->get_settings() as $setting) {
$form->add_setting($setting, $task);
}
// The add all the dependencies
foreach ($task->get_settings() as $setting) {
$form->add_dependencies($setting);
$allsettings[] = array($setting, $task);
}
} else if ($this->ui->enforce_changed_dependencies()) {
// Only show these settings if dependencies changed them.
@@ -505,6 +504,15 @@ class restore_ui_stage_schema extends restore_ui_stage {
}
}
}
// Actually add all the settings that we put in the array.
$form->add_settings($allsettings);
// Add the dependencies for all the settings.
foreach ($allsettings as $settingtask) {
$form->add_dependencies($settingtask[0]);
}
$this->stageform = $form;
}
return $this->stageform;
@@ -43,6 +43,18 @@ abstract class grouped_parser_processor extends simplified_parser_processor {
protected $groupedpaths; // Paths we are requesting grouped
protected $currentdata; // Where we'll be acummulating data
/**
* Keep cache of parent directory paths for XML parsing.
* @var array
*/
protected $parentcache = array();
/**
* Remaining space for parent directory paths.
* @var integer
*/
protected $parentcacheavailablesize = 2048;
public function __construct(array $paths = array()) {
$this->groupedpaths = array();
$this->currentdata = null;
@@ -65,7 +77,7 @@ abstract class grouped_parser_processor extends simplified_parser_processor {
$a->child = $found;
throw new progressive_parser_exception('xml_grouped_child_found', $a);
}
$this->groupedpaths[] = $path;
$this->groupedpaths[$path] = true;
}
parent::add_path($path);
}
@@ -141,7 +153,7 @@ abstract class grouped_parser_processor extends simplified_parser_processor {
}
protected function path_is_grouped($path) {
return in_array($path, $this->groupedpaths);
return isset($this->groupedpaths[$path]);
}
/**
@@ -150,16 +162,41 @@ abstract class grouped_parser_processor extends simplified_parser_processor {
* false if not
*/
protected function grouped_parent_exists($path) {
$parentpath = progressive_parser::dirname($path);
$parentpath = $this->get_parent_path($path);
while ($parentpath != '/') {
if ($this->path_is_grouped($parentpath)) {
return $parentpath;
}
$parentpath = progressive_parser::dirname($parentpath);
$parentpath = $this->get_parent_path($parentpath);
}
return false;
}
/**
* Get the parent path using a local cache for performance.
*
* @param $path string The pathname you wish to obtain the parent name for.
* @return string The parent pathname.
*/
protected function get_parent_path($path) {
if (!isset($this->parentcache[$path])) {
$this->parentcache[$path] = progressive_parser::dirname($path);
$this->parentcacheavailablesize--;
if ($this->parentcacheavailablesize < 0) {
// Older first is cheaper than LRU. We use 10% as items are grouped together and the large quiz
// restore from MDL-40585 used only 600 parent paths. This is an XML heirarchy, so common paths
// are grouped near each other. eg; /question_bank/question_category/question/element. After keeping
// question_bank paths in the cache when we move to another area and the question_bank cache is not
// useful any longer.
$this->parentcache = array_slice($this->parentcache, 200, null, true);
$this->parentcacheavailablesize += 200;
}
}
return $this->parentcache[$path];
}
/**
* Function that will look for any grouped
* child for the given path, returning it if found,
@@ -167,7 +204,7 @@ abstract class grouped_parser_processor extends simplified_parser_processor {
*/
protected function grouped_child_exists($path) {
$childpath = $path . '/';
foreach ($this->groupedpaths as $groupedpath) {
foreach ($this->groupedpaths as $groupedpath => $set) {
if (strpos($groupedpath, $childpath) === 0) {
return $groupedpath;
}
+1 -1
View File
@@ -130,7 +130,7 @@ $communityid = optional_param('communityid', '', PARAM_INT);
if ($remove != -1 and !empty($communityid) and confirm_sesskey()) {
$communitymanager->block_community_remove_course($communityid, $USER->id);
echo $OUTPUT->header();
echo $renderer->remove_success(new moodle_url(get_referer(false)));
echo $renderer->remove_success(new moodle_url('/course/view.php', array('id' => $courseid)));
echo $OUTPUT->footer();
die();
}
+1
View File
@@ -38,6 +38,7 @@ class block_community_manager {
$community = $this->block_community_get_course($course->url, $userid);
if (empty($community)) {
$community = new stdClass();
$community->userid = $userid;
$community->coursename = $course->name;
$community->coursedescription = $course->description;
+3 -3
View File
@@ -216,12 +216,12 @@ if (empty($completions)) {
echo '(<i>';
if ($agg == COMPLETION_AGGREGATION_ALL) {
echo strtolower(get_string('all', 'completion'));
echo textlib::strtolower(get_string('all', 'completion'));
} else {
echo strtolower(get_string('any', 'completion'));
echo textlib::strtolower(get_string('any', 'completion'));
}
echo '</i> '.strtolower(get_string('required')).')';
echo '</i> '.textlib::strtolower(get_string('required')).')';
$agg_type = false;
}
}
@@ -26,9 +26,9 @@
$string['adminview'] = 'Admin view';
$string['allcourses'] = 'Admin user sees all courses';
$string['configadminview'] = 'What should the admin see in the course list block?';
$string['confighideallcourseslink'] = 'Hide "All courses" link at the bottom of the block. Link hiding does not affects Admin\'s view';
$string['confighideallcourseslink'] = 'Remove the \'All courses\' link under the list of courses. (This setting does not affect the admin view.)';
$string['course_list:addinstance'] = 'Add a new courses block';
$string['course_list:myaddinstance'] = 'Add a new courses block to My home';
$string['hideallcourseslink'] = 'Hide All courses link';
$string['hideallcourseslink'] = 'Hide \'All courses\' link';
$string['owncourses'] = 'Admin user sees own courses';
$string['pluginname'] = 'Courses';
+12
View File
@@ -34,5 +34,17 @@ $capabilities = array(
),
'clonepermissionsfrom' => 'moodle/my:manageblocks'
),
'block/course_overview:addinstance' => array(
'riskbitmask' => RISK_SPAM | RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_BLOCK,
'archetypes' => array(
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/site:manageblocks'
)
);
@@ -27,6 +27,7 @@ $string['alwaysshowall'] = 'Always Show All';
$string['collapseall'] = 'Collapse All Course Lists';
$string['configotherexpanded'] = 'If enabled, Other Courses will be expanded by default unless overriden by user preferences.';
$string['configpreservestates'] = 'If enabled, the collapsed/expanded states set by the user are stored and used on each load.';
$string['course_overview:addinstance'] = 'Add a new course overview block';
$string['course_overview:myaddinstance'] = 'Add a new course overview block to My home';
$string['defaultmaxcourses'] = 'Default maximum courses';
$string['defaultmaxcoursesdesc'] = 'Maximum courses which should be displayed on course overview block, 0 will show all courses';
+11 -2
View File
@@ -31,8 +31,17 @@
function block_course_overview_get_overviews($courses) {
$htmlarray = array();
if ($modules = get_plugin_list_with_function('mod', 'print_overview')) {
foreach ($modules as $fname) {
$fname($courses,$htmlarray);
// Split courses list into batches with no more than MAX_MODINFO_CACHE_SIZE courses in one batch.
// Otherwise we exceed the cache limit in get_fast_modinfo() and rebuild it too often.
if (defined('MAX_MODINFO_CACHE_SIZE') && MAX_MODINFO_CACHE_SIZE > 0 && count($courses) > MAX_MODINFO_CACHE_SIZE) {
$batches = array_chunk($courses, MAX_MODINFO_CACHE_SIZE, true);
} else {
$batches = array($courses);
}
foreach ($batches as $courses) {
foreach ($modules as $fname) {
$fname($courses, $htmlarray);
}
}
}
return $htmlarray;
+3
View File
@@ -107,6 +107,9 @@ class block_course_overview_renderer extends plugin_renderer_base {
// No need to pass title through s() here as it will be done automatically by html_writer.
$attributes = array('title' => $course->fullname);
if ($course->id > 0) {
if (empty($course->visible)) {
$attributes['class'] = 'dimmed';
}
$courseurl = new moodle_url('/course/view.php', array('id' => $course->id));
$coursefullname = format_string($course->fullname, true, $course->id);
$link = html_writer::link($courseurl, $coursefullname, $attributes);
+1 -1
View File
@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2012121000; // The current plugin version (Date: YYYYMMDDXX)
$plugin->version = 2012121001; // The current plugin version (Date: YYYYMMDDXX)
$plugin->requires = 2012112900; // Requires this Moodle version
$plugin->component = 'block_course_overview'; // Full name of the plugin (used for diagnostics)
+1 -1
View File
@@ -332,7 +332,7 @@ class block_base {
/**
* Subclasses should override this and return true if the
* subclass block has a config_global.html file.
* subclass block has a settings.php file.
*
* @return boolean
*/
+3 -1
View File
@@ -105,7 +105,9 @@ class block_navigation_renderer extends plugin_renderer_base {
if ($item->hidden) {
$attributes['class'] = 'dimmed_text';
}
if (is_string($item->action) || empty($item->action) || ($item->type === navigation_node::TYPE_CATEGORY && empty($options['linkcategories']))) {
if (is_string($item->action) || empty($item->action) ||
(($item->type === navigation_node::TYPE_CATEGORY || $item->type === navigation_node::TYPE_MY_CATEGORY) &&
empty($options['linkcategories']))) {
$attributes['tabindex'] = '0'; //add tab support to span but still maintain character stream sequence.
$content = html_writer::tag('span', $content, $attributes);
} else if ($item->action instanceof action_link) {
+5 -1
View File
@@ -376,11 +376,15 @@ BRANCH.prototype = {
},
/**
* Attaches required events to the branch structure.
*
* @chainable
* @method wire
* @return {BRANCH} This function is chainable, it always returns itself.
*/
wire : function() {
this.node = this.node || Y.one('#'+this.get('id'));
if (!this.node) {
return false;
return this;
}
if (this.get('expandable')) {
this.event_ajaxload = this.node.on('ajaxload|click', this.ajaxLoad, this);
+9
View File
@@ -0,0 +1,9 @@
/* RSS Feeds
-------------------------*/
.block_rss_client .list li:first-child {
border-top-width: 0;
}
.block_rss_client .list li {
border-top: 1px solid;
padding: 5px;
}
+4 -3
View File
@@ -84,15 +84,16 @@ if (!empty($rssrecord->preferredtitle)) {
$feedtitle = $rss->get_title();
}
echo '<table align="center" width="50%" cellspacing="1">'."\n";
echo '<tr><td colspan="2"><strong>'. $feedtitle .'</strong></td></tr>'."\n";
echo '<tr><td colspan="2"><strong>'. s($feedtitle) .'</strong></td></tr>'."\n";
foreach ($rss->get_items() as $item) {
echo '<tr><td valign="middle">'."\n";
echo '<a href="'. $item->get_link() .'" target="_blank"><strong>'. $item->get_title();
echo '<a href="'.$item->get_link().'" target="_blank"><strong>';
echo s($item->get_title());
echo '</strong></a>'."\n";
echo '</td>'."\n";
echo '</tr>'."\n";
echo '<tr><td colspan="2"><small>';
echo $item->get_description() .'</small></td></tr>'."\n";
echo format_text($item->get_description(), FORMAT_HTML) .'</small></td></tr>'."\n";
}
echo '</table>'."\n";
@@ -75,6 +75,11 @@ class block_section_links extends block_base {
$courseformatoptions = course_get_format($course)->get_format_options();
$context = context_course::instance($course->id);
// Course format options 'numsections' is required to display the block.
if (empty($courseformatoptions['numsections'])) {
return $this->content;
}
if ($course->format == 'weeks' or $course->format == 'weekscss') {
$highlight = ceil((time()-$course->startdate)/604800);
$linktext = get_string('jumptocurrentweek', 'block_section_links');
+3 -3
View File
@@ -110,12 +110,12 @@ class block_tags extends block_base {
$content = '';
$moretags = new moodle_url('/tag/coursetags_more.php', array('show'=>$tagtype));
if ($tagtype == 'all') {
$tags = coursetag_get_tags(0, 0, $this->config->tagtype, $this->config->numberoftags, 'name');
$tags = coursetag_get_tags(0, 0, $this->config->tagtype, $this->config->numberoftags);
} else if ($tagtype == 'course') {
$tags = coursetag_get_tags($this->page->course->id, 0, $this->config->tagtype, $this->config->numberoftags, 'name');
$tags = coursetag_get_tags($this->page->course->id, 0, $this->config->tagtype, $this->config->numberoftags);
$moretags->param('courseid', $this->page->course->id);
} else if ($tagtype == 'my') {
$tags = coursetag_get_tags(0, $USER->id, $this->config->tagtype, $this->config->numberoftags, 'name');
$tags = coursetag_get_tags(0, $USER->id, $this->config->tagtype, $this->config->numberoftags);
}
$tagcloud = tag_print_cloud($tags, 150, true);
if (!$tagcloud) {
+1
View File
@@ -120,6 +120,7 @@ if ($action === 'delete'){
print_error('nopermissionstodeleteentry', 'blog');
} else {
$entry->delete();
blog_rss_delete_file($userid);
redirect($returnurl);
}
} else if (blog_user_can_edit_entry($entry)) {
+7 -4
View File
@@ -119,11 +119,14 @@ class core_blog_renderer extends plugin_renderer_base {
// Body.
$o .= format_text($entry->summary, $entry->summaryformat, array('overflowdiv' => true));
// Uniquehash is used as a link to an external blog.
if (!empty($entry->uniquehash)) {
$o .= $this->output->container_start('externalblog');
$o .= html_writer::link($entry->uniquehash, get_string('linktooriginalentry', 'blog'));
$o .= $this->output->container_end();
// Uniquehash is used as a link to an external blog.
$url = clean_param($entry->uniquehash, PARAM_URL);
if (!empty($url)) {
$o .= $this->output->container_start('externalblog');
$o .= html_writer::link($url, get_string('linktooriginalentry', 'blog'));
$o .= $this->output->container_end();
}
}
// Links to tags.
+14
View File
@@ -330,3 +330,17 @@ function blog_rss_save_file($type, $id, $tagid=0, $contents='') {
return $status;
}
/**
* Delete the supplied user's cached blog post RSS feed.
* Only user blogs are available by RSS.
* This doesn't call rss_delete_file() as blog RSS caching uses it's own file structure.
*
* @param int $userid
*/
function blog_rss_delete_file($userid) {
$filename = blog_rss_file_name('user', $userid);
if (file_exists($filename)) {
unlink($filename);
}
}
+7 -8
View File
@@ -24,8 +24,8 @@ A definition:
'overrideclassfile' => null, // Optional
'datasource' => null, // Optional
'datasourcefile' => null, // Optional
'persistent' => false, // Optional
'persistentmaxsize' => false, // Optional
'staticacceleration' => false, // Optional
'staticaccelerationsize' => false, // Optional
'ttl' => 0, // Optional
'mappingsonly' => false // Optional
'invalidationevents' => array( // Optional
@@ -142,19 +142,18 @@ The following optional settings can also be defined:
* overrideclassfile - Included if required when using the overrideclass param.
* datasource - If provided this class will be used as a data source for the definition. It must implement the cache_data_source interface.
* datasourcefile - Included if required when using the datasource param.
* persistent - If set to true the loader will be stored when first created and provided to subsequent requests. More on this later.
* persistentmaxsize - If set to an int this will be the maximum number of items stored in the persistent cache.
* staticacceleration - Any data passing through the cache will be held onto to make subsequent requests for it faster.
* staticaccelerationsize - If set to an int this will be the maximum number of items stored in the static acceleration array.
* ttl - Can be used to set a ttl value for data being set for this cache.
* mappingsonly - This definition can only be used if there is a store mapping for it. More on this later.
* invalidationevents - An array of events that should trigger this cache to invalidate.
It's important to note that internally the definition is also aware of the component. This is picked up when the definition is read, based upon the location of the caches.php file.
The persist option.
As noted the persist option causes the loader generated for this definition to be stored when first created. Subsequent requests for this definition will be given the original loader instance.
The staticacceleration option.
Data passed to or retrieved from the loader and its chained loaders gets cached by the instance.
This option should be used when you know you will require the loader several times and perhaps in different areas of code.
Because it caches key=>value data it avoids the need to re-fetch things from stores after the first request. Its good for performance, bad for memory.
Memory use can be controlled by setting the staticaccelerationsize option.
It should be used sparingly.
The mappingsonly option.
@@ -227,4 +226,4 @@ Cache information can be invalidated in two ways.
The first method is designed to be used when you have a single known definition you want to invalidate entries within.
The second method is a lot more intensive for the system. There are defined invalidation events that definitions can "subscribe" to (through the definitions invalidationevents option).
When you invalidate by event the cache API finds all of the definitions that subscribe to the event, it then loads the stores for each of those definitions and purges the keys from each store.
This is obviously a recursive, and therefore, intense process.
This is obviously a recursive, and therefore, intense process.
+74 -28
View File
@@ -75,19 +75,14 @@ defined('MOODLE_INTERNAL') || die();
* [string] A class to use as the data loader for this definition.
* Any class used here must inherit the cache_data_loader interface.
* + datasourcefile
* [string] Suplements the above setting indicated the file containing the class to be used. This file is included when
* [string] Supplements the above setting indicating the file containing the class to be used. This file is included when
* required.
* + persistent
* [bool] This setting does two important things. First it tells the cache API to only instantiate the cache structure for
* this definition once, further requests will be given the original instance.
* Second the cache loader will keep an array of the items set and retrieved to the cache during the request.
* This has several advantages including better performance without needing to start passing the cache instance between
* function calls, the downside is that the cache instance + the items used stay within memory.
* Consider using this setting when you know that there are going to be many calls to the cache for the same information
* or when you are converting existing code to the cache and need to access the cache within functions but don't want
* to add it as an argument to the function.
* + persistentmaxsize
* [int] This supplements the above setting by limiting the number of items in the caches persistent array of items.
* + staticacceleration
* The cache loader will keep an array of the items set and retrieved to the cache during the request.
* Consider using this setting when you know that there are going to be many calls to the cache for the same information.
* Requests for data in this array will be ultra fast, but it will cost memory.
* + staticaccelerationsize
* [int] This supplements the above setting by limiting the number of items in the static acceleration array.
* Tweaking this setting lower will allow you to minimise the memory implications above while hopefully still managing to
* offset calls to the cache store.
* + ttl
@@ -228,16 +223,16 @@ class cache_definition {
protected $datasourceaggregate = null;
/**
* Set to true if the definitions cache should be persistent
* Set to true if the cache should hold onto items passing through it to speed up subsequent requests.
* @var bool
*/
protected $persistent = false;
protected $staticacceleration = false;
/**
* The persistent item array max size.
* The maximum number of items that static acceleration cache should hold onto.
* @var int
*/
protected $persistentmaxsize = false;
protected $staticaccelerationsize = false;
/**
* The TTL for data in this cache. Please don't use this, instead use event driven invalidation.
@@ -320,8 +315,8 @@ class cache_definition {
$overrideclassfile = null;
$datasource = null;
$datasourcefile = null;
$persistent = false;
$persistentmaxsize = false;
$staticacceleration = false;
$staticaccelerationsize = false;
$ttl = 0;
$mappingsonly = false;
$invalidationevents = array();
@@ -373,10 +368,18 @@ class cache_definition {
}
if (array_key_exists('persistent', $definition)) {
$persistent = (bool)$definition['persistent'];
// Ahhh this is the legacy persistent option.
$staticacceleration = (bool)$definition['persistent'];
}
if (array_key_exists('staticacceleration', $definition)) {
$staticacceleration = (bool)$definition['staticacceleration'];
}
if (array_key_exists('persistentmaxsize', $definition)) {
$persistentmaxsize = (int)$definition['persistentmaxsize'];
// Ahhh this is the legacy persistentmaxsize option.
$staticaccelerationsize = (int)$definition['persistentmaxsize'];
}
if (array_key_exists('staticaccelerationsize', $definition)) {
$staticaccelerationsize = (int)$definition['staticaccelerationsize'];
}
if (array_key_exists('ttl', $definition)) {
$ttl = (int)$definition['ttl'];
@@ -452,8 +455,8 @@ class cache_definition {
$cachedefinition->datasource = $datasource;
$cachedefinition->datasourcefile = $datasourcefile;
$cachedefinition->datasourceaggregate = $datasourceaggregate;
$cachedefinition->persistent = $persistent;
$cachedefinition->persistentmaxsize = $persistentmaxsize;
$cachedefinition->staticacceleration = $staticacceleration;
$cachedefinition->staticaccelerationsize = $staticaccelerationsize;
$cachedefinition->ttl = $ttl;
$cachedefinition->mappingsonly = $mappingsonly;
$cachedefinition->invalidationevents = $invalidationevents;
@@ -474,7 +477,8 @@ class cache_definition {
* - simplekeys : Set to true if the keys you will use are a-zA-Z0-9_
* - simpledata : Set to true if the type of the data you are going to store is scalar, or an array of scalar vars
* - overrideclass : The class to use as the loader.
* - persistent : If set to true the cache will persist construction requests.
* - staticacceleration : If set to true the cache will hold onto data passing through it.
* - staticaccelerationsize : Set it to an int to limit the size of the staticacceleration cache.
* @return cache_application|cache_session|cache_request
*/
public static function load_adhoc($mode, $component, $area, array $options = array()) {
@@ -491,7 +495,14 @@ class cache_definition {
$definition['simpledata'] = $options['simpledata'];
}
if (!empty($options['persistent'])) {
$definition['persistent'] = $options['persistent'];
// Ahhh this is the legacy persistent option.
$definition['staticacceleration'] = (bool)$options['persistent'];
}
if (!empty($options['staticacceleration'])) {
$definition['staticacceleration'] = (bool)$options['staticacceleration'];
}
if (!empty($options['staticaccelerationsize'])) {
$definition['staticaccelerationsize'] = (int)$options['staticaccelerationsize'];
}
if (!empty($options['overrideclass'])) {
$definition['overrideclass'] = $options['overrideclass'];
@@ -716,18 +727,53 @@ class cache_definition {
/**
* Returns true if this definitions cache should be made persistent.
*
* Please call {@link cache_definition::use_static_acceleration()} instead.
*
* @deprecated since 2.4.7
* @return bool
*/
public function should_be_persistent() {
return $this->persistent || $this->mode === cache_store::MODE_SESSION;
debugging('Please upgrade your code to use cache_definition::use_static_acceleration', DEBUG_DEVELOPER);
return $this->use_static_acceleration();
}
/**
* Returns the max size for the persistent item array in the cache.
* Returns true if we should hold onto the data flowing through the cache.
*
* If set to true data flowing through the cache will be stored in a static variable
* to make subsequent requests for the data much faster.
*
* @return bool
*/
public function use_static_acceleration() {
if ($this->mode === cache_store::MODE_REQUEST) {
// Request caches should never use static acceleration - it just doesn't make sense.
return false;
}
return $this->staticacceleration || $this->mode === cache_store::MODE_SESSION;
}
/**
* Returns the max size for the static acceleration array.
*
* Please call {@link cache_definition::get_static_acceleration_size()} instead.
*
* @see cache_definition::get_static_acceleration_size()
* @deprecated since 2.4.7
* @return int
*/
public function get_persistent_max_size() {
return $this->persistentmaxsize;
debugging('Please upgrade your code to call cache_definition::get_static_acceleration_size', DEBUG_DEVELOPER);
return $this->get_static_acceleration_size();
}
/**
* Returns the max size for the static acceleration array.
* @return int
*/
public function get_static_acceleration_size() {
return $this->staticaccelerationsize;
}
/**
@@ -821,4 +867,4 @@ class cache_definition {
protected function get_cache_identifier() {
return cache_helper::get_site_identifier();
}
}
}
+9 -8
View File
@@ -46,14 +46,15 @@ class cachestore_dummy extends cache_store {
protected $name;
/**
* Gets set to true if this store is going to persist data.
* This happens when the definition doesn't require it as the loader will not be persisting information and something has to.
* Gets set to true if this store is going to store data.
* This happens when the definition doesn't require static acceleration as the loader will not be storing information and
* something has to.
* @var bool
*/
protected $persist = false;
/**
* The persistent store array
* The stored data array
* @var array
*/
protected $store = array();
@@ -106,13 +107,13 @@ class cachestore_dummy extends cache_store {
* @param cache_definition $definition
*/
public function initialise(cache_definition $definition) {
// If the definition isn't persistent then we need to be persistent here.
// If the definition isn't using static acceleration then we need to be store data here.
// The reasoning behind this is that:
// - If the definition is persistent then the cache loader is going to
// store things in its persistent cache.
// - If the definition is not persistent then the cache loader won't try to store anything
// - If the definition is using static acceleration then the cache loader is going to
// store things in its static array.
// - If the definition is not using static acceleration then the cache loader won't try to store anything
// and we will need to store it here in order to make sure it is accessible.
$this->persist = !$definition->should_be_persistent();
$this->persist = !$definition->use_static_acceleration();
}
/**
+29 -10
View File
@@ -150,9 +150,7 @@ class cache_factory {
*/
public static function reset() {
$factory = self::instance();
$factory->cachesfromdefinitions = array();
$factory->cachesfromparams = array();
$factory->stores = array();
$factory->reset_cache_instances();
$factory->configs = array();
$factory->definitions = array();
$factory->lockplugins = array(); // MUST be null in order to force its regeneration.
@@ -160,6 +158,18 @@ class cache_factory {
$factory->state = self::STATE_UNINITIALISED;
}
/**
* Resets the stores, clearing the array of created stores.
*
* Cache objects still held onto by the code that initialised them will remain as is
* however all future requests for a cache/store will lead to a new instance being re-initialised.
*/
public function reset_cache_instances() {
$this->cachesfromdefinitions = array();
$this->cachesfromparams = array();
$this->stores = array();
}
/**
* Creates a cache object given the parameters for a definition.
*
@@ -181,9 +191,8 @@ class cache_factory {
$definition = $this->create_definition($component, $area, $aggregate);
$definition->set_identifiers($identifiers);
$cache = $this->create_cache($definition, $identifiers);
if ($definition->should_be_persistent()) {
$this->cachesfromdefinitions[$definitionname] = $cache;
}
// Loaders are always held onto to speed up subsequent requests.
$this->cachesfromdefinitions[$definitionname] = $cache;
return $cache;
}
@@ -199,7 +208,8 @@ class cache_factory {
* @param array $options An array of options, available options are:
* - simplekeys : Set to true if the keys you will use are a-zA-Z0-9_
* - simpledata : Set to true if the type of the data you are going to store is scalar, or an array of scalar vars
* - persistent : If set to true the cache will persist construction requests.
* - staticacceleration : If set to true the cache will hold onto data passing through it.
* - staticaccelerationsize : The maximum number of items to hold onto for acceleration purposes.
* @return cache_application|cache_session|cache_request
*/
public function create_cache_from_params($mode, $component, $area, array $identifiers = array(), array $options = array()) {
@@ -210,9 +220,7 @@ class cache_factory {
$definition = cache_definition::load_adhoc($mode, $component, $area, $options);
$definition->set_identifiers($identifiers);
$cache = $this->create_cache($definition, $identifiers);
if ($definition->should_be_persistent()) {
$this->cachesfromparams[$key] = $cache;
}
$this->cachesfromparams[$key] = $cache;
return $cache;
}
@@ -297,6 +305,15 @@ class cache_factory {
return $this->definitionstores[$id];
}
/**
* Returns the cache instances that have been used within this request.
* @since 2.4.7
* @return array
*/
public function get_caches_in_use() {
return $this->cachesfromdefinitions;
}
/**
* Creates a cache config instance with the ability to write if required.
*
@@ -585,7 +602,9 @@ class cache_factory {
* </code>
*/
public static function disable_stores() {
// First reset to clear any static acceleration array.
$factory = self::instance();
$factory->reset_cache_instances();
$factory->set_state(self::STATE_STORES_DISABLED);
}
}
+32 -20
View File
@@ -238,19 +238,24 @@ class cache_helper {
$instance = cache_config::instance();
$invalidationeventset = false;
$factory = cache_factory::instance();
$inuse = $factory->get_caches_in_use();
foreach ($instance->get_definitions() as $name => $definitionarr) {
$definition = cache_definition::load($name, $definitionarr);
if ($definition->invalidates_on_event($event)) {
// OK at this point we know that the definition has information to invalidate on the event.
// There are two routes, either its an application cache in which case we can invalidate it now.
// or it is a persistent cache that also needs to be invalidated now.
if ($definition->get_mode() === cache_store::MODE_APPLICATION || $definition->should_be_persistent()) {
$cache = $factory->create_cache_from_definition($definition->get_component(), $definition->get_area());
$cache->delete_many($keys);
// First up check if there is a cache loader for this definition already.
// If there is we need to invalidate the keys from there.
$definitionkey = $definition->get_component().'/'.$definition->get_area();
if (isset($inuse[$definitionkey])) {
$inuse[$definitionkey]->delete_many($keys);
}
// We need to flag the event in the "Event invalidation" cache if it hasn't already happened.
if ($invalidationeventset === false) {
// We should only log events for application and session caches.
// Request caches shouldn't have events as all data is lost at the end of the request.
// Events should only be logged once of course and likely several definitions are watching so we
// track its logging with $invalidationeventset.
$logevent = ($invalidationeventset === false && $definition->get_mode() !== cache_store::MODE_REQUEST);
if ($logevent) {
// Get the event invalidation cache.
$cache = cache::make('core', 'eventinvalidation');
// Get any existing invalidated keys for this cache.
@@ -307,23 +312,25 @@ class cache_helper {
$instance = cache_config::instance();
$invalidationeventset = false;
$factory = cache_factory::instance();
$inuse = $factory->get_caches_in_use();
foreach ($instance->get_definitions() as $name => $definitionarr) {
$definition = cache_definition::load($name, $definitionarr);
if ($definition->invalidates_on_event($event)) {
// Check if this definition would result in a persistent loader being in use.
if ($definition->should_be_persistent()) {
// There may be a persistent cache loader. Lets purge that first so that any persistent data is removed.
$cache = $factory->create_cache_from_definition($definition->get_component(), $definition->get_area());
$cache->purge();
}
// Get all of the store instances that are in use for this store.
$stores = $factory->get_store_instances_in_use($definition);
foreach ($stores as $store) {
// Purge each store individually.
$store->purge();
// First up check if there is a cache loader for this definition already.
// If there is we need to invalidate the keys from there.
$definitionkey = $definition->get_component().'/'.$definition->get_area();
if (isset($inuse[$definitionkey])) {
$inuse[$definitionkey]->purge();
}
// We should only log events for application and session caches.
// Request caches shouldn't have events as all data is lost at the end of the request.
// Events should only be logged once of course and likely several definitions are watching so we
// track its logging with $invalidationeventset.
$logevent = ($invalidationeventset === false && $definition->get_mode() !== cache_store::MODE_REQUEST);
// We need to flag the event in the "Event invalidation" cache if it hasn't already happened.
if ($invalidationeventset === false) {
if ($logevent && $invalidationeventset === false) {
// Get the event invalidation cache.
$cache = cache::make('core', 'eventinvalidation');
// Create a key to invalidate all.
@@ -345,6 +352,11 @@ class cache_helper {
* @param string $definition
*/
protected static function ensure_ready_for_stats($store, $definition) {
// This function is performance-sensitive, so exit as quickly as possible
// if we do not need to do anything.
if (isset(self::$stats[$definition][$store])) {
return;
}
if (!array_key_exists($definition, self::$stats)) {
self::$stats[$definition] = array(
$store => array(
+287 -208
View File
@@ -93,41 +93,46 @@ class cache implements cache_loader {
private $supportsnativettl = null;
/**
* Gets set to true if the cache is going to be using the build in static "persist" cache.
* The persist cache statically caches items used during the lifetime of the request. This greatly speeds up interaction
* Gets set to true if the cache is going to be using a static array for acceleration.
* The array statically caches items used during the lifetime of the request. This greatly speeds up interaction
* with the cache in areas where it will be repetitively hit for the same information such as with strings.
* There are several other variables to control how this persist cache works.
* There are several other variables to control how this static acceleration array works.
* @var bool
*/
private $persist = false;
private $staticacceleration = false;
/**
* The persist cache itself.
* The static acceleration array.
* Items will be stored in this cache as they were provided. This ensure there is no unnecessary processing taking place.
* @var array
*/
private $persistcache = array();
private $staticaccelerationarray = array();
/**
* The number of items in the persist cache. Avoids count calls like you wouldn't believe.
* The number of items in the static acceleration array. Avoids count calls like you wouldn't believe.
* @var int
*/
private $persistcount = 0;
private $staticaccelerationcount = 0;
/**
* An array containing just the keys being used in the persist cache.
* This seems redundant perhaps but is used when managing the size of the persist cache.
* An array containing just the keys being used in the static acceleration array.
* This seems redundant perhaps but is used when managing the size of the static acceleration array.
* Items are added to the end of the array and the when we need to reduce the size of the cache we use the
* key that is first on this array.
* @var array
*/
private $persistkeys = array();
private $staticaccelerationkeys = array();
/**
* The maximum size of the persist cache. If set to false there is no max size.
* Caches that make use of the persist cache should seriously consider setting this to something reasonably small, but
* The maximum size of the static acceleration array.
*
* If set to false there is no max size.
* Caches that make use of static acceleration should seriously consider setting this to something reasonably small, but
* still large enough to offset repetitive calls.
*
* @var int|false
*/
private $persistmaxsize = false;
private $staticaccelerationsize = false;
/**
* Gets set to true during initialisation if the definition is making use of a ttl.
@@ -179,7 +184,8 @@ class cache implements cache_loader {
* @param array $options An array of options, available options are:
* - simplekeys : Set to true if the keys you will use are a-zA-Z0-9_
* - simpledata : Set to true if the type of the data you are going to store is scalar, or an array of scalar vars
* - persistent : If set to true the cache will persist construction requests.
* - staticacceleration : If set to true the cache will hold onto data passing through it.
* - staticaccelerationsize : The max size for the static acceleration array.
* @return cache_application|cache_session|cache_store
*/
public static function make_from_params($mode, $component, $area, array $identifiers = array(), array $options = array()) {
@@ -216,9 +222,9 @@ class cache implements cache_loader {
$this->datasource = $loader;
}
$this->definition->generate_definition_hash();
$this->persist = $this->definition->should_be_persistent();
if ($this->persist) {
$this->persistmaxsize = $this->definition->get_persistent_max_size();
$this->staticacceleration = $this->definition->use_static_acceleration();
if ($this->staticacceleration) {
$this->staticaccelerationsize = $this->definition->get_static_acceleration_size();
}
$this->hasattl = ($this->definition->get_ttl() > 0);
}
@@ -226,7 +232,7 @@ class cache implements cache_loader {
/**
* Used to inform the loader of its state as a sub loader, or as the top of the chain.
*
* This is important as it ensures that we do not have more than one loader keeping persistent data.
* This is important as it ensures that we do not have more than one loader keeping static acceleration data.
* Subloaders need to be "pure" loaders in the sense that they are used to store and retrieve information from stores or the
* next loader/data source in the chain.
* Nothing fancy, nothing flash.
@@ -236,14 +242,14 @@ class cache implements cache_loader {
protected function set_is_sub_loader($setting = true) {
if ($setting) {
$this->subloader = true;
// Subloaders should not keep persistent data.
$this->persist = false;
$this->persistmaxsize = false;
// Subloaders should not keep static acceleration data.
$this->staticacceleration = false;
$this->staticaccelerationsize = false;
} else {
$this->subloader = true;
$this->persist = $this->definition->should_be_persistent();
if ($this->persist) {
$this->persistmaxsize = $this->definition->get_persistent_max_size();
$this->staticacceleration = $this->definition->use_static_acceleration();
if ($this->staticacceleration) {
$this->staticaccelerationsize = $this->definition->get_static_acceleration_size();
}
}
}
@@ -269,12 +275,12 @@ class cache implements cache_loader {
* In advanced cases an array may be useful such as in situations requiring the multi-key functionality.
* @param int $strictness One of IGNORE_MISSING | MUST_EXIST
* @return mixed|false The data from the cache or false if the key did not exist within the cache.
* @throws moodle_exception
* @throws coding_exception
*/
public function get($key, $strictness = IGNORE_MISSING) {
// 1. Parse the key.
$parsedkey = $this->parse_key($key);
// 2. Get it from the persist cache if we can (only when persist is enabled and it has already been requested/set).
// 2. Get it from the static acceleration array if we can (only when it is enabled and it has already been requested/set).
$result = false;
if ($this->is_using_persist_cache()) {
$result = $this->get_from_persist_cache($parsedkey);
@@ -289,7 +295,7 @@ class cache implements cache_loader {
}
return $result;
}
// 3. Get it from the store. Obviously wasn't in the persist cache.
// 3. Get it from the store. Obviously wasn't in the static acceleration array.
$result = $this->store->get($parsedkey);
if ($result !== false) {
if ($result instanceof cache_ttl_wrapper) {
@@ -327,7 +333,7 @@ class cache implements cache_loader {
}
// 5. Validate strictness.
if ($strictness === MUST_EXIST && $result === false) {
throw new moodle_exception('Requested key did not exist in any cache stores and could not be loaded.');
throw new coding_exception('Requested key did not exist in any cache stores and could not be loaded.');
}
// 6. Set it to the store if we got it from the loader/datasource.
if ($setaftervalidation) {
@@ -361,7 +367,7 @@ class cache implements cache_loader {
* @return array An array of key value pairs for the items that could be retrieved from the cache.
* If MUST_EXIST was used and not all keys existed within the cache then an exception will be thrown.
* Otherwise any key that did not exist will have a data value of false within the results.
* @throws moodle_exception
* @throws coding_exception
*/
public function get_many(array $keys, $strictness = IGNORE_MISSING) {
@@ -402,6 +408,9 @@ class cache implements cache_loader {
if ($value instanceof cache_cached_object) {
$value = $value->restore_object();
}
if ($value !== false && $this->is_using_persist_cache()) {
$this->set_in_persist_cache($key, $value);
}
$resultstore[$key] = $value;
}
}
@@ -418,7 +427,7 @@ class cache implements cache_loader {
$missingkeys = array();
foreach ($result as $key => $value) {
if ($value === false) {
$missingkeys[] = ($usingloader) ? $key : $parsedkeys[$key];
$missingkeys[] = $parsedkeys[$key];
}
}
if (!empty($missingkeys)) {
@@ -428,11 +437,9 @@ class cache implements cache_loader {
$resultmissing = $this->datasource->load_many_for_cache($missingkeys);
}
foreach ($resultmissing as $key => $value) {
$pkey = ($usingloader) ? $key : $keysparsed[$key];
$realkey = ($usingloader) ? $parsedkeys[$key] : $key;
$result[$pkey] = $value;
$result[$keysparsed[$key]] = $value;
if ($value !== false) {
$this->set($realkey, $value);
$this->set($key, $value);
}
}
unset($resultmissing);
@@ -451,7 +458,7 @@ class cache implements cache_loader {
if ($strictness === MUST_EXIST) {
foreach ($keys as $key) {
if (!array_key_exists($key, $fullresult)) {
throw new moodle_exception('Not all the requested keys existed within the cache stores.');
throw new coding_exception('Not all the requested keys existed within the cache stores.');
}
}
}
@@ -481,6 +488,11 @@ class cache implements cache_loader {
if ($this->perfdebug) {
cache_helper::record_cache_set($this->storetype, $this->definition->get_id());
}
if ($this->loader !== false) {
// We have a loader available set it there as well.
// We have to let the loader do its own parsing of data as it may be unique.
$this->loader->set($key, $data);
}
if (is_object($data) && $data instanceof cacheable_object) {
$data = new cache_cached_object($data);
} else if (!is_scalar($data)) {
@@ -504,6 +516,7 @@ class cache implements cache_loader {
* Removes references where required.
*
* @param stdClass|array $data
* @return mixed What ever was put in but without any references.
*/
protected function unref($data) {
if ($this->definition->uses_simple_data()) {
@@ -591,9 +604,14 @@ class cache implements cache_loader {
* ... if they care that is.
*/
public function set_many(array $keyvaluearray) {
if ($this->loader !== false) {
// We have a loader available set it there as well.
// We have to let the loader do its own parsing of data as it may be unique.
$this->loader->set_many($keyvaluearray);
}
$data = array();
$simulatettl = $this->has_a_ttl() && !$this->store_supports_native_ttl();
$usepersistcache = $this->is_using_persist_cache();
$usestaticaccelerationarray = $this->is_using_persist_cache();
foreach ($keyvaluearray as $key => $value) {
if (is_object($value) && $value instanceof cacheable_object) {
$value = new cache_cached_object($value);
@@ -611,7 +629,7 @@ class cache implements cache_loader {
'key' => $this->parse_key($key),
'value' => $value
);
if ($usepersistcache) {
if ($usestaticaccelerationarray) {
$this->set_in_persist_cache($data[$key]['key'], $value);
}
}
@@ -645,7 +663,7 @@ class cache implements cache_loader {
public function has($key, $tryloadifpossible = false) {
$parsedkey = $this->parse_key($key);
if ($this->is_in_persist_cache($parsedkey)) {
// Hoorah, that was easy. It exists in the persist cache so we definitely have it.
// Hoorah, that was easy. It exists in the static acceleration array so we definitely have it.
return true;
}
if ($this->has_a_ttl() && !$this->store_supports_native_ttl()) {
@@ -787,8 +805,12 @@ class cache implements cache_loader {
* @return bool True on success, false otherwise
*/
public function purge() {
// 1. Purge the persist cache.
$this->persistcache = array();
// 1. Purge the static acceleration array.
$this->staticaccelerationarray = array();
if ($this->staticaccelerationsize !== false) {
$this->staticaccelerationkeys = array();
$this->staticaccelerationcount = 0;
}
// 2. Purge the store.
$this->store->purge();
// 3. Optionally pruge any stacked loaders.
@@ -856,7 +878,7 @@ class cache implements cache_loader {
* Returns the loader associated with this instance.
*
* @since 2.4.4
* @return cache_loader|false
* @return cache|false
*/
protected function get_loader() {
return $this->loader;
@@ -897,49 +919,56 @@ class cache implements cache_loader {
}
/**
* Returns true if this cache is making use of the persist cache.
* Returns true if this cache is making use of the static acceleration array.
*
* @return bool
*/
protected function is_using_persist_cache() {
return $this->persist;
return $this->staticacceleration;
}
/**
* Returns true if the requested key exists within the persist cache.
* Returns true if the requested key exists within the static acceleration array.
*
* @param string $key The parsed key
* @return bool
*/
protected function is_in_persist_cache($key) {
if (is_array($key)) {
// This method of checking if an array was supplied is faster than is_array.
if ($key === (array)$key) {
$key = $key['key'];
}
// This could be written as a single line, however it has been split because the ttl check is faster than the instanceof
// and has_expired calls.
if (!$this->persist || !array_key_exists($key, $this->persistcache)) {
if (!$this->staticacceleration || !array_key_exists($key, $this->staticaccelerationarray)) {
return false;
}
if ($this->has_a_ttl() && $this->store_supports_native_ttl()) {
return !($this->persistcache[$key] instanceof cache_ttl_wrapper && $this->persistcache[$key]->has_expired());
return !($this->staticaccelerationarray[$key] instanceof cache_ttl_wrapper &&
$this->staticaccelerationarray[$key]->has_expired());
}
return true;
}
/**
* Returns the item from the persist cache if it exists there.
* Returns the item from the static acceleration array if it exists there.
*
* @param string $key The parsed key
* @return mixed|false The data from the persist cache or false if it wasn't there.
* @return mixed|false The data from the static acceleration array or false if it wasn't there.
*/
protected function get_from_persist_cache($key) {
if (is_array($key)) {
// This method of checking if an array was supplied is faster than is_array.
if ($key === (array)$key) {
$key = $key['key'];
}
if (!$this->persist || !array_key_exists($key, $this->persistcache)) {
// This isset check is faster than array_key_exists but will return false
// for null values, meaning null values will come from backing store not
// the static acceleration array. We think this okay because null usage should be
// very rare (see comment in MDL-39472).
if (!$this->staticacceleration || !isset($this->staticaccelerationarray[$key])) {
$result = false;
} else {
$data = $this->persistcache[$key];
$data = $this->staticaccelerationarray[$key];
if (!$this->has_a_ttl() || !$data instanceof cache_ttl_wrapper) {
if ($data instanceof cache_cached_object) {
$data = $data->restore_object();
@@ -957,53 +986,68 @@ class cache implements cache_loader {
}
if ($result) {
if ($this->perfdebug) {
cache_helper::record_cache_hit('** static persist **', $this->definition->get_id());
cache_helper::record_cache_hit('** static acceleration **', $this->definition->get_id());
}
if ($this->staticaccelerationsize > 1 && $this->staticaccelerationcount > 1) {
// Check to see if this is the last item on the static acceleration keys array.
if (end($this->staticaccelerationkeys) !== $key) {
// It isn't the last item.
// Move the item to the end of the array so that it is last to be removed.
unset($this->staticaccelerationkeys[$key]);
$this->staticaccelerationkeys[$key] = $key;
}
}
return $result;
} else {
if ($this->perfdebug) {
cache_helper::record_cache_miss('** static persist **', $this->definition->get_id());
cache_helper::record_cache_miss('** static acceleration **', $this->definition->get_id());
}
return false;
}
}
/**
* Sets a key value pair into the persist cache.
* Sets a key value pair into the static acceleration array.
*
* @param string $key The parsed key
* @param mixed $data
* @return bool
*/
protected function set_in_persist_cache($key, $data) {
if (is_array($key)) {
// This method of checking if an array was supplied is faster than is_array.
if ($key === (array)$key) {
$key = $key['key'];
}
$this->persistcache[$key] = $data;
if ($this->persistmaxsize !== false) {
$this->persistcount++;
if ($this->persistcount > $this->persistmaxsize) {
$dropkey = array_shift($this->persistkeys);
unset($this->persistcache[$dropkey]);
$this->persistcount--;
if ($this->staticaccelerationsize !== false && isset($this->staticaccelerationkeys[$key])) {
$this->staticaccelerationcount--;
unset($this->staticaccelerationkeys[$key]);
}
$this->staticaccelerationarray[$key] = $data;
if ($this->staticaccelerationsize !== false) {
$this->staticaccelerationcount++;
$this->staticaccelerationkeys[$key] = $key;
if ($this->staticaccelerationcount > $this->staticaccelerationsize) {
$dropkey = array_shift($this->staticaccelerationkeys);
unset($this->staticaccelerationarray[$dropkey]);
$this->staticaccelerationcount--;
}
}
return true;
}
/**
* Deletes an item from the persist cache.
* Deletes an item from the static acceleration array.
*
* @param string|int $key As given to get|set|delete
* @return bool True on success, false otherwise.
*/
protected function delete_from_persist_cache($key) {
unset($this->persistcache[$key]);
if ($this->persistmaxsize !== false) {
$dropkey = array_search($key, $this->persistkeys);
unset($this->staticaccelerationarray[$key]);
if ($this->staticaccelerationsize !== false) {
$dropkey = array_search($key, $this->staticaccelerationkeys);
if ($dropkey) {
unset($this->persistkeys[$dropkey]);
$this->persistcount--;
unset($this->staticaccelerationkeys[$dropkey]);
$this->staticaccelerationcount--;
}
}
return true;
@@ -1321,7 +1365,6 @@ class cache_application extends cache implements cache_loader_with_locking {
* @param string|int $key The key for the data being requested.
* @param int $strictness One of IGNORE_MISSING | MUST_EXIST
* @return mixed|false The data from the cache or false if the key did not exist within the cache.
* @throws moodle_exception
*/
public function get($key, $strictness = IGNORE_MISSING) {
if ($this->requirelockingread && $this->check_lock_state($key) === false) {
@@ -1345,7 +1388,7 @@ class cache_application extends cache implements cache_loader_with_locking {
* @return array An array of key value pairs for the items that could be retrieved from the cache.
* If MUST_EXIST was used and not all keys existed within the cache then an exception will be thrown.
* Otherwise any key that did not exist will have a data value of false within the results.
* @throws moodle_exception
* @throws coding_exception
*/
public function get_many(array $keys, $strictness = IGNORE_MISSING) {
if ($this->requirelockingread) {
@@ -1421,9 +1464,8 @@ class cache_application extends cache implements cache_loader_with_locking {
* This class is used for session caches returned by the cache::make methods.
*
* It differs from the application loader in a couple of noteable ways:
* 1. Sessions are always expected to be persistent.
* Because of this we don't ever use the persist cache and instead a session array
* containing all of the data is maintained by this object.
* 1. Sessions are always expected to exist.
* Because of this we don't ever use the static acceleration array.
* 2. Session data for a loader instance (store + definition) is consolidate into a
* single array for storage within the store.
* Along with this we embed a lastaccessed time with the data. This way we can
@@ -1439,6 +1481,7 @@ class cache_application extends cache implements cache_loader_with_locking {
* @todo we should support locking in the session as well. Should be pretty simple to set up.
*
* @internal don't use me directly.
* @method cache_store|cache_is_searchable get_store() Returns the cache store which must implement both cache_is_searchable.
*
* @package core
* @category cache
@@ -1475,6 +1518,11 @@ class cache_session extends cache {
*/
const KEY_PREFIX = 'sess_';
/**
* This is the key used to track last access.
*/
const LASTACCESS = '__lastaccess__';
/**
* Override the cache::construct method.
*
@@ -1488,12 +1536,15 @@ class cache_session extends cache {
* @param cache_definition $definition
* @param cache_store $store
* @param cache_loader|cache_data_source $loader
* @return void
*/
public function __construct(cache_definition $definition, cache_store $store, $loader = null) {
// First up copy the loadeduserid to the current user id.
$this->currentuserid = self::$loadeduserid;
parent::__construct($definition, $store, $loader);
// This will trigger check tracked user. If this gets removed a call to that will need to be added here in its place.
$this->set(self::LASTACCESS, cache::now());
if ($definition->has_invalidation_events()) {
$lastinvalidation = $this->get('lastsessioninvalidation');
if ($lastinvalidation === false) {
@@ -1542,6 +1593,21 @@ class cache_session extends cache {
}
}
/**
* Sets the session id for the loader.
*/
protected function set_session_id() {
$this->sessionid = preg_replace('#[^a-zA-Z0-9_]#', '_', session_id());
}
/**
* Returns the prefix used for all keys.
* @return string
*/
protected function get_key_prefix() {
return 'u'.$this->currentuserid.'_'.$this->sessionid;
}
/**
* Parses the key turning it into a string (or array is required) suitable to be passed to the cache store.
*
@@ -1554,17 +1620,18 @@ class cache_session extends cache {
* @return string|array String unless the store supports multi-identifiers in which case an array if returned.
*/
protected function parse_key($key) {
if ($key === 'lastaccess') {
$key = '__lastaccess__';
$prefix = $this->get_key_prefix();
if ($key === self::LASTACCESS) {
return $key.$prefix;
}
return 'sess_'.parent::parse_key($key);
return $prefix.'_'.parent::parse_key($key);
}
/**
* Check that this cache instance is tracking the current user.
*/
protected function check_tracked_user() {
if (isset($_SESSION['USER']->id)) {
if (isset($_SESSION['USER']->id) && $_SESSION['USER']->id !== null) {
// Get the id of the current user.
$new = $_SESSION['USER']->id;
} else {
@@ -1578,55 +1645,25 @@ class cache_session extends cache {
// This way we don't bloat the session.
$this->purge();
// Update the session id just in case!
$this->sessionid = session_id();
$this->set_session_id();
}
self::$loadeduserid = $new;
$this->currentuserid = $new;
} else if ($new !== $this->currentuserid) {
// The current user matches the loaded user but not the user last used by this cache.
$this->purge();
$this->purge_current_user();
$this->currentuserid = $new;
// Update the session id just in case!
$this->sessionid = session_id();
$this->set_session_id();
}
}
/**
* Gets the session data.
*
* @param bool $force If true the session data will be loaded from the store again.
* @return array An array of session data.
* Purges the session cache of all data belonging to the current user.
*/
protected function get_session_data($force = false) {
if ($this->sessionid === null) {
$this->sessionid = session_id();
}
if (is_array($this->session) && !$force) {
return $this->session;
}
$session = parent::get($this->sessionid);
if ($session === false) {
$session = array();
}
// We have to write here to ensure that the lastaccess time is recorded.
// And also in order to ensure the session entry exists as when we save it on __destruct
// $CFG is likely to have already been destroyed.
$this->save_session($session);
return $this->session;
}
/**
* Saves the session data.
*
* This function also updates the last access time.
*
* @param array $session
* @return bool
*/
protected function save_session(array $session) {
$session['lastaccess'] = time();
$this->session = $session;
return parent::set($this->sessionid, $this->session);
public function purge_current_user() {
$keys = $this->get_store()->find_all($this->get_key_prefix());
$this->get_store()->delete_many($keys);
}
/**
@@ -1637,7 +1674,7 @@ class cache_session extends cache {
* In advanced cases an array may be useful such as in situations requiring the multi-key functionality.
* @param int $strictness One of IGNORE_MISSING | MUST_EXIST
* @return mixed|false The data from the cache or false if the key did not exist within the cache.
* @throws moodle_exception
* @throws coding_exception
*/
public function get($key, $strictness = IGNORE_MISSING) {
// Check the tracked user.
@@ -1645,10 +1682,8 @@ class cache_session extends cache {
// 2. Parse the key.
$parsedkey = $this->parse_key($key);
// 3. Get it from the store.
$result = false;
$session = $this->get_session_data();
if (array_key_exists($parsedkey, $session)) {
$result = $session[$parsedkey];
$result = $this->get_store()->get($parsedkey);
if ($result !== false) {
if ($result instanceof cache_ttl_wrapper) {
if ($result->has_expired()) {
$this->get_store()->delete($parsedkey);
@@ -1662,10 +1697,9 @@ class cache_session extends cache {
}
}
// 4. Load if from the loader/datasource if we don't already have it.
$setaftervalidation = false;
if ($result === false) {
if ($this->perfdebug) {
cache_helper::record_cache_miss('**static session**', $this->get_definition()->get_id());
cache_helper::record_cache_miss($this->storetype, $this->get_definition()->get_id());
}
if ($this->get_loader() !== false) {
// We must pass the original (unparsed) key to the next loader in the chain.
@@ -1675,19 +1709,18 @@ class cache_session extends cache {
} else if ($this->get_datasource() !== false) {
$result = $this->get_datasource()->load_for_cache($key);
}
$setaftervalidation = ($result !== false);
// 5. Set it to the store if we got it from the loader/datasource.
if ($result !== false) {
$this->set($key, $result);
}
} else if ($this->perfdebug) {
cache_helper::record_cache_hit('**static session**', $this->get_definition()->get_id());
cache_helper::record_cache_hit($this->storetype, $this->get_definition()->get_id());
}
// 5. Validate strictness.
if ($strictness === MUST_EXIST && $result === false) {
throw new moodle_exception('Requested key did not exist in any cache stores and could not be loaded.');
throw new coding_exception('Requested key did not exist in any cache stores and could not be loaded.');
}
// 6. Set it to the store if we got it from the loader/datasource.
if ($setaftervalidation) {
$this->set($key, $result);
}
// 7. Make sure we don't pass back anything that could be a reference.
// 6. Make sure we don't pass back anything that could be a reference.
// We don't want people modifying the data in the cache.
if (!is_scalar($result)) {
// If data is an object it will be a reference.
@@ -1718,8 +1751,14 @@ class cache_session extends cache {
*/
public function set($key, $data) {
$this->check_tracked_user();
$loader = $this->get_loader();
if ($loader !== false) {
// We have a loader available set it there as well.
// We have to let the loader do its own parsing of data as it may be unique.
$loader->set($key, $data);
}
if ($this->perfdebug) {
cache_helper::record_cache_set('**static session**', $this->get_definition()->get_id());
cache_helper::record_cache_set($this->storetype, $this->get_definition()->get_id());
}
if (is_object($data) && $data instanceof cacheable_object) {
$data = new cache_cached_object($data);
@@ -1731,12 +1770,10 @@ class cache_session extends cache {
$data = $this->unref($data);
}
// We dont' support native TTL here as we consolidate data for sessions.
if ($this->has_a_ttl()) {
if ($this->has_a_ttl() && !$this->store_supports_native_ttl()) {
$data = new cache_ttl_wrapper($data, $this->get_definition()->get_ttl());
}
$session = $this->get_session_data();
$session[$this->parse_key($key)] = $data;
return $this->save_session($session);
return $this->get_store()->set($this->parse_key($key), $data);
}
/**
@@ -1748,15 +1785,12 @@ class cache_session extends cache {
* @return bool True of success, false otherwise.
*/
public function delete($key, $recurse = true) {
$this->check_tracked_user();
$parsedkey = $this->parse_key($key);
if ($recurse && $this->get_loader() !== false) {
// Delete from the bottom of the stack first.
$this->get_loader()->delete($key, $recurse);
}
$session = $this->get_session_data();
unset($session[$parsedkey]);
return $this->save_session($session);
return $this->get_store()->delete($parsedkey);
}
/**
@@ -1775,15 +1809,72 @@ class cache_session extends cache {
* @return array An array of key value pairs for the items that could be retrieved from the cache.
* If MUST_EXIST was used and not all keys existed within the cache then an exception will be thrown.
* Otherwise any key that did not exist will have a data value of false within the results.
* @throws moodle_exception
* @throws coding_exception
*/
public function get_many(array $keys, $strictness = IGNORE_MISSING) {
$this->check_tracked_user();
$return = array();
$parsedkeys = array();
$keymap = array();
foreach ($keys as $key) {
$return[$key] = $this->get($key, $strictness);
$parsedkey = $this->parse_key($key);
$parsedkeys[$key] = $parsedkey;
$keymap[$parsedkey] = $key;
}
$result = $this->get_store()->get_many($parsedkeys);
$return = array();
$missingkeys = array();
$hasmissingkeys = false;
foreach ($result as $parsedkey => $value) {
$key = $keymap[$parsedkey];
if ($value instanceof cache_ttl_wrapper) {
/* @var cache_ttl_wrapper $value */
if ($value->has_expired()) {
$this->delete($keymap[$parsedkey]);
$value = false;
} else {
$value = $value->data;
}
}
if ($value instanceof cache_cached_object) {
/* @var cache_cached_object $value */
$value = $value->restore_object();
}
$return[$key] = $value;
if ($value === false) {
$hasmissingkeys = true;
$missingkeys[$parsedkey] = $key;
}
}
if ($hasmissingkeys) {
// We've got missing keys - we've got to check any loaders or data sources.
$loader = $this->get_loader();
$datasource = $this->get_datasource();
if ($loader !== false) {
foreach ($loader->get_many($missingkeys) as $key => $value) {
if ($value !== false) {
$return[$key] = $value;
unset($missingkeys[$parsedkeys[$key]]);
}
}
}
$hasmissingkeys = count($missingkeys) > 0;
if ($datasource !== false && $hasmissingkeys) {
// We're still missing keys but we've got a datasource.
foreach ($datasource->load_many_for_cache($missingkeys) as $key => $value) {
if ($value !== false) {
$return[$key] = $value;
unset($missingkeys[$parsedkeys[$key]]);
}
}
$hasmissingkeys = count($missingkeys) > 0;
}
}
if ($hasmissingkeys && $strictness === MUST_EXIST) {
throw new coding_exception('Requested key did not exist in any cache stores and could not be loaded.');
}
return $return;
}
/**
@@ -1795,18 +1886,12 @@ class cache_session extends cache {
* @return int The number of items successfully deleted.
*/
public function delete_many(array $keys, $recurse = true) {
$this->check_tracked_user();
$parsedkeys = array_map(array($this, 'parse_key'), $keys);
if ($recurse && $this->get_loader() !== false) {
// Delete from the bottom of the stack first.
$this->get_loader()->delete_many($keys, $recurse);
}
$session = $this->get_session_data();
foreach ($parsedkeys as $parsedkey) {
unset($session[$parsedkey]);
}
$this->save_session($session);
return count($keys);
return $this->get_store()->delete_many($parsedkeys);
}
/**
@@ -1834,8 +1919,15 @@ class cache_session extends cache {
*/
public function set_many(array $keyvaluearray) {
$this->check_tracked_user();
$session = $this->get_session_data();
$simulatettl = $this->has_a_ttl();
$loader = $this->get_loader();
if ($loader !== false) {
// We have a loader available set it there as well.
// We have to let the loader do its own parsing of data as it may be unique.
$loader->set_many($keyvaluearray);
}
$data = array();
$definitionid = $this->get_definition()->get_ttl();
$simulatettl = $this->has_a_ttl() && !$this->store_supports_native_ttl();
foreach ($keyvaluearray as $key => $value) {
if (is_object($value) && $value instanceof cacheable_object) {
$value = new cache_cached_object($value);
@@ -1847,16 +1939,17 @@ class cache_session extends cache {
$value = $this->unref($value);
}
if ($simulatettl) {
$value = new cache_ttl_wrapper($value, $this->get_definition()->get_ttl());
$value = new cache_ttl_wrapper($value, $definitionid);
}
$parsedkey = $this->parse_key($key);
$session[$parsedkey] = $value;
$data[$key] = array(
'key' => $this->parse_key($key),
'value' => $value
);
}
if ($this->perfdebug) {
cache_helper::record_cache_set($this->storetype, $this->get_definition()->get_id());
cache_helper::record_cache_set($this->storetype, $definitionid);
}
$this->save_session($session);
return count($keyvaluearray);
return $this->get_store()->set_many($data);
}
/**
@@ -1865,13 +1958,9 @@ class cache_session extends cache {
* @return bool True on success, false otherwise
*/
public function purge() {
// 1. Purge the session object.
$this->session = array();
// 2. Delete the record for this users session from the store.
$this->get_store()->delete($this->sessionid);
// 3. Optionally purge any stacked loaders in the same way.
$this->get_store()->purge();
if ($this->get_loader()) {
$this->get_loader()->delete($this->sessionid);
$this->get_loader()->purge();
}
return true;
}
@@ -1900,21 +1989,27 @@ class cache_session extends cache {
public function has($key, $tryloadifpossible = false) {
$this->check_tracked_user();
$parsedkey = $this->parse_key($key);
$session = $this->get_session_data();
$has = false;
if ($this->has_a_ttl()) {
$store = $this->get_store();
if ($this->has_a_ttl() && !$this->store_supports_native_ttl()) {
// The data has a TTL and the store doesn't support it natively.
// We must fetch the data and expect a ttl wrapper.
if (array_key_exists($parsedkey, $session)) {
$data = $session[$parsedkey];
$has = ($data instanceof cache_ttl_wrapper && !$data->has_expired());
}
$data = $store->get($parsedkey);
$has = ($data instanceof cache_ttl_wrapper && !$data->has_expired());
} else if (!$this->store_supports_key_awareness()) {
// The store doesn't support key awareness, get the data and check it manually... puke.
// Either no TTL is set of the store supports its handling natively.
$data = $store->get($parsedkey);
$has = ($data !== false);
} else {
$has = array_key_exists($parsedkey, $session);
// The store supports key awareness, this is easy!
// Either no TTL is set of the store supports its handling natively.
/* @var cache_store|cache_is_key_aware $store */
$has = $store->has($parsedkey);
}
if (!$has && $tryloadifpossible) {
$result = null;
if ($this->get_loader() !== false) {
$result = $this->get_loader()->get($key);
$result = $this->get_loader()->get($parsedkey);
} else if ($this->get_datasource() !== null) {
$result = $this->get_datasource()->load_for_cache($key);
}
@@ -1941,25 +2036,18 @@ class cache_session extends cache {
*/
public function has_all(array $keys) {
$this->check_tracked_user();
$session = $this->get_session_data();
foreach ($keys as $key) {
$has = false;
$parsedkey = $this->parse_key($key);
if ($this->has_a_ttl()) {
// The data has a TTL and the store doesn't support it natively.
// We must fetch the data and expect a ttl wrapper.
if (array_key_exists($parsedkey, $session)) {
$data = $session[$parsedkey];
$has = ($data instanceof cache_ttl_wrapper && !$data->has_expired());
if (($this->has_a_ttl() && !$this->store_supports_native_ttl()) || !$this->store_supports_key_awareness()) {
foreach ($keys as $key) {
if (!$this->has($key)) {
return false;
}
} else {
$has = array_key_exists($parsedkey, $session);
}
if (!$has) {
return false;
}
return true;
}
return true;
// The cache must be key aware and if support native ttl if it a ttl is set.
/* @var cache_store|cache_is_key_aware $store */
$store = $this->get_store();
return $store->has_all(array_map(array($this, 'parse_key'), $keys));
}
/**
@@ -1976,30 +2064,21 @@ class cache_session extends cache {
* @return bool True if the cache has at least one of the given keys
*/
public function has_any(array $keys) {
$this->check_tracked_user();
$session = $this->get_session_data();
foreach ($keys as $key) {
$has = false;
$parsedkey = $this->parse_key($key);
if ($this->has_a_ttl()) {
// The data has a TTL and the store doesn't support it natively.
// We must fetch the data and expect a ttl wrapper.
if (array_key_exists($parsedkey, $session)) {
$data = $session[$parsedkey];
$has = ($data instanceof cache_ttl_wrapper && !$data->has_expired());
if (($this->has_a_ttl() && !$this->store_supports_native_ttl()) || !$this->store_supports_key_awareness()) {
foreach ($keys as $key) {
if ($this->has($key)) {
return true;
}
} else {
$has = array_key_exists($parsedkey, $session);
}
if ($has) {
return true;
}
return false;
}
return false;
/* @var cache_store|cache_is_key_aware $store */
$store = $this->get_store();
return $store->has_any(array_map(array($this, 'parse_key'), $keys));
}
/**
* The session loader never uses the persist cache.
* The session loader never uses static acceleration.
* Instead it stores things in the static $session variable. Shared between all session loaders.
*
* @return bool
+3 -3
View File
@@ -49,8 +49,7 @@ class cache_disabled extends cache {
* @param null $loader Unused.
*/
public function __construct(cache_definition $definition, cache_store $store, $loader = null) {
$this->definition = $definition;
$this->store = $store;
// Nothing to do here.
}
/**
@@ -228,7 +227,8 @@ class cache_factory_disabled extends cache_factory {
* @param array $options An array of options, available options are:
* - simplekeys : Set to true if the keys you will use are a-zA-Z0-9_
* - simpledata : Set to true if the type of the data you are going to store is scalar, or an array of scalar vars
* - persistent : If set to true the cache will persist construction requests.
* - staticacceleration : If set to true the cache will hold onto all data passing through it.
* - staticaccelerationsize : Sets the max size of the static acceleration array.
* @return cache_application|cache_session|cache_request
*/
public function create_cache_from_params($mode, $component, $area, array $identifiers = array(), array $options = array()) {
-1
View File
@@ -27,7 +27,6 @@
*/
require_once($CFG->dirroot.'/cache/forms.php');
require_once($CFG->dirroot.'/cache/stores/file/lib.php');
/**
* Form for adding a file instance.
+46 -14
View File
@@ -101,6 +101,19 @@ class cachestore_file extends cache_store implements cache_is_key_aware, cache_i
*/
protected $definition;
/**
* A reference to the global $CFG object.
*
* You may be asking yourself why on earth this is here, but there is a good reason.
* By holding onto a reference of the $CFG object we can be absolutely sure that it won't be destroyed before
* we are done with it.
* This makes it possible to use a cache within a destructor method for the purposes of
* delayed writes. Like how the session mechanisms work.
*
* @var stdClass
*/
private $cfg = null;
/**
* Constructs the store instance.
*
@@ -111,6 +124,13 @@ class cachestore_file extends cache_store implements cache_is_key_aware, cache_i
* @param array $configuration
*/
public function __construct($name, array $configuration = array()) {
global $CFG;
if (isset($CFG)) {
// Hold onto a reference of the global $CFG object.
$this->cfg = $CFG;
}
$this->name = $name;
if (array_key_exists('path', $configuration) && $configuration['path'] !== '') {
$this->custompath = true;
@@ -246,7 +266,7 @@ class cachestore_file extends cache_store implements cache_is_key_aware, cache_i
$this->definition = $definition;
$hash = preg_replace('#[^a-zA-Z0-9]+#', '_', $this->definition->get_id());
$this->path = $this->filestorepath.'/'.$hash;
make_writable_directory($this->path);
make_writable_directory($this->path, false);
if ($this->prescan && $definition->get_mode() !== self::MODE_REQUEST) {
$this->prescan = false;
}
@@ -294,11 +314,13 @@ class cachestore_file extends cache_store implements cache_is_key_aware, cache_i
return $this->path . '/' . $key . '.cache';
} else {
// We are using a single subdirectory to achieve 1 level.
$subdir = substr($key, 0, 3);
// We suffix the subdir so it does not clash with any windows
// reserved filenames like 'con'.
$subdir = substr($key, 0, 3) . '-cache';
$dir = $this->path . '/' . $subdir;
if ($create) {
// Create the directory. This function does it recursivily!
make_writable_directory($dir);
make_writable_directory($dir, false);
}
return $dir . '/' . $key . '.cache';
}
@@ -330,23 +352,19 @@ class cachestore_file extends cache_store implements cache_is_key_aware, cache_i
if (!$readfile) {
return false;
}
// Check the filesize first, likely not needed but important none the less.
$filesize = filesize($file);
if (!$filesize) {
return false;
}
// Open ensuring the file for writing, truncating it and setting the pointer to the start.
// Open ensuring the file for reading in binary format.
if (!$handle = fopen($file, 'rb')) {
return false;
}
// Lock it up!
// We don't care if this succeeds or not, on some systems it will, on some it won't, meah either way.
flock($handle, LOCK_SH);
// HACK ALERT
// There is a problem when reading from the file during PHPUNIT tests. For one reason or another the filesize is not correct
// Doesn't happen during normal operation, just during unit tests.
// Read it.
$data = fread($handle, $filesize+128);
$data = '';
// Read the data in 1Mb chunks. Small caches will not loop more than once. We don't use filesize as it may
// be cached with a different value than what we need to read from the file.
do {
$data .= fread($handle, 1048576);
} while (!feof($handle));
// Unlock it.
flock($handle, LOCK_UN);
// Return it unserialised.
@@ -605,13 +623,27 @@ class cachestore_file extends cache_store implements cache_is_key_aware, cache_i
* @throws coding_exception
*/
protected function ensure_path_exists() {
global $CFG;
if (!is_writable($this->path)) {
if ($this->custompath && !$this->autocreate) {
throw new coding_exception('File store path does not exist. It must exist and be writable by the web server.');
}
$createdcfg = false;
if (!isset($CFG)) {
// This can only happen during destruction of objects.
// A cache is being used within a destructor, php is ending a request and $CFG has
// already being cleaned up.
// Rebuild $CFG with directory permissions just to complete this write.
$CFG = $this->cfg;
$createdcfg = true;
}
if (!make_writable_directory($this->path, false)) {
throw new coding_exception('File store path does not exist and can not be created.');
}
if ($createdcfg) {
// We re-created it so we'll clean it up.
unset($CFG);
}
}
return true;
}
+2 -2
View File
@@ -27,7 +27,6 @@
defined('MOODLE_INTERNAL') || die();
require_once($CFG->dirroot.'/cache/forms.php');
require_once($CFG->dirroot.'/cache/stores/memcached/lib.php');
/**
* Form for adding a memcache instance.
@@ -50,7 +49,8 @@ class cachestore_memcache_addinstance_form extends cachestore_addinstance_form {
$form->addElement('text', 'prefix', get_string('prefix', 'cachestore_memcache'),
array('maxlength' => 5, 'size' => 5));
$form->addHelpButton('prefix', 'prefix', 'cachestore_memcache');
$form->setType('prefix', PARAM_ALPHAEXT);
$form->setType('prefix', PARAM_TEXT); // We set to text but we have a rule to limit to alphanumext.
$form->setDefault('prefix', 'mdl_');
$form->addRule('prefix', get_string('prefixinvalid', 'cachestore_memcache'), 'regex', '#^[a-zA-Z0-9\-_]+$#');
}
}
+1
View File
@@ -31,6 +31,7 @@ $string['prefix'] = 'Key prefix';
$string['prefix_help'] = 'This prefix is used for all key names on the memcache server.
* If you only have one Moodle instance using this server, you can leave this value default.
* Due to key length restrictions, a maximum of 5 characters is permitted.';
$string['prefixinvalid'] = 'Invalid prefix. You can only use a-z A-Z 0-9-_.';
$string['servers'] = 'Servers';
$string['servers_help'] = 'This sets the servers that should be utilised by this memcache adapter.
Servers should be defined one per line and consist of a server address and optionally a port and weight.
+2 -2
View File
@@ -132,8 +132,8 @@ class cachestore_memcache extends cache_store implements cache_is_configurable {
$this->connection = new Memcache;
foreach ($this->servers as $server) {
$this->connection->addServer($server[0], $server[1], true, $server[2]);
// Test the connection to this server.
}
// Test the connection to the pool of servers.
$this->isready = @$this->connection->set($this->parse_key('ping'), 'ping', MEMCACHE_COMPRESSED, 1);
}
@@ -404,7 +404,7 @@ class cachestore_memcache extends cache_store implements cache_is_configurable {
* Generates an instance of the cache store that can be used for testing.
*
* @param cache_definition $definition
* @return false
* @return cachestore_memcache|false
*/
public static function initialise_test_instance(cache_definition $definition) {
if (!self::are_requirements_met()) {
+4 -3
View File
@@ -57,11 +57,12 @@ class cachestore_memcached_addinstance_form extends cachestore_addinstance_form
$form->addElement('select', 'serialiser', get_string('useserialiser', 'cachestore_memcached'), $serialiseroptions);
$form->addHelpButton('serialiser', 'useserialiser', 'cachestore_memcached');
$form->setDefault('serialiser', Memcached::SERIALIZER_PHP);
$form->setType('serialiser', PARAM_NUMBER);
$form->setType('serialiser', PARAM_INT);
$form->addElement('text', 'prefix', get_string('prefix', 'cachestore_memcached'), array('size' => 16));
$form->setType('prefix', PARAM_ALPHANUM);
$form->setType('prefix', PARAM_TEXT); // We set to text but we have a rule to limit to alphanumext.
$form->addHelpButton('prefix', 'prefix', 'cachestore_memcached');
$form->addRule('prefix', get_string('prefixinvalid', 'cachestore_memcached'), 'regex', '#^[a-zA-Z0-9\-_]+$#');
$hashoptions = cachestore_memcached::config_get_hash_options();
$form->addElement('select', 'hash', get_string('hash', 'cachestore_memcached'), $hashoptions);
@@ -74,4 +75,4 @@ class cachestore_memcached_addinstance_form extends cachestore_addinstance_form
$form->setDefault('bufferwrites', 0);
$form->setType('bufferwrites', PARAM_BOOL);
}
}
}
@@ -42,6 +42,7 @@ $string['hash_murmur'] = 'Murmur';
$string['pluginname'] = 'Memcached';
$string['prefix'] = 'Prefix key';
$string['prefix_help'] = 'This can be used to create a "domain" for your item keys allowing you to create multiple memcached stores on a single memcached installation. It cannot be longer than 16 characters in order to ensure key length issues are not encountered.';
$string['prefixinvalid'] = 'Invalid prefix. You can only use a-z A-Z 0-9-_.';
$string['serialiser_igbinary'] = 'The igbinary serializer.';
$string['serialiser_json'] = 'The JSON serializer.';
$string['serialiser_php'] = 'The default PHP serializer.';
+3 -2
View File
@@ -141,6 +141,7 @@ class cachestore_memcached extends cache_store implements cache_is_configurable
}
$this->connection->addServers($this->servers);
}
// Test the connection to the pool of servers.
$this->isready = @$this->connection->set("ping", 'ping', 1);
}
@@ -339,7 +340,7 @@ class cachestore_memcached extends cache_store implements cache_is_configurable
$options[Memcached::SERIALIZER_JSON] = get_string('serialiser_json', 'cachestore_memcached');
}
if (Memcached::HAVE_IGBINARY) {
$options[Memcached::SERIALIZER_IGBINARY] = get_string('serialiser_php', 'cachestore_memcached');
$options[Memcached::SERIALIZER_IGBINARY] = get_string('serialiser_igbinary', 'cachestore_memcached');
}
return $options;
}
@@ -444,7 +445,7 @@ class cachestore_memcached extends cache_store implements cache_is_configurable
* Generates an instance of the cache store that can be used for testing.
*
* @param cache_definition $definition
* @return false
* @return cachestore_memcached|false
*/
public static function initialise_test_instance(cache_definition $definition) {
-1
View File
@@ -35,7 +35,6 @@ defined('MOODLE_INTERNAL') || die();
// Include the necessary evils.
require_once($CFG->dirroot.'/cache/forms.php');
require_once($CFG->dirroot.'/cache/stores/mongodb/lib.php');
/**
* The form to add an instance of the MongoDB store to the system.
+85 -20
View File
@@ -190,8 +190,9 @@ class cachestore_session extends session_data_store implements cache_is_key_awar
*/
public function initialise(cache_definition $definition) {
$this->storeid = $definition->generate_definition_hash();
$this->store = &self::register_store_id($definition->get_id());
$this->store = &self::register_store_id($this->name.'-'.$definition->get_id());
$this->ttl = $definition->get_ttl();
$this->check_ttl();
}
/**
@@ -218,12 +219,14 @@ class cachestore_session extends session_data_store implements cache_is_key_awar
* @return mixed The data that was associated with the key, or false if the key did not exist.
*/
public function get($key) {
$maxtime = cache::now() - $this->ttl;
if (array_key_exists($key, $this->store)) {
if ($this->ttl == 0) {
return $this->store[$key];
} else if ($this->store[$key][1] >= $maxtime) {
if (isset($this->store[$key])) {
if ($this->ttl === 0) {
return $this->store[$key][0];
} else if ($this->store[$key][1] >= (cache::now() - $this->ttl)) {
return $this->store[$key][0];
} else {
// Element is present but has expired.
$this->check_ttl();
}
}
return false;
@@ -240,17 +243,28 @@ class cachestore_session extends session_data_store implements cache_is_key_awar
*/
public function get_many($keys) {
$return = array();
$maxtime = cache::now() - $this->ttl;
$maxtime = 0;
if ($this->ttl != 0) {
$maxtime = cache::now() - $this->ttl;
}
$hasexpiredelements = false;
foreach ($keys as $key) {
$return[$key] = false;
if (array_key_exists($key, $this->store)) {
if (isset($this->store[$key])) {
if ($this->ttl == 0) {
$return[$key] = $this->store[$key];
$return[$key] = $this->store[$key][0];
} else if ($this->store[$key][1] >= $maxtime) {
$return[$key] = $this->store[$key][0];
} else {
$hasexpiredelements = true;
}
}
}
if ($hasexpiredelements) {
// There are some elements that are present but have expired.
$this->check_ttl();
}
return $return;
}
@@ -262,8 +276,8 @@ class cachestore_session extends session_data_store implements cache_is_key_awar
* @return bool True if the operation was a success false otherwise.
*/
public function set($key, $data) {
if ($this->ttl == 0) {
$this->store[$key] = $data;
if ($this->ttl === 0) {
$this->store[$key] = array($data, 0);
} else {
$this->store[$key] = array($data, cache::now());
}
@@ -281,8 +295,14 @@ class cachestore_session extends session_data_store implements cache_is_key_awar
public function set_many(array $keyvaluearray) {
$count = 0;
foreach ($keyvaluearray as $pair) {
$this->set($pair['key'], $pair['value']);
$key = $pair['key'];
$data = $pair['value'];
$count++;
if ($this->ttl === 0) {
$this->store[$key] = array($data, 0);
} else {
$this->store[$key] = array($data, cache::now());
}
}
return $count;
}
@@ -294,11 +314,10 @@ class cachestore_session extends session_data_store implements cache_is_key_awar
* @return bool
*/
public function has($key) {
$maxtime = cache::now() - $this->ttl;
if (array_key_exists($key, $this->store)) {
if (isset($this->store[$key])) {
if ($this->ttl == 0) {
return true;
} else if ($this->store[$key][1] >= $maxtime) {
} else if ($this->store[$key][1] >= (cache::now() - $this->ttl)) {
return true;
}
}
@@ -312,9 +331,13 @@ class cachestore_session extends session_data_store implements cache_is_key_awar
* @return bool
*/
public function has_all(array $keys) {
$maxtime = cache::now() - $this->ttl;
$maxtime = 0;
if ($this->ttl != 0) {
$maxtime = cache::now() - $this->ttl;
}
foreach ($keys as $key) {
if (!array_key_exists($key, $this->store)) {
if (!isset($this->store[$key])) {
return false;
}
if ($this->ttl != 0 && $this->store[$key][1] < $maxtime) {
@@ -331,9 +354,13 @@ class cachestore_session extends session_data_store implements cache_is_key_awar
* @return bool
*/
public function has_any(array $keys) {
$maxtime = cache::now() - $this->ttl;
$maxtime = 0;
if ($this->ttl != 0) {
$maxtime = cache::now() - $this->ttl;
}
foreach ($keys as $key) {
if (array_key_exists($key, $this->store) && ($this->ttl == 0 || $this->store[$key][1] >= $maxtime)) {
if (isset($this->store[$key]) && ($this->ttl == 0 || $this->store[$key][1] >= $maxtime)) {
return true;
}
}
@@ -347,6 +374,9 @@ class cachestore_session extends session_data_store implements cache_is_key_awar
* @return bool Returns true if the operation was a success, false otherwise.
*/
public function delete($key) {
if (!isset($this->store[$key])) {
return false;
}
unset($this->store[$key]);
return true;
}
@@ -358,6 +388,7 @@ class cachestore_session extends session_data_store implements cache_is_key_awar
* @return int The number of items successfully deleted.
*/
public function delete_many(array $keys) {
// The number of items that have been successfully deleted.
$count = 0;
foreach ($keys as $key) {
unset($this->store[$key]);
@@ -413,12 +444,37 @@ class cachestore_session extends session_data_store implements cache_is_key_awar
return $this->name;
}
/**
* Removes expired elements.
* @return int number of removed elements
*/
protected function check_ttl() {
if ($this->ttl === 0) {
return 0;
}
$maxtime = cache::now() - $this->ttl;
$count = 0;
for ($value = reset($this->store); $value !== false; $value = next($this->store)) {
if ($value[1] >= $maxtime) {
// We know that elements are sorted by ttl so no need to continue.
break;
}
$count++;
}
if ($count) {
// Remove first $count elements as they are expired.
$this->store = array_slice($this->store, $count, null, true);
}
return $count;
}
/**
* Finds all of the keys being stored in the cache store instance.
*
* @return array
*/
public function find_all() {
$this->check_ttl();
return array_keys($this->store);
}
@@ -426,6 +482,7 @@ class cachestore_session extends session_data_store implements cache_is_key_awar
* Finds all of the keys whose keys start with the given prefix.
*
* @param string $prefix
* @return array An array of keys.
*/
public function find_by_prefix($prefix) {
$return = array();
@@ -436,4 +493,12 @@ class cachestore_session extends session_data_store implements cache_is_key_awar
}
return $return;
}
}
/**
* This store supports native TTL handling.
* @return bool
*/
public function store_supports_native_ttl() {
return true;
}
}
+50 -18
View File
@@ -86,7 +86,7 @@ abstract class static_data_store extends cache_store {
* @copyright 2012 Sam Hemelryk
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class cachestore_static extends static_data_store implements cache_is_key_aware {
class cachestore_static extends static_data_store implements cache_is_key_aware, cache_is_searchable {
/**
* The name of the store
@@ -133,7 +133,8 @@ class cachestore_static extends static_data_store implements cache_is_key_aware
*/
public static function get_supported_features(array $configuration = array()) {
return self::SUPPORTS_DATA_GUARANTEE +
self::SUPPORTS_NATIVE_TTL;
self::SUPPORTS_NATIVE_TTL +
self::IS_SEARCHABLE;
}
/**
@@ -213,11 +214,10 @@ class cachestore_static extends static_data_store implements cache_is_key_aware
* @return mixed The data that was associated with the key, or false if the key did not exist.
*/
public function get($key) {
$maxtime = cache::now() - $this->ttl;
if (array_key_exists($key, $this->store)) {
if (isset($this->store[$key])) {
if ($this->ttl == 0) {
return $this->store[$key];
} else if ($this->store[$key][1] >= $maxtime) {
return $this->store[$key][0];
} else if ($this->store[$key][1] >= (cache::now() - $this->ttl)) {
return $this->store[$key][0];
}
}
@@ -235,12 +235,15 @@ class cachestore_static extends static_data_store implements cache_is_key_aware
*/
public function get_many($keys) {
$return = array();
$maxtime = cache::now() - $this->ttl;
if ($this->ttl != 0) {
$maxtime = cache::now() - $this->ttl;
}
foreach ($keys as $key) {
$return[$key] = false;
if (array_key_exists($key, $this->store)) {
if (isset($this->store[$key])) {
if ($this->ttl == 0) {
$return[$key] = $this->store[$key];
$return[$key] = $this->store[$key][0];
} else if ($this->store[$key][1] >= $maxtime) {
$return[$key] = $this->store[$key][0];
}
@@ -258,7 +261,7 @@ class cachestore_static extends static_data_store implements cache_is_key_aware
*/
public function set($key, $data) {
if ($this->ttl == 0) {
$this->store[$key] = $data;
$this->store[$key][0] = $data;
} else {
$this->store[$key] = array($data, cache::now());
}
@@ -289,11 +292,10 @@ class cachestore_static extends static_data_store implements cache_is_key_aware
* @return bool
*/
public function has($key) {
$maxtime = cache::now() - $this->ttl;
if (array_key_exists($key, $this->store)) {
if (isset($this->store[$key])) {
if ($this->ttl == 0) {
return true;
} else if ($this->store[$key][1] >= $maxtime) {
} else if ($this->store[$key][1] >= (cache::now() - $this->ttl)) {
return true;
}
}
@@ -307,9 +309,12 @@ class cachestore_static extends static_data_store implements cache_is_key_aware
* @return bool
*/
public function has_all(array $keys) {
$maxtime = cache::now() - $this->ttl;
if ($this->ttl != 0) {
$maxtime = cache::now() - $this->ttl;
}
foreach ($keys as $key) {
if (!array_key_exists($key, $this->store)) {
if (!isset($this->store[$key])) {
return false;
}
if ($this->ttl != 0 && $this->store[$key][1] < $maxtime) {
@@ -326,9 +331,12 @@ class cachestore_static extends static_data_store implements cache_is_key_aware
* @return bool
*/
public function has_any(array $keys) {
$maxtime = cache::now() - $this->ttl;
if ($this->ttl != 0) {
$maxtime = cache::now() - $this->ttl;
}
foreach ($keys as $key) {
if (array_key_exists($key, $this->store) && ($this->ttl == 0 || $this->store[$key][1] >= $maxtime)) {
if (isset($this->store[$key]) && ($this->ttl == 0 || $this->store[$key][1] >= $maxtime)) {
return true;
}
}
@@ -408,4 +416,28 @@ class cachestore_static extends static_data_store implements cache_is_key_aware
public function my_name() {
return $this->name;
}
}
/**
* Finds all of the keys being stored in the cache store instance.
*
* @return array
*/
public function find_all() {
return array_keys($this->store);
}
/**
* Finds all of the keys whose keys start with the given prefix.
*
* @param string $prefix
*/
public function find_by_prefix($prefix) {
$return = array();
foreach ($this->find_all() as $key) {
if (strpos($key, $prefix) === 0) {
$return[] = $key;
}
}
return $return;
}
}
+369 -50
View File
@@ -119,6 +119,23 @@ class cache_phpunit_tests extends advanced_testcase {
}
}
/**
* Tests for cache keys that would break on windows.
*/
public function test_windows_nasty_keys() {
$instance = cache_config_phpunittest::instance();
$instance->phpunit_add_definition('phpunit/windowskeytest', array(
'mode' => cache_store::MODE_APPLICATION,
'component' => 'phpunit',
'area' => 'windowskeytest',
'simplekeys' => true,
'simpledata' => true
));
$cache = cache::make('phpunit', 'windowskeytest');
$this->assertTrue($cache->set('contest', 'test data 1'));
$this->assertEquals('test data 1', $cache->get('contest'));
}
/**
* Tests the default application cache
*/
@@ -132,8 +149,8 @@ class cache_phpunit_tests extends advanced_testcase {
'mode' => cache_store::MODE_APPLICATION,
'component' => 'phpunit',
'area' => 'test_default_application_cache',
'persistent' => true,
'persistentmaxsize' => 1
'staticacceleration' => true,
'staticaccelerationsize' => 1
));
$cache = cache::make('phpunit', 'test_default_application_cache');
$this->assertInstanceOf('cache_application', $cache);
@@ -172,7 +189,7 @@ class cache_phpunit_tests extends advanced_testcase {
'mode' => cache_store::MODE_APPLICATION,
'component' => 'phpunit',
'area' => 'nostoretest2',
'persistent' => true
'staticacceleration' => true
));
$instance->phpunit_remove_stores();
@@ -191,42 +208,44 @@ class cache_phpunit_tests extends advanced_testcase {
* @param cache_loader $cache
*/
protected function run_on_cache(cache_loader $cache) {
$key = 'testkey';
$datascalar = 'test data';
$dataarray = array('test' => 'data', 'part' => 'two');
$key = 'contestkey';
$datascalars = array('test data', null);
$dataarray = array('contest' => 'data', 'part' => 'two');
$dataobject = (object)$dataarray;
$this->assertTrue($cache->purge());
foreach ($datascalars as $datascalar) {
$this->assertTrue($cache->purge());
// Check all read methods.
$this->assertFalse($cache->get($key));
$this->assertFalse($cache->has($key));
$result = $cache->get_many(array($key));
$this->assertCount(1, $result);
$this->assertFalse(reset($result));
$this->assertFalse($cache->has_any(array($key)));
$this->assertFalse($cache->has_all(array($key)));
// Check all read methods.
$this->assertFalse($cache->get($key));
$this->assertFalse($cache->has($key));
$result = $cache->get_many(array($key));
$this->assertCount(1, $result);
$this->assertFalse(reset($result));
$this->assertFalse($cache->has_any(array($key)));
$this->assertFalse($cache->has_all(array($key)));
// Set the data.
$this->assertTrue($cache->set($key, $datascalar));
// Setting it more than once should be permitted.
$this->assertTrue($cache->set($key, $datascalar));
// Set the data.
$this->assertTrue($cache->set($key, $datascalar));
// Setting it more than once should be permitted.
$this->assertTrue($cache->set($key, $datascalar));
// Recheck the read methods.
$this->assertEquals($datascalar, $cache->get($key));
$this->assertTrue($cache->has($key));
$result = $cache->get_many(array($key));
$this->assertCount(1, $result);
$this->assertEquals($datascalar, reset($result));
$this->assertTrue($cache->has_any(array($key)));
$this->assertTrue($cache->has_all(array($key)));
// Recheck the read methods.
$this->assertEquals($datascalar, $cache->get($key));
$this->assertTrue($cache->has($key));
$result = $cache->get_many(array($key));
$this->assertCount(1, $result);
$this->assertEquals($datascalar, reset($result));
$this->assertTrue($cache->has_any(array($key)));
$this->assertTrue($cache->has_all(array($key)));
// Delete it.
$this->assertTrue($cache->delete($key));
// Delete it.
$this->assertTrue($cache->delete($key));
// Check its gone.
$this->assertFalse($cache->get($key));
$this->assertFalse($cache->has($key));
// Check its gone.
$this->assertFalse($cache->get($key));
$this->assertFalse($cache->has($key));
}
// Test arrays.
$this->assertTrue($cache->set($key, $dataarray));
@@ -244,11 +263,13 @@ class cache_phpunit_tests extends advanced_testcase {
$this->assertEquals('blue_ptc_wfc', $result->property2);
// Test set many.
$cache->set_many(array('key1' => 'data1', 'key2' => 'data2'));
$cache->set_many(array('key1' => 'data1', 'key2' => 'data2', 'key3' => null));
$this->assertEquals('data1', $cache->get('key1'));
$this->assertEquals('data2', $cache->get('key2'));
$this->assertEquals(null, $cache->get('key3'));
$this->assertTrue($cache->delete('key1'));
$this->assertTrue($cache->delete('key2'));
$this->assertTrue($cache->delete('key3'));
$cache->set_many(array(
'key1' => array(1, 2, 3),
@@ -265,14 +286,17 @@ class cache_phpunit_tests extends advanced_testcase {
// Test delete many.
$this->assertTrue($cache->set('key1', 'data1'));
$this->assertTrue($cache->set('key2', 'data2'));
$this->assertTrue($cache->set('key3', null));
$this->assertEquals('data1', $cache->get('key1'));
$this->assertEquals('data2', $cache->get('key2'));
$this->assertEquals(null, $cache->get('key3'));
$this->assertEquals(2, $cache->delete_many(array('key1', 'key2')));
$this->assertEquals(3, $cache->delete_many(array('key1', 'key2', 'key3')));
$this->assertFalse($cache->get('key1'));
$this->assertFalse($cache->get('key2'));
$this->assertFalse($cache->get('key3'));
// Quick reference test.
$obj = new stdClass;
@@ -826,7 +850,7 @@ class cache_phpunit_tests extends advanced_testcase {
// OK data added, data invalidated, and invalidation time has been set.
// Now we need to manually add back the data and adjust the invalidation time.
$hash = md5(cache_store::MODE_APPLICATION.'/phpunit/eventinvalidationtest/'.$CFG->wwwroot.'phpunit');
$timefile = $CFG->dataroot."/cache/cachestore_file/default_application/phpunit_eventinvalidationtest/las/lastinvalidation-$hash.cache";
$timefile = $CFG->dataroot."/cache/cachestore_file/default_application/phpunit_eventinvalidationtest/las-cache/lastinvalidation-$hash.cache";
// Make sure the file is correct.
$this->assertTrue(file_exists($timefile));
$timecont = serialize(cache::now() - 60); // Back 60sec in the past to force it to re-invalidate.
@@ -834,7 +858,7 @@ class cache_phpunit_tests extends advanced_testcase {
file_put_contents($timefile, $timecont);
$this->assertTrue(file_exists($timefile));
$datafile = $CFG->dataroot."/cache/cachestore_file/default_application/phpunit_eventinvalidationtest/tes/testkey1-$hash.cache";
$datafile = $CFG->dataroot."/cache/cachestore_file/default_application/phpunit_eventinvalidationtest/tes-cache/testkey1-$hash.cache";
$datacont = serialize("test data 1");
make_writable_directory(dirname($datafile));
file_put_contents($datafile, $datacont);
@@ -883,11 +907,11 @@ class cache_phpunit_tests extends advanced_testcase {
'crazyevent'
)
));
$instance->phpunit_add_definition('phpunit/eventpurgetestpersistent', array(
$instance->phpunit_add_definition('phpunit/eventpurgetestaccelerated', array(
'mode' => cache_store::MODE_APPLICATION,
'component' => 'phpunit',
'area' => 'eventpurgetestpersistent',
'persistent' => true,
'area' => 'eventpurgetestaccelerated',
'staticacceleration' => true,
'invalidationevents' => array(
'crazyevent'
)
@@ -906,8 +930,8 @@ class cache_phpunit_tests extends advanced_testcase {
$this->assertFalse($cache->get('testkey1'));
$this->assertFalse($cache->get('testkey2'));
// Now test the persistent cache.
$cache = cache::make('phpunit', 'eventpurgetestpersistent');
// Now test the static acceleration array.
$cache = cache::make('phpunit', 'eventpurgetestaccelerated');
$this->assertTrue($cache->set('testkey1', 'test data 1'));
$this->assertEquals('test data 1', $cache->get('testkey1'));
$this->assertTrue($cache->set('testkey2', 'test data 2'));
@@ -934,11 +958,11 @@ class cache_phpunit_tests extends advanced_testcase {
'crazyevent'
)
));
$instance->phpunit_add_definition('phpunit/eventpurgetestpersistent', array(
$instance->phpunit_add_definition('phpunit/eventpurgetestaccelerated', array(
'mode' => cache_store::MODE_SESSION,
'component' => 'phpunit',
'area' => 'eventpurgetestpersistent',
'persistent' => true,
'area' => 'eventpurgetestaccelerated',
'staticacceleration' => true,
'invalidationevents' => array(
'crazyevent'
)
@@ -957,8 +981,8 @@ class cache_phpunit_tests extends advanced_testcase {
$this->assertFalse($cache->get('testkey1'));
$this->assertFalse($cache->get('testkey2'));
// Now test the persistent cache.
$cache = cache::make('phpunit', 'eventpurgetestpersistent');
// Now test the static acceleration array.
$cache = cache::make('phpunit', 'eventpurgetestaccelerated');
$this->assertTrue($cache->set('testkey1', 'test data 1'));
$this->assertEquals('test data 1', $cache->get('testkey1'));
$this->assertTrue($cache->set('testkey2', 'test data 2'));
@@ -1085,9 +1109,9 @@ class cache_phpunit_tests extends advanced_testcase {
}
/**
* Test that multiple loaders work ok.
* Test that multiple application loaders work ok.
*/
public function test_multiple_loaders() {
public function test_multiple_application_loaders() {
$instance = cache_config_phpunittest::instance(true);
$instance->phpunit_add_file_store('phpunittest1');
$instance->phpunit_add_file_store('phpunittest2');
@@ -1132,6 +1156,93 @@ class cache_phpunit_tests extends advanced_testcase {
$this->assertFalse($result['a']);
$this->assertEquals('B', $result['b']);
$this->assertFalse($result['c']);
// Test non-recursive deletes.
$this->assertTrue($cache->set('test', 'test'));
$this->assertSame('test', $cache->get('test'));
$this->assertTrue($cache->delete('test', false));
// We should still have it on a deeper loader.
$this->assertSame('test', $cache->get('test'));
// Test non-recusive with many functions.
$this->assertSame(3, $cache->set_many(array(
'one' => 'one',
'two' => 'two',
'three' => 'three'
)));
$this->assertSame('one', $cache->get('one'));
$this->assertSame(array('two' => 'two', 'three' => 'three'), $cache->get_many(array('two', 'three')));
$this->assertSame(3, $cache->delete_many(array('one', 'two', 'three'), false));
$this->assertSame('one', $cache->get('one'));
$this->assertSame(array('two' => 'two', 'three' => 'three'), $cache->get_many(array('two', 'three')));
}
/**
* Test that multiple application loaders work ok.
*/
public function test_multiple_session_loaders() {
/* @var cache_config_phpunittest $instance */
$instance = cache_config_phpunittest::instance(true);
$instance->phpunit_add_session_store('phpunittest1');
$instance->phpunit_add_session_store('phpunittest2');
$instance->phpunit_add_definition('phpunit/multi_loader', array(
'mode' => cache_store::MODE_SESSION,
'component' => 'phpunit',
'area' => 'multi_loader'
));
$instance->phpunit_add_definition_mapping('phpunit/multi_loader', 'phpunittest1', 3);
$instance->phpunit_add_definition_mapping('phpunit/multi_loader', 'phpunittest2', 2);
$cache = cache::make('phpunit', 'multi_loader');
$this->assertInstanceOf('cache_session', $cache);
$this->assertFalse($cache->get('test'));
$this->assertTrue($cache->set('test', 'test'));
$this->assertEquals('test', $cache->get('test'));
$this->assertTrue($cache->delete('test'));
$this->assertFalse($cache->get('test'));
$this->assertTrue($cache->set('test', 'test'));
$this->assertTrue($cache->purge());
$this->assertFalse($cache->get('test'));
// Test the many commands.
$this->assertEquals(3, $cache->set_many(array('a' => 'A', 'b' => 'B', 'c' => 'C')));
$result = $cache->get_many(array('a', 'b', 'c'));
$this->assertInternalType('array', $result);
$this->assertCount(3, $result);
$this->assertArrayHasKey('a', $result);
$this->assertArrayHasKey('b', $result);
$this->assertArrayHasKey('c', $result);
$this->assertEquals('A', $result['a']);
$this->assertEquals('B', $result['b']);
$this->assertEquals('C', $result['c']);
$this->assertEquals($result, $cache->get_many(array('a', 'b', 'c')));
$this->assertEquals(2, $cache->delete_many(array('a', 'c')));
$result = $cache->get_many(array('a', 'b', 'c'));
$this->assertInternalType('array', $result);
$this->assertCount(3, $result);
$this->assertArrayHasKey('a', $result);
$this->assertArrayHasKey('b', $result);
$this->assertArrayHasKey('c', $result);
$this->assertFalse($result['a']);
$this->assertEquals('B', $result['b']);
$this->assertFalse($result['c']);
// Test non-recursive deletes.
$this->assertTrue($cache->set('test', 'test'));
$this->assertSame('test', $cache->get('test'));
$this->assertTrue($cache->delete('test', false));
// We should still have it on a deeper loader.
$this->assertSame('test', $cache->get('test'));
// Test non-recusive with many functions.
$this->assertSame(3, $cache->set_many(array(
'one' => 'one',
'two' => 'two',
'three' => 'three'
)));
$this->assertSame('one', $cache->get('one'));
$this->assertSame(array('two' => 'two', 'three' => 'three'), $cache->get_many(array('two', 'three')));
$this->assertSame(3, $cache->delete_many(array('one', 'two', 'three'), false));
$this->assertSame('one', $cache->get('one'));
$this->assertSame(array('two' => 'two', 'three' => 'three'), $cache->get_many(array('two', 'three')));
}
/**
@@ -1272,8 +1383,8 @@ class cache_phpunit_tests extends advanced_testcase {
'mode' => cache_store::MODE_APPLICATION,
'component' => 'phpunit',
'area' => 'test_application_locking',
'persistent' => true,
'persistentmaxsize' => 1,
'staticacceleration' => true,
'staticaccelerationsize' => 1,
'requirelockingread' => true,
'requirelockingwrite' => true
));
@@ -1288,4 +1399,212 @@ class cache_phpunit_tests extends advanced_testcase {
$this->assertTrue($cache->delete('a'));
$this->assertFalse($cache->has('a'));
}
/**
* Test that the default stores all support searching.
*/
public function test_defaults_support_searching() {
$instance = cache_config_phpunittest::instance(true);
$instance->phpunit_add_definition('phpunit/search1', array(
'mode' => cache_store::MODE_APPLICATION,
'component' => 'phpunit',
'area' => 'search1',
'requiresearchable' => true
));
$instance->phpunit_add_definition('phpunit/search2', array(
'mode' => cache_store::MODE_SESSION,
'component' => 'phpunit',
'area' => 'search2',
'requiresearchable' => true
));
$instance->phpunit_add_definition('phpunit/search3', array(
'mode' => cache_store::MODE_REQUEST,
'component' => 'phpunit',
'area' => 'search3',
'requiresearchable' => true
));
$factory = cache_factory::instance();
// Test application cache is searchable.
$definition = $factory->create_definition('phpunit', 'search1');
$this->assertInstanceOf('cache_definition', $definition);
$this->assertEquals(cache_store::IS_SEARCHABLE, $definition->get_requirements_bin() & cache_store::IS_SEARCHABLE);
$cache = $factory->create_cache($definition);
$this->assertInstanceOf('cache_application', $cache);
$this->assertArrayHasKey('cache_is_searchable', $cache->phpunit_get_store_implements());
// Test session cache is searchable.
$definition = $factory->create_definition('phpunit', 'search2');
$this->assertInstanceOf('cache_definition', $definition);
$this->assertEquals(cache_store::IS_SEARCHABLE, $definition->get_requirements_bin() & cache_store::IS_SEARCHABLE);
$cache = $factory->create_cache($definition);
$this->assertInstanceOf('cache_session', $cache);
$this->assertArrayHasKey('cache_is_searchable', $cache->phpunit_get_store_implements());
// Test request cache is searchable.
$definition = $factory->create_definition('phpunit', 'search3');
$this->assertInstanceOf('cache_definition', $definition);
$this->assertEquals(cache_store::IS_SEARCHABLE, $definition->get_requirements_bin() & cache_store::IS_SEARCHABLE);
$cache = $factory->create_cache($definition);
$this->assertInstanceOf('cache_request', $cache);
$this->assertArrayHasKey('cache_is_searchable', $cache->phpunit_get_store_implements());
}
public function test_static_acceleration() {
$instance = cache_config_phpunittest::instance();
$instance->phpunit_add_definition('phpunit/accelerated', array(
'mode' => cache_store::MODE_APPLICATION,
'component' => 'phpunit',
'area' => 'accelerated',
'staticacceleration' => true,
'staticaccelerationsize' => 3,
));
$instance->phpunit_add_definition('phpunit/accelerated2', array(
'mode' => cache_store::MODE_APPLICATION,
'component' => 'phpunit',
'area' => 'accelerated2',
'staticacceleration' => true,
'staticaccelerationsize' => 3,
));
$instance->phpunit_add_definition('phpunit/accelerated3', array(
'mode' => cache_store::MODE_APPLICATION,
'component' => 'phpunit',
'area' => 'accelerated3',
'staticacceleration' => true,
'staticaccelerationsize' => 3,
));
$instance->phpunit_add_definition('phpunit/accelerated4', array(
'mode' => cache_store::MODE_APPLICATION,
'component' => 'phpunit',
'area' => 'accelerated4',
'staticacceleration' => true,
'staticaccelerationsize' => 4,
));
$cache = cache::make('phpunit', 'accelerated');
$this->assertInstanceOf('cache_phpunit_application', $cache);
// Set and get three elements.
$this->assertTrue($cache->set('a', 'A'));
$this->assertTrue($cache->set('b', 'B'));
$this->assertTrue($cache->set('c', 'C'));
$this->assertEquals('A', $cache->get('a'));
$this->assertEquals(array('b' => 'B', 'c' => 'C'), $cache->get_many(array('b', 'c')));
// Make sure all items are in static acceleration array.
$this->assertEquals('A', $cache->phpunit_get_directly_from_staticaccelerationarray('a'));
$this->assertEquals('B', $cache->phpunit_get_directly_from_staticaccelerationarray('b'));
$this->assertEquals('C', $cache->phpunit_get_directly_from_staticaccelerationarray('c'));
// Add new value and make sure it is in cache and it is in array.
$this->assertTrue($cache->set('d', 'D'));
$this->assertEquals('D', $cache->phpunit_get_directly_from_staticaccelerationarray('d'));
$this->assertEquals('D', $cache->get('d'));
// Now the least recent accessed item (a) is no longer in acceleration array.
$this->assertFalse($cache->phpunit_get_directly_from_staticaccelerationarray('a'));
$this->assertEquals('B', $cache->phpunit_get_directly_from_staticaccelerationarray('b'));
$this->assertEquals('C', $cache->phpunit_get_directly_from_staticaccelerationarray('c'));
// Adding and deleting element.
$this->assertTrue($cache->set('a', 'A'));
$this->assertTrue($cache->delete('a'));
$this->assertFalse($cache->phpunit_get_directly_from_staticaccelerationarray('a'));
$this->assertFalse($cache->has('a'));
// Make sure "purge" deletes from the array as well.
$cache->purge();
$this->assertFalse($cache->phpunit_get_directly_from_staticaccelerationarray('a'));
$this->assertFalse($cache->phpunit_get_directly_from_staticaccelerationarray('b'));
$this->assertFalse($cache->phpunit_get_directly_from_staticaccelerationarray('c'));
$this->assertFalse($cache->phpunit_get_directly_from_staticaccelerationarray('d'));
$this->assertFalse($cache->phpunit_get_directly_from_staticaccelerationarray('e'));
// Check that the array holds the last accessed items by get/set.
$this->assertTrue($cache->set('a', 'A'));
$this->assertTrue($cache->set('b', 'B'));
$this->assertTrue($cache->set('c', 'C'));
$this->assertTrue($cache->set('d', 'D'));
$this->assertTrue($cache->set('e', 'E'));
$this->assertFalse($cache->phpunit_get_directly_from_staticaccelerationarray('a'));
$this->assertFalse($cache->phpunit_get_directly_from_staticaccelerationarray('b'));
$this->assertEquals('C', $cache->phpunit_get_directly_from_staticaccelerationarray('c'));
$this->assertEquals('D', $cache->phpunit_get_directly_from_staticaccelerationarray('d'));
$this->assertEquals('E', $cache->phpunit_get_directly_from_staticaccelerationarray('e'));
/** @var cache_phpunit_application $cache */
$cache = cache::make('phpunit', 'accelerated2');
$this->assertInstanceOf('cache_phpunit_application', $cache);
// Check that the array holds the last accessed items by get/set.
$this->assertTrue($cache->set('a', 'A'));
$this->assertTrue($cache->set('b', 'B'));
$this->assertTrue($cache->set('c', 'C'));
$this->assertTrue($cache->set('d', 'D'));
$this->assertTrue($cache->set('e', 'E'));
// Current keys in the array: c, d, e.
$this->assertEquals('C', $cache->phpunit_get_directly_from_staticaccelerationarray('c'));
$this->assertEquals('D', $cache->phpunit_get_directly_from_staticaccelerationarray('d'));
$this->assertEquals('E', $cache->phpunit_get_directly_from_staticaccelerationarray('e'));
$this->assertFalse($cache->phpunit_get_directly_from_staticaccelerationarray('a'));
$this->assertFalse($cache->phpunit_get_directly_from_staticaccelerationarray('b'));
$this->assertEquals('A', $cache->get('a'));
// Current keys in the array: d, e, a.
$this->assertEquals('D', $cache->phpunit_get_directly_from_staticaccelerationarray('d'));
$this->assertEquals('E', $cache->phpunit_get_directly_from_staticaccelerationarray('e'));
$this->assertEquals('A', $cache->phpunit_get_directly_from_staticaccelerationarray('a'));
$this->assertFalse($cache->phpunit_get_directly_from_staticaccelerationarray('b'));
$this->assertFalse($cache->phpunit_get_directly_from_staticaccelerationarray('c'));
// Current keys in the array: d, e, a.
$this->assertEquals(array('c' => 'C'), $cache->get_many(array('c')));
// Current keys in the array: e, a, c.
$this->assertEquals('E', $cache->phpunit_get_directly_from_staticaccelerationarray('e'));
$this->assertEquals('A', $cache->phpunit_get_directly_from_staticaccelerationarray('a'));
$this->assertEquals('C', $cache->phpunit_get_directly_from_staticaccelerationarray('c'));
$this->assertFalse($cache->phpunit_get_directly_from_staticaccelerationarray('b'));
$this->assertFalse($cache->phpunit_get_directly_from_staticaccelerationarray('d'));
$cache = cache::make('phpunit', 'accelerated3');
$this->assertInstanceOf('cache_phpunit_application', $cache);
// Check that the array holds the last accessed items by get/set.
$this->assertTrue($cache->set('a', 'A'));
$this->assertTrue($cache->set('b', 'B'));
$this->assertTrue($cache->set('c', 'C'));
$this->assertTrue($cache->set('d', 'D'));
$this->assertTrue($cache->set('e', 'E'));
$this->assertFalse($cache->phpunit_get_directly_from_staticaccelerationarray('a'));
$this->assertFalse($cache->phpunit_get_directly_from_staticaccelerationarray('b'));
$this->assertEquals('C', $cache->phpunit_get_directly_from_staticaccelerationarray('c'));
$this->assertEquals('D', $cache->phpunit_get_directly_from_staticaccelerationarray('d'));
$this->assertEquals('E', $cache->phpunit_get_directly_from_staticaccelerationarray('e'));
$this->assertTrue($cache->set('b', 'B2'));
$this->assertFalse($cache->phpunit_get_directly_from_staticaccelerationarray('a'));
$this->assertEquals('B2', $cache->phpunit_get_directly_from_staticaccelerationarray('b'));
$this->assertFalse($cache->phpunit_get_directly_from_staticaccelerationarray('c'));
$this->assertEquals('D', $cache->phpunit_get_directly_from_staticaccelerationarray('d'));
$this->assertEquals('E', $cache->phpunit_get_directly_from_staticaccelerationarray('e'));
$this->assertEquals(2, $cache->set_many(array('b' => 'B3', 'c' => 'C3')));
$this->assertFalse($cache->phpunit_get_directly_from_staticaccelerationarray('a'));
$this->assertEquals('B3', $cache->phpunit_get_directly_from_staticaccelerationarray('b'));
$this->assertEquals('C3', $cache->phpunit_get_directly_from_staticaccelerationarray('c'));
$this->assertFalse($cache->phpunit_get_directly_from_staticaccelerationarray('d'));
$this->assertEquals('E', $cache->phpunit_get_directly_from_staticaccelerationarray('e'));
$cache = cache::make('phpunit', 'accelerated4');
$this->assertInstanceOf('cache_phpunit_application', $cache);
$this->assertTrue($cache->set('a', 'A'));
$this->assertTrue($cache->set('a', 'A'));
$this->assertTrue($cache->set('a', 'A'));
$this->assertTrue($cache->set('a', 'A'));
$this->assertTrue($cache->set('a', 'A'));
$this->assertTrue($cache->set('a', 'A'));
$this->assertTrue($cache->set('a', 'A'));
$this->assertEquals('A', $cache->phpunit_get_directly_from_staticaccelerationarray('a'));
$this->assertEquals('A', $cache->get('a'));
}
}
+52
View File
@@ -86,6 +86,24 @@ class cache_config_phpunittest extends cache_config_writer {
);
}
/**
* Forcefully adds a session store.
*
* @param string $name
*/
public function phpunit_add_session_store($name) {
$this->configstores[$name] = array(
'name' => $name,
'plugin' => 'session',
'configuration' => array(),
'features' => 14,
'modes' => 2,
'default' => true,
'class' => 'cachestore_session',
'lock' => 'cachelock_file_default',
);
}
/**
* Forcefully injects a definition => store mapping.
*
@@ -218,6 +236,24 @@ class cache_phpunit_application extends cache_application {
return get_class($this->get_store());
}
/**
* Returns all the interfaces the cache store implements.
* @return array
*/
public function phpunit_get_store_implements() {
return class_implements($this->get_store());
}
/**
* Returns the given key directly from the static acceleration array.
*
* @param string $key
* @return false|mixed
*/
public function phpunit_get_directly_from_staticaccelerationarray($key) {
$key = $this->parse_key($key);
return $this->get_from_persist_cache($key);
}
}
/**
@@ -237,6 +273,14 @@ class cache_phpunit_session extends cache_session {
public function phpunit_get_store_class() {
return get_class($this->get_store());
}
/**
* Returns all the interfaces the cache store implements.
* @return array
*/
public function phpunit_get_store_implements() {
return class_implements($this->get_store());
}
}
/**
@@ -256,6 +300,14 @@ class cache_phpunit_request extends cache_request {
public function phpunit_get_store_class() {
return get_class($this->get_store());
}
/**
* Returns all the interfaces the cache store implements.
* @return array
*/
public function phpunit_get_store_implements() {
return class_implements($this->get_store());
}
}
/**
+10 -2
View File
@@ -1,8 +1,16 @@
This files describes API changes in /cache/stores/* - cache store plugins.
Information provided here is intended especially for developers.
=== 2.5 ===
=== 2.4.7 ===
* All cache instances are recorded and subsequent requests are given a reference to the original instance.
* The persistent option for the cache definition has been deprecated. Please use the staticacceleration option instead.
* There is a new static acceleration option. If enabled data passing through the cache is held onto.
* The persistentmaxsize option has been renamed to staticaccelerationsize. It does the same thing.
* cache_definition::should_be_persistent has been deprecated. Please call cache_definition::use_static_acceleration instead.
* cache_definition::get_persistent_max_size has been deprecated. Please call cache_definition::get_static_acceleration_size instead.
=== 2.4.2 ===
* cleanup method renamed to instance_deleted.
It is now called when the store is deleted as all comments suggested anyway.
* instance_created method added.
It is called when the store is created for the very first time.
It is called when the store is created for the very first time.
+2 -2
View File
@@ -106,8 +106,8 @@ $PAGE->navbar->add($pagetitle);
$PAGE->set_title($course->shortname.': '.get_string('calendar', 'calendar').': '.$pagetitle);
$PAGE->set_heading($course->fullname);
$PAGE->set_button(calendar_preferences_button($course));
$PAGE->set_pagelayout('standard');
$PAGE->set_button(calendar_preferences_button($course));
$renderer = $PAGE->get_renderer('core_calendar');
$calendar->add_sidecalendar_blocks($renderer);
@@ -125,7 +125,7 @@ switch($action) {
$weekend = intval($CFG->calendar_weekend);
}
$authtoken = sha1($USER->id . $USER->password . $CFG->calendar_exportsalt);
$authtoken = sha1($USER->id . $DB->get_field('user', 'password', array('id'=>$USER->id)). $CFG->calendar_exportsalt);
// Let's populate some vars to let "common tasks" be somewhat smart...
// If today it's weekend, give the "next week" option
$allownextweek = $weekend & (1 << $now['wday']);
+14 -6
View File
@@ -110,6 +110,16 @@ define('CALENDAR_IMPORT_EVENT_UPDATED', 1);
*/
define('CALENDAR_IMPORT_EVENT_INSERTED', 2);
/**
* CALENDAR_SUBSCRIPTION_UPDATE - Used to represent update action for subscriptions in various forms.
*/
define('CALENDAR_SUBSCRIPTION_UPDATE', 1);
/**
* CALENDAR_SUBSCRIPTION_REMOVE - Used to represent remove action for subscriptions in various forms.
*/
define('CALENDAR_SUBSCRIPTION_REMOVE', 2);
/**
* Return the days of the week
*
@@ -356,7 +366,7 @@ function calendar_get_mini($courses, $groups, $users, $cal_month = false, $cal_y
} else if(isset($typesbyday[$day]['startuser'])) {
$class .= ' calendar_event_user';
}
$cell = html_writer::link($dayhref, $day, array('aria-controls' => $popupid.'_panel', 'id' => $popupid));
$cell = html_writer::link($dayhref, $day, array('id' => $popupid));
} else {
$cell = $day;
}
@@ -399,7 +409,7 @@ function calendar_get_mini($courses, $groups, $users, $cal_month = false, $cal_y
if(! isset($eventsbyday[$day])) {
$class .= ' eventnone';
$popupid = calendar_get_popup(true, false);
$cell = html_writer::link('#', $day, array('aria-controls' => $popupid.'_panel', 'id' => $popupid));
$cell = html_writer::link('#', $day, array('id' => $popupid));
}
$cell = get_accesshide($today.' ').$cell;
}
@@ -2851,11 +2861,9 @@ function calendar_process_subscription_row($subscriptionid, $pollinterval, $acti
// Fetch the subscription from the database making sure it exists.
$sub = $DB->get_record('event_subscriptions', array('id' => $subscriptionid), '*', MUST_EXIST);
$strupdate = get_string('update');
$strremove = get_string('remove');
// Update or remove the subscription, based on action.
switch ($action) {
case $strupdate:
case CALENDAR_SUBSCRIPTION_UPDATE:
// Skip updating file subscriptions.
if (empty($sub->url)) {
break;
@@ -2866,7 +2874,7 @@ function calendar_process_subscription_row($subscriptionid, $pollinterval, $acti
// Update the events.
return "<p>".get_string('subscriptionupdated', 'calendar', $sub->name)."</p>" . calendar_update_subscription_events($subscriptionid);
case $strremove:
case CALENDAR_SUBSCRIPTION_REMOVE:
calendar_delete_subscription($subscriptionid);
return get_string('subscriptionremoved', 'calendar', $sub->name);
break;
+1 -1
View File
@@ -33,7 +33,7 @@ $courseid = optional_param('course', SITEID, PARAM_INT);
// Used for processing subscription actions.
$subscriptionid = optional_param('id', 0, PARAM_INT);
$pollinterval = optional_param('pollinterval', 0, PARAM_INT);
$action = optional_param('action', '', PARAM_ALPHA);
$action = optional_param('action', '', PARAM_INT);
$url = new moodle_url('/calendar/managesubscriptions.php');
if ($courseid != SITEID) {
+4 -2
View File
@@ -814,9 +814,11 @@ class core_calendar_renderer extends plugin_renderer_base {
$html .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'course', 'value' => $courseid));
$html .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'id', 'value' => $subscription->id));
if (!empty($subscription->url)) {
$html .= html_writer::empty_tag('input', array('type' => 'submit', 'name' => 'action', 'value' => get_string('update')));
$html .= html_writer::tag('button', get_string('update'), array('type' => 'submit', 'name' => 'action',
'value' => CALENDAR_SUBSCRIPTION_UPDATE));
}
$html .= html_writer::empty_tag('input', array('type' => 'submit', 'name' => 'action', 'value' => get_string('remove')));
$html .= html_writer::tag('button', get_string('remove'), array('type' => 'submit', 'name' => 'action',
'value' => CALENDAR_SUBSCRIPTION_REMOVE));
$html .= html_writer::end_tag('div');
$html .= html_writer::end_tag('form');
return $html;
+71
View File
@@ -0,0 +1,71 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Calendar lib unit tests
*
* @package core_calendar
* @copyright 2013 Dan Poltawski <dan@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
global $CFG;
require_once($CFG->dirroot . '/calendar/lib.php');
/**
* Unit tests for calendar lib
*
* @package core_calendar
* @copyright 2013 Dan Poltawski <dan@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class core_calendar_lib_testcase extends advanced_testcase {
public function test_calendar_get_course_cached() {
$this->resetAfterTest(true);
// Setup some test courses.
$course1 = $this->getDataGenerator()->create_course();
$course2 = $this->getDataGenerator()->create_course();
$course3 = $this->getDataGenerator()->create_course();
// Load courses into cache.
$coursecache = null;
calendar_get_course_cached($coursecache, $course1->id);
calendar_get_course_cached($coursecache, $course2->id);
calendar_get_course_cached($coursecache, $course3->id);
// Verify the cache.
$this->assertArrayHasKey($course1->id, $coursecache);
$cachedcourse1 = $coursecache[$course1->id];
$this->assertEquals($course1->id, $cachedcourse1->id);
$this->assertEquals($course1->shortname, $cachedcourse1->shortname);
$this->assertEquals($course1->fullname, $cachedcourse1->fullname);
$this->assertArrayHasKey($course2->id, $coursecache);
$cachedcourse2 = $coursecache[$course2->id];
$this->assertEquals($course2->id, $cachedcourse2->id);
$this->assertEquals($course2->shortname, $cachedcourse2->shortname);
$this->assertEquals($course2->fullname, $cachedcourse2->fullname);
$this->assertArrayHasKey($course3->id, $coursecache);
$cachedcourse3 = $coursecache[$course3->id];
$this->assertEquals($course3->id, $cachedcourse3->id);
$this->assertEquals($course3->shortname, $cachedcourse3->shortname);
$this->assertEquals($course3->fullname, $cachedcourse3->fullname);
}
}
+1 -1
View File
@@ -153,7 +153,7 @@ if (!empty($CFG->enablecalendarexport)) {
echo $OUTPUT->single_button(new moodle_url('/calendar/managesubscriptions.php', array('course'=>$courseid)), get_string('managesubscriptions', 'calendar'));
}
if (isloggedin()) {
$authtoken = sha1($USER->id . $USER->password . $CFG->calendar_exportsalt);
$authtoken = sha1($USER->id . $DB->get_field('user', 'password', array('id'=>$USER->id)) . $CFG->calendar_exportsalt);
$link = new moodle_url('/calendar/export_execute.php', array('preset_what'=>'all', 'preset_time'=>'recentupcoming', 'userid' => $USER->id, 'authtoken'=>$authtoken));
$icon = html_writer::empty_tag('img', array('src'=>$OUTPUT->pix_url('i/ical'), 'height'=>'14', 'width'=>'36', 'alt'=>get_string('ical', 'calendar'), 'title'=>get_string('quickdownloadcalendar', 'calendar')));
echo html_writer::tag('a', $icon, array('href'=>$link));
+1
View File
@@ -48,6 +48,7 @@ YUI.add('moodle-calendar-eventmanager', function(Y) {
width : Math.floor(constraint.get('offsetWidth')*0.9)+"px"
});
panel.render(td);
node.setAttribute('aria-controls', panel.get('id'));
panel.get('boundingBox').addClass('calendar-event-panel');
panel.get('boundingBox').setAttribute('aria-live', 'off');
this.on('showevent', panel.show, panel);
+1
View File
@@ -86,6 +86,7 @@ $search .= html_writer::start_tag('div');
$search .= html_writer::label(get_string('searchcohort', 'cohort'), 'cohort_search_q'); // No : in form labels!
$search .= html_writer::empty_tag('input', array('id'=>'cohort_search_q', 'type'=>'text', 'name'=>'search', 'value'=>$searchquery));
$search .= html_writer::empty_tag('input', array('type'=>'submit', 'value'=>get_string('search', 'cohort')));
$search .= html_writer::empty_tag('input', array('type'=>'hidden', 'name'=>'contextid', 'value'=>$contextid));
$search .= html_writer::end_tag('div');
$search .= html_writer::end_tag('form');
echo $search;
+13 -33
View File
@@ -59,11 +59,6 @@ M.core_comment = {
}, this);
}
scope.toggle_textarea(false);
CommentHelper.confirmoverlay = new Y.Overlay({
bodyContent: '<div class="comment-delete-confirm"><a href="#" id="confirmdelete-'+this.client_id+'">'+M.str.moodle.yes+'</a> <a href="#" id="canceldelete-'+this.client_id+'">'+M.str.moodle.no+'</a></div>',
visible: false
});
CommentHelper.confirmoverlay.render(document.body);
},
post: function() {
var ta = Y.one('#dlg-content-'+this.client_id);
@@ -238,7 +233,6 @@ bodyContent: '<div class="comment-delete-confirm"><a href="#" id="confirmdelete-
dodelete: function(id) { // note: delete is a reserved word in javascript, chrome and safary do not like it at all here!
var scope = this;
var params = {'commentid': id};
scope.cancel_delete();
function remove_dom(type, anim, cmt) {
cmt.remove();
}
@@ -294,37 +288,23 @@ bodyContent: '<div class="comment-delete-confirm"><a href="#" id="confirmdelete-
if (commentid[1]) {
Y.Event.purgeElement('#'+theid, false, 'click');
}
node.on('click', function(e, node) {
node.on('click', function(e) {
e.preventDefault();
var width = CommentHelper.confirmoverlay.bodyNode.getStyle('width');
var re = new RegExp("(\\d+).*", "i");
var result = width.match(re);
if (result[1]) {
width = Number(result[1]);
} else {
width = 0;
if (commentid[1]) {
scope.dodelete(commentid[1]);
}
//CommentHelper.confirmoverlay.set('xy', [e.pageX-(width/2), e.pageY]);
CommentHelper.confirmoverlay.set('xy', [e.pageX-width-5, e.pageY]);
CommentHelper.confirmoverlay.set('visible', true);
Y.one('#canceldelete-'+scope.client_id).on('click', function(e) {
e.preventDefault();
scope.cancel_delete();
});
Y.Event.purgeElement('#confirmdelete-'+scope.client_id, false, 'click');
Y.one('#confirmdelete-'+scope.client_id).on('click', function(e) {
e.preventDefault();
if (commentid[1]) {
scope.dodelete(commentid[1]);
}
});
}, scope, node);
});
// Also handle space/enter key.
node.on('key', function(e) {
e.preventDefault();
if (commentid[1]) {
scope.dodelete(commentid[1]);
}
}, '13,32');
// 13 and 32 are the keycodes for space and enter.
}
);
},
cancel_delete: function() {
CommentHelper.confirmoverlay.set('visible', false);
},
register_pagination: function() {
var scope = this;
// page buttons
@@ -374,7 +354,7 @@ bodyContent: '<div class="comment-delete-confirm"><a href="#" id="confirmdelete-
if (ta) {
//toggle_textarea.apply(ta, [false]);
//// reset textarea size
ta.on('click', function() {
ta.on('focus', function() {
this.toggle_textarea(true);
}, this);
//ta.onkeypress = function() {
+4 -1
View File
@@ -487,7 +487,10 @@ $CFG->admin = 'admin';
// $CFG->debugusers = '2';
//
// Prevent theme caching
// $CFG->themerev = -1; // NOT FOR PRODUCTION SERVERS!
// $CFG->themedesignermode = true; // NOT FOR PRODUCTION SERVERS!
//
// Prevent JS caching
// $CFG->cachejs = false; // NOT FOR PRODUCTION SERVERS!
//
// Prevent core_string_manager on-disk cache
// $CFG->langstringcache = false; // NOT FOR PRODUCTION SERVERS!
+14 -10
View File
@@ -196,7 +196,7 @@ class course_edit_form extends moodleform {
enrol_course_edit_form($mform, $course, $context);
//--------------------------------------------------------------------------------
$mform->addElement('header','', get_string('groups', 'group'));
$mform->addElement('header', '', get_string('groupsettingsheader', 'group'));
$choices = array();
$choices[NOGROUPS] = get_string('groupsnone', 'group');
@@ -328,19 +328,23 @@ class course_edit_form extends moodleform {
/// perform some extra moodle validation
function validation($data, $files) {
global $DB, $CFG;
global $DB;
$errors = parent::validation($data, $files);
if ($foundcourses = $DB->get_records('course', array('shortname'=>$data['shortname']))) {
if (!empty($data['id'])) {
unset($foundcourses[$data['id']]);
// Add field validation check for duplicate shortname.
if ($course = $DB->get_record('course', array('shortname' => $data['shortname']), '*', IGNORE_MULTIPLE)) {
if (empty($data['id']) || $course->id != $data['id']) {
$errors['shortname'] = get_string('shortnametaken', '', $course->fullname);
}
if (!empty($foundcourses)) {
foreach ($foundcourses as $foundcourse) {
$foundcoursenames[] = $foundcourse->fullname;
}
// Add field validation check for duplicate idnumber.
if (!empty($data['idnumber']) && (empty($data['id']) || $this->course->idnumber != $data['idnumber'])) {
if ($course = $DB->get_record('course', array('idnumber' => $data['idnumber']), '*', IGNORE_MULTIPLE)) {
if (empty($data['id']) || $course->id != $data['id']) {
$errors['idnumber'] = get_string('idnumbertaken', 'error');
}
$foundcoursenamestring = implode(',', $foundcoursenames);
$errors['shortname']= get_string('shortnametaken', '', $foundcoursenamestring);
}
}
+2 -1
View File
@@ -22,9 +22,10 @@ class editsection_form extends moodleform {
$course = $this->_customdata['course'];
$elementgroup = array();
$elementgroup[] = $mform->createElement('text', 'name', '', array('size' => '30'));
$elementgroup[] = $mform->createElement('text', 'name', '', array('size' => '30', 'maxlength' => '255'));
$elementgroup[] = $mform->createElement('checkbox', 'usedefaultname', '', get_string('sectionusedefaultname'));
$mform->addGroup($elementgroup, 'name_group', get_string('sectionname'), ' ', false);
$mform->addGroupRule('name_group', array('name' => array(array(get_string('maximumchars', '', 255), 'maxlength', 255))));
$mform->setDefault('usedefaultname', true);
$mform->setType('name', PARAM_TEXT);
+5 -5
View File
@@ -715,9 +715,9 @@ class core_course_external extends external_api {
"users" (int) Include users (default to 0 that is equal to no),
"role_assignments" (int) Include role assignments (default to 0 that is equal to no),
"comments" (int) Include user comments (default to 0 that is equal to no),
"completion_information" (int) Include user course completion information (default to 0 that is equal to no),
"userscompletion" (int) Include user course completion information (default to 0 that is equal to no),
"logs" (int) Include course logs (default to 0 that is equal to no),
"histories" (int) Include histories (default to 0 that is equal to no)'
"grade_histories" (int) Include histories (default to 0 that is equal to no)'
),
'value' => new external_value(PARAM_RAW, 'the value for the option 1 (yes) or 0 (no)'
)
@@ -779,9 +779,9 @@ class core_course_external extends external_api {
'users' => 0,
'role_assignments' => 0,
'comments' => 0,
'completion_information' => 0,
'userscompletion' => 0,
'logs' => 0,
'histories' => 0
'grade_histories' => 0
);
$backupsettings = array();
@@ -979,7 +979,7 @@ class core_course_external extends external_api {
);
if ($params['deletecontent'] !== 0 and $params['deletecontent'] !== 1) {
throw new moodle_exception('invalidextparam', 'webservice', '', $option['deletecontent']);
throw new moodle_exception('invalidextparam', 'webservice', '', $params['deletecontent']);
}
// Context validation.
+1 -1
View File
@@ -515,7 +515,7 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
$o.= html_writer::tag('div', '', array('class' => 'left side'));
$o.= html_writer::tag('div', '', array('class' => 'right side'));
$o.= html_writer::start_tag('div', array('class' => 'content'));
$o.= $this->output->heading(get_string('orphanedactivities'), 3, 'sectionname');
$o.= $this->output->heading(get_string('orphanedactivitiesinsectionno', '', $sectionno), 3, 'sectionname');
return $o;
}

Some files were not shown because too many files have changed in this diff Show More