Compare commits

..

921 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7) f4dc567e79 Moodle release 2.8.4 2015-03-07 11:23:46 +01:00
Eloy Lafuente (stronk7) 67bbf0d422 weekly release 2.8.3+ 2015-03-05 11:26:48 +01:00
Eloy Lafuente (stronk7) 89784be6ff Merge branch 'MDL-49379_m28' of git://github.com/markn86/moodle into MOODLE_28_STABLE 2015-03-04 10:50:12 +01:00
Mark Nelson 8f938ff9a6 MDL-49379 core_webservice: fixed ability to edit services 2015-03-04 01:37:07 -08:00
David Monllao c35df119a5 MDL-49204 core_message: Checking current user 2015-03-04 10:05:44 +08:00
Andrew Nicols 98dfa7cae8 Merge branch 'MDL-49364_28' of git://github.com/timhunt/moodle into MOODLE_28_STABLE 2015-03-04 08:53:03 +08:00
Andrew Nicols 4d7ecf45a1 Merge branch 'mdl28_MDL-46390' of https://github.com/danmarsden/moodle into MOODLE_28_STABLE 2015-03-04 07:55:59 +08:00
Dan Marsden 2e12b4cffb MDL-46390 mod_scorm: Find correct sco to launch when org based sco is selected
Also tidies up some redundant code in scorm_format_toc_for_droplist()
2015-03-04 09:28:53 +13:00
Eloy Lafuente (stronk7) c2383703ea Merge branch 'MDL-49214_M28' of git://github.com/lazydaisy/moodle into MOODLE_28_STABLE 2015-03-03 19:36:19 +01:00
Dan Poltawski 9db4890064 Merge branch 'MDL-49335_28' of git://github.com/timhunt/moodle into MOODLE_28_STABLE 2015-03-03 14:46:34 +00:00
Dan Poltawski c6e925dbf0 Merge branch 'MDL-49334_28' of git://github.com/timhunt/moodle into MOODLE_28_STABLE 2015-03-03 13:25:33 +00:00
Dan Poltawski 35a615aa33 Merge branch 'MDL-47000-28' of git://github.com/merrill-oakland/moodle into MOODLE_28_STABLE 2015-03-03 13:21:30 +00:00
Tim Hunt f1fb96b698 MDL-49364 quiz statistics: escape output in the response analysis 2015-03-03 13:04:59 +00:00
Tim Hunt b6f112957e MDL-49335 quiz behat: new test of attempting a quiz
This separates out attempting the quiz into a separate .feature, away
from the monolithic add_quiz.feature. At some point we should clean that
up, but for now I am just adding this.

Really, the main reason for this test is to verify the two Behat
enhancememnts I just did.
2015-03-03 11:23:55 +00:00
Tim Hunt ccc1e11099 MDL-49335 quiz behat: improved step for adding questions to a quiz
Explicit headings make the script more readable, and pave the way for
new options that are due to be added.
2015-03-03 11:23:54 +00:00
Tim Hunt 44f6bc4ead MDL-49335 Behat: new question selector
So you can say things like
    And I click on "True" "radio" in the "First question" "question"
2015-03-03 11:23:54 +00:00
Tim Hunt 6e650b4c0a MDL-49334 behat: sort selector lists 2015-03-03 11:20:55 +00:00
Dan Poltawski 84fd0fd52c Merge branch 'MDL-34006_m28v7' of https://github.com/sbourget/moodle into MOODLE_28_STABLE 2015-03-03 11:03:12 +00:00
Stephen Bourget 2a433ad067 MDL-45621 Portfolio: Allow portfolios to be uninstalled 2015-03-03 10:59:48 +01:00
Dan Poltawski e527aff4d2 Merge branch 'MDL-49160-28' of git://github.com/merrill-oakland/moodle into MOODLE_28_STABLE 2015-03-03 08:34:50 +00:00
Andrew Nicols da9dfe70d4 Merge branch 'wip-mdl-49110-m28' of https://github.com/rajeshtaneja/moodle into MOODLE_28_STABLE 2015-03-03 16:27:03 +08:00
Andrew Nicols e2d00f5195 MDL-49285 mod_quiz: Remove unnecessary linebreak 2015-03-03 16:24:02 +08:00
Andrew Nicols 6afe470648 Merge branch 'MDL-49285-28' of git://github.com/merrill-oakland/moodle into MOODLE_28_STABLE 2015-03-03 16:23:24 +08:00
Andrew Nicols 76bd7cea87 Merge branch 'MDL-38485-28' of git://github.com/ankitagarwal/moodle into MOODLE_28_STABLE 2015-03-03 16:15:06 +08:00
Andrew Nicols 2b6bb87e59 Merge branch 'MDL-49075-28' of https://github.com/lucisgit/moodle into MOODLE_28_STABLE 2015-03-03 15:43:44 +08:00
pau.ferrer-ocana d259d014bb MDL-49234 oracle: Remove variables passed by reference error 2015-03-03 15:14:38 +08:00
Andrew Nicols fba097e3ce Merge branch 'MDL-49247_28' of git://github.com/timhunt/moodle into MOODLE_28_STABLE 2015-03-03 15:07:35 +08:00
Andrew Nicols 21b910b487 Merge branch 'MDL-49284_28' of git://github.com/timhunt/moodle into MOODLE_28_STABLE 2015-03-03 13:48:13 +08:00
Eloy Lafuente (stronk7) 83866c3c2a MDL-49087 mdeploy: now relying on config.php documented 2015-03-03 02:44:49 +01:00
Andrew Nicols 4475f1e478 MDL-49087 mnet: Ensure typeroot is in dirroot 2015-03-03 02:40:50 +01:00
Andrew Nicols c353a62026 MDL-49087 mnet: Use real dataroot instead of user-provided 2015-03-03 02:40:50 +01:00
Eloy Lafuente (stronk7) 1a67f29f38 Merge branch 'MDL-37470_28' of https://github.com/mike-grant/moodle into MOODLE_28_STABLE 2015-03-03 01:43:54 +01:00
Eloy Lafuente (stronk7) 50f2d4d645 Merge branch 'MDL-49240-28' of git://github.com/damyon/moodle into MOODLE_28_STABLE 2015-03-03 01:11:24 +01:00
Dan Poltawski f479a30931 Merge branch 'MOODLE_28_STABLE' of https://github.com/mitstek/moodle into MOODLE_28_STABLE 2015-03-02 17:27:15 +00:00
Dan Poltawski a62cc33c1f Merge branch '28_MDL-49303' of https://github.com/danmarsden/moodle into MOODLE_28_STABLE 2015-03-02 16:57:54 +00:00
Marina Glancy 4ab4ec652c MDL-48804 core: do not set current course until login validated 2015-03-02 16:49:44 +01:00
Juan Leyva 0899c0adc0 MDL-48691 webservices: Check if the user must be changing password 2015-03-02 14:40:01 +00:00
Simey Lameze 64e2179478 MDL-49084 core_tag: add capability check to flag as inappropriate action 2015-03-02 12:52:13 +00:00
Andrew Nicols 51094c6560 MDL-49144 blocks: Sanitise alt and title for block controls 2015-03-02 12:09:52 +00:00
Andrew Nicols 3f316035b4 MDL-49144 blocks: Add behat test to ensury sanity of block title 2015-03-02 12:09:52 +00:00
Dan Poltawski 0dedf765e0 Merge branch 'MDL-47911-28' of git://github.com/damyon/moodle into MOODLE_28_STABLE 2015-03-02 11:06:19 +00:00
Ankit Agarwal 5219605a81 MDL-38466 filters: Redos protection and unit tests 2015-03-02 11:30:45 +01:00
Zachary Durber 1b24951778 MDL-38466 filters: ReDoS protection for text to URL conversion. 2015-03-02 11:30:44 +01:00
Dan Poltawski 952bc6c5a6 Merge branch 'MDL-23273-28' of git://github.com/zbdd/moodle into MOODLE_28_STABLE 2015-03-02 09:34:57 +00:00
Mary Evans 3cf5c751ed MDL-49214 theme_bootstrapbase: OL list numbers cut off in Clean theme
Conflicts:

	theme/bootstrapbase/style/moodle.css
2015-03-01 19:40:58 +00:00
Eric Merrill fb50700b4e MDL-47911 gradebook: Improve the performance of set_usedinaggregation
This function is called many many times during grade calculation, so it
should be as efficient as possible.
2015-02-27 11:53:54 +08:00
Tony Butler 7c0e5b20b6 MDL-49075 mod_assign: Add assertions to marking workflow unit test
Make sure grades aren't pushed to gradebook for marking workflow
states other than 'released'.
2015-02-26 11:56:20 +00:00
Tony Butler bb790b84ca MDL-49075 mod_assign: Keep unreleased assign grades out of gradebook 2015-02-26 11:56:20 +00:00
Dan Marsden e1c81e5284 MDL-49303 mod_scorm: Initialise student preferences on re-entry. 2015-02-26 20:39:07 +13:00
Tim Hunt e89a286905 MDL-49284 formslib: fix strict validation of HTML. 2015-02-25 17:39:23 +00:00
Stephen Bourget c80f356bca MDL-34006 Lesson: Behat tests 2015-02-25 10:29:14 -05:00
Stephen Bourget cf49d1850e MDL-34006 Lesson: Resume lesson loads wrong page. 2015-02-25 10:29:01 -05:00
Dan Poltawski 2abfecbc8c weekly release 2.8.3+ 2015-02-25 14:57:39 +00:00
Dan Poltawski 6fe7343a94 Merge branch 'install_28_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_28_STABLE 2015-02-25 14:57:36 +00:00
Mitsuhiro Yoshida 9b1c53771a MDL-49259 lib: Fix for unzipped Japanese filename character corruption 2015-02-25 23:28:29 +09:00
Andrew Nicols f18a66f1ea MDL-49008 lang: Revert unnecessary rename warning
This was failing unit tests because it does not check for the presence of
the source directory first. If there is no source directory, it cannot be
moved.
2015-02-25 08:55:56 +08:00
Eric Merrill 3272e14576 MDL-47000 session: Update memcached version referecnes to 2.2.0 2015-02-24 15:19:30 -05:00
Eric Merrill 181269bf32 MDL-49285 quiz: Include lib.php for phpunit test 2015-02-24 14:54:37 -05:00
Eric Merrill fc63b8cf81 MDL-49160 quiz: Make sure to not select an outcome grade item
When we are computing completion, make sure we select only the true
grade_item, not outcome grade items.
2015-02-24 14:43:37 -05:00
Dan Poltawski 84be895b94 Merge branch 'MDL-49241-28-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_28_STABLE 2015-02-24 16:50:15 +00:00
Dan Poltawski 8732862bb5 Merge branch 'wip_MDL-49184_m28_choice' of https://github.com/skodak/moodle into MOODLE_28_STABLE 2015-02-24 10:43:32 +00:00
Brian Barnes ede8ae0399 MDL-48519 accessibility: improved accessibility of user filters 2015-02-24 17:53:27 +08:00
Andrew Nicols 2d7c31b550 Merge branch 'MDL-49078_m28' of git://github.com/shashirepo/moodle into MOODLE_28_STABLE 2015-02-24 17:05:53 +08:00
Shashikant Vaishnav 9a055f40c2 MDL-49078 theme_bootstrapbase: 'Create new course' text too high
Thanks to  Gareth J Barnard  for the code suggestion
2015-02-24 14:21:09 +05:30
Dan Poltawski 40b53bda8c Merge branch 'MDL-49216-28' of git://github.com/andrewnicols/moodle into MOODLE_28_STABLE 2015-02-24 08:31:54 +00:00
Andrew Davis c49003263e MDL-29008 lang: reintroduced error silencing to prevent unit test failures 2015-02-24 16:16:20 +08:00
Zachary Durber c9e9862ed6 MDL-23273 mod_choice: error continue button redirects back to choice
Locks only occur when a choice is using limits.
2015-02-24 12:16:29 +08:00
Zachary Durber a455f2fa45 MDL-23273 mod_choice: Using locks to ensure choice limits 2015-02-24 12:16:29 +08:00
Andrew Nicols b34fc1800a Merge branch 'mdl28_MDL-46408' of https://github.com/danmarsden/moodle into MOODLE_28_STABLE 2015-02-24 11:35:53 +08:00
Ankit Agarwal 8a15bcf759 MDL-38485 calendar: Carry over line breaks on imports
Thanks to Matthias Schwabe for the patch suggestion
2015-02-24 08:55:40 +05:30
Andrew Nicols 4f2308d541 Merge branch 'MDL-49008_lang_vanish_28' of https://github.com/andyjdavis/moodle into MOODLE_28_STABLE 2015-02-24 11:08:28 +08:00
Andrew Nicols 41ab3ae676 MDL-49216 mod_forum: Move subquery to outer component
It is not possible to order sub-query results with some RDBMs, and the
subquery is not necessary anyway.
2015-02-24 08:30:24 +08:00
Andrew Nicols d2782c3d4b MDL-49216 mod_forum: Add tests for discussion reply count 2015-02-24 08:30:23 +08:00
Helen Foster b907bc26f6 MDL-49241 lang: Merge English strings from the en_fix language pack 2015-02-23 21:15:18 +01:00
Dan Poltawski 105e1af010 Merge branch 'MDL-49198_m28' of https://github.com/markn86/moodle into MOODLE_28_STABLE 2015-02-23 16:29:25 +00:00
Dan Poltawski 06b5e1f1e1 Merge branch 'MDL-49200_m28' of https://github.com/markn86/moodle into MOODLE_28_STABLE 2015-02-23 16:21:33 +00:00
Dan Poltawski 9c2e581e82 Merge branch 'MOODLE_28_STABLE' of https://github.com/eberhardt/moodle into MOODLE_28_STABLE 2015-02-23 15:55:37 +00:00
Andrew Nicols 0c8096792d MDL-48807 accesslib: Change create_level_instance to recordset 2015-02-23 16:03:17 +08:00
Andrew Nicols aa2b7c3b48 Merge branch 'MDL-48807-28' of git://github.com/lameze/moodle into MOODLE_28_STABLE 2015-02-23 15:08:09 +08:00
Simey Lameze 56145a4d6e MDL-48807 core_task: change create_contexts_task to daily frequency 2015-02-23 14:40:37 +08:00
Simey Lameze 34fcdf2da4 MDL-48807 accesslib: table locking fix on all create_level_instance 2015-02-23 14:36:52 +08:00
David Monllao 5e872af220 MDL-49145 report_log: Moving conditions
Now get_url() does not need to be resolved when
we are downloading.
2015-02-23 10:38:47 +08:00
Andrew Nicols 40155b1ca0 Merge branch 'MDL-49174-28' of git://github.com/jleyva/moodle into MOODLE_28_STABLE 2015-02-23 09:36:21 +08:00
Andrew Nicols 75b594848e Merge branch 'MDL-35392-28' of git://github.com/zbdd/moodle into MOODLE_28_STABLE 2015-02-23 09:21:55 +08:00
Zachary Durber ad4d28ff76 MDL-35392 mod_assign: Push feedback to gradebook when releasing grades
When bulk changing workflow status a mismatch in variable
names meant that feedback wasn't being sent to the gradebook.
2015-02-23 09:17:30 +08:00
Andrew Nicols a721901beb Merge branch 'MDL-49145_28' of git://github.com/dmonllao/moodle into MOODLE_28_STABLE 2015-02-23 09:05:58 +08:00
David Monllao e0c5923c07 MDL-49145 report_log: Fixing condition
Credit and thanks to Tyler Bannister and Renaat Debleu.
2015-02-23 08:46:56 +08:00
Andrew Davis bbc7df8d52 MDL-49008 lang: removed preemptive deleting of old language files 2015-02-22 21:08:31 +01:00
Andrew Davis 1ab376e86f MDL-49008 lang: made lang update error reporting work 2015-02-22 21:06:38 +01:00
Dan Marsden 4c30d78891 MDL-46408 mod_scorm: check param is set before using.
The default org is only set if it exists in the imsmanifest.xml
2015-02-20 13:42:23 +13:00
Tim Hunt 87e581f91a MDL-49247 question restore: avoid unique key errors from old bad data
Several tables have had unique keys added to enforce a constraint that
should always have been there. It is possible for old sites to have
data that violate the constraints, and sometimes people want to backup
data from those old sites, and restore them into a new Moodle.
Therefore, we need to guard agains the unique key violation errors.
2015-02-19 21:50:47 +00:00
AMOS bot 4571805430 Automatically generated installer lang files 2015-02-20 00:04:08 +08:00
Jan Eberhardt ec943fe107 MDL-31578 auth_shibboleth: Custom fields added to shibboleth settings
Since LDAP is able to sync custom user profile fields, this feature was
requested for Shibboleth.
2015-02-19 13:56:42 +00:00
Eloy Lafuente (stronk7) 8235b610bb weekly release 2.8.3+ 2015-02-19 10:44:47 +01:00
Eloy Lafuente (stronk7) aff125ae03 Merge branch 'install_28_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_28_STABLE 2015-02-19 10:44:41 +01:00
Damyon Wiese 41adb95781 MDL-49240 webservices: core_get_string and friends bad lang handling
The core_get_string webservice and friends have never passed lang values
properly, (so never worked) and when I fixed that I found they were passing
lang parameter into the lazyload parameter.
2015-02-19 17:42:50 +08:00
Andrew Nicols 7546d2e1c3 Revert "Merge branch 'MDL-49154_28' of git://github.com/timhunt/moodle into MOODLE_28_STABLE"
This reverts commit f5a176c125, reversing
changes made to cf015aa1f0.
2015-02-19 09:18:06 +08:00
Rajesh Taneja 282fdb22ca MDL-48841 admin: Behat table row should start with first row 2015-02-18 15:34:12 +08:00
Botond Hegedus dac942ff58 MDL-49198 core_webservice: Fix error when using existing service name 2015-02-17 23:14:22 -08:00
David Monllao 38a219301e Merge branch 'MDL-49034_m28' of git://github.com/mattporritt/moodle into MOODLE_28_STABLE 2015-02-18 09:36:38 +08:00
Eloy Lafuente (stronk7) 7001bf9a8c Merge branch 'MDL-49211_M28' of git://github.com/lazydaisy/moodle into MOODLE_28_STABLE 2015-02-18 00:03:59 +01:00
Eloy Lafuente (stronk7) 7f8ae8f54e Merge branch 'MDL-48973_28' of https://github.com/pauln/moodle into MOODLE_28_STABLE 2015-02-17 23:52:48 +01:00
Eloy Lafuente (stronk7) f5a176c125 Merge branch 'MDL-49154_28' of git://github.com/timhunt/moodle into MOODLE_28_STABLE 2015-02-17 23:46:47 +01:00
Eloy Lafuente (stronk7) cf015aa1f0 Merge branch 'MDL-49170_28' of https://github.com/totara/openbadges into MOODLE_28_STABLE 2015-02-17 23:43:38 +01:00
Eloy Lafuente (stronk7) d34122424c Merge branch 'MDL-49205_28' of git://github.com/timhunt/moodle into MOODLE_28_STABLE 2015-02-17 22:18:51 +01:00
Juan Leyva 6c1a52e67c MDL-49174 webservices: Return front page contents in get_contents ws 2015-02-17 21:33:42 +01:00
Eloy Lafuente (stronk7) 373252e7da Merge branch 'MDL-49041_28' of git://github.com/timhunt/moodle into MOODLE_28_STABLE 2015-02-17 21:09:26 +01:00
Eloy Lafuente (stronk7) 2f4dfae509 Merge branch 'MDL-49059-split_28' of https://github.com/pauln/moodle into MOODLE_28_STABLE 2015-02-17 20:58:39 +01:00
Eric Merrill 68adf314ec MDL-48993 gradebook: When importing new items, treat blank or - as empty 2015-02-17 17:21:49 +08:00
David Monllao 1c703690cd Merge branch 'MDL-49167-28' of git://github.com/damyon/moodle into MOODLE_28_STABLE 2015-02-17 17:01:26 +08:00
David Monllao 0289d8c766 MDL-48991 gradebook: Return value according to coding style 2015-02-17 16:48:44 +08:00
David Monllao a4e657878b Merge branch 'MDL-48991-28' of git://github.com/merrill-oakland/moodle into MOODLE_28_STABLE 2015-02-17 16:43:44 +08:00
David Monllao b7a6e68906 Merge branch 'MDL-48884_m28' of git://github.com/markn86/moodle into MOODLE_28_STABLE 2015-02-17 14:44:05 +08:00
David Monllao 65b48f6850 Merge branch 'MDL-48841-MOODLE_28_STABLE' of git://github.com/lucisgit/moodle into MOODLE_28_STABLE 2015-02-17 14:25:02 +08:00
Andrew Nicols 6e84137b30 Merge branch 'wip-mdl-48670-m28' of https://github.com/rajeshtaneja/moodle into MOODLE_28_STABLE 2015-02-17 14:07:15 +08:00
David Monllao e9a6191801 Merge branch 'MDL-49169_28' of git://github.com/grabs/moodle into MOODLE_28_STABLE 2015-02-17 14:01:14 +08:00
Mark Nelson 376d6d9bc0 MDL-49200 core_form: corrected string 2015-02-16 21:59:41 -08:00
David Monllao 94b3cc37aa Merge branch 'MDL-48215_m28' of git://github.com/markn86/moodle into MOODLE_28_STABLE 2015-02-17 13:24:36 +08:00
Petr Skoda 401465fe7c MDL-49184 choice: fix block actions
The problems was that blocks editing breaks if you redirect
after if (data_submitted()) - all form actions must make sure
it is really their form, otherwise they may hijack the post from
block actions.

Note that this is not a problem for mforms, only legacy forms
are affected.

# Conflicts:
#	mod/choice/view.php
2015-02-17 16:56:45 +13:00
David Monllao 95337e5974 Merge branch 'MDL-48543-28' of git://github.com/damyon/moodle into MOODLE_28_STABLE 2015-02-17 11:15:12 +08:00
David Monllao a9e2dd494b Merge branch 'MDL-48709_28' of git://github.com/jmvedrine/moodle into MOODLE_28_STABLE 2015-02-17 09:17:25 +08:00
AMOS bot d153a4a39d Automatically generated installer lang files 2015-02-17 00:04:18 +08:00
Michael Hughes 5b7e7362a9 MDL-48215 gradingform_guide: Name length validation
Validating both criterion name and guide name to be 255 chars.
2015-02-15 21:52:56 -08:00
David Monllao 5eed950dd2 Merge branch 'MDL-47529-28' of git://github.com/FMCorz/moodle into MOODLE_28_STABLE 2015-02-16 11:55:39 +08:00
Damyon Wiese fe5ecacb2b MDL-49167 YUI: Fix for theme/yui_combo.php and $CFG->yuislashargs
It was too aggressively cleaning it's params (broken in MDL-48980).
2015-02-16 11:26:11 +08:00
Frederic Massart 84b1aeba07 MDL-47529 lock: Fix typo on lock factory in config-dist 2015-02-16 11:14:20 +08:00
Frederic Massart d940409a40 MDL-47529 task: Remove usage of lock when editing a task 2015-02-16 11:14:20 +08:00
Frederic Massart 58ebc0a42d MDL-47529 task: Do not use lock when updating task records 2015-02-16 11:14:20 +08:00
David Monllao 6eba5f4dfa Merge branch 'MDL-40776_28' of git://github.com/s-cenni/moodle into MOODLE_28_STABLE 2015-02-16 10:35:26 +08:00
Yuliya Bozhko a99654771f MDL-49170 badges: Backpack connection missing a port colon in URL
Signed-off-by: Yuliya Bozhko <yuliya.bozhko@totaralms.com>
2015-02-16 09:34:39 +13:00
Mary Evans 27a5f957ba MDL-49211 theme_bootstrapbase: Text alignment issue in CLOZE questions.
Conflicts:

	theme/bootstrapbase/style/moodle.css
2015-02-15 19:18:17 +00:00
Jean-Michel Vedrine 1a825a276e MDL-48709 mod_lesson: subclusters are not working 2015-02-14 18:21:40 +01:00
Tim Hunt dabbf48f50 MDL-49205 behat: fix I set the field with xpath fail message. 2015-02-13 16:16:18 +00:00
Paul Nicholls 10a382f1c8 MDL-48973 Atto: Atto does not listen to the drop event
The 'drop' event fires before the native ContentEditable drop handler, so
in order to update the underlying textarea we need to call updateOriginal
with a brief delay so that the dropped content has actually been added to
the editor.
2015-02-13 14:50:14 +13:00
Rajesh Taneja 21e8f813dc MDL-48670 behat: Set timezone to Australia/perth
Behat tests might rely on time related tests
Ensure we have default timezone set to Australia/Perth
2015-02-13 08:12:42 +08:00
Eric Merrill 49f1acf174 MDL-48991 gradebook: Fix style problems 2015-02-12 16:50:17 -05:00
Matt Switlik 4f9ccc21d8 MDL-48991 gradebook: Properly import multiple new grade items
Work done in MDL-46547 caused a problem where multiple new grade items
were not imported. Fix up the passing of new grade objects.
2015-02-12 16:50:17 -05:00
Paul Nicholls a92cd1e420 MDL-49059 medialib: Add test cases for invalid Youtube URL param values
Tests to ensure that we're not allowing injection via invalid values of
the Youtube start time and playlist parameters.
2015-02-13 09:46:02 +13:00
Paul Nicholls 40b72c27e8 MDL-49059 medialib: Support links to Youtube videos within playlists
As well as embedding playlists, you can embed specific videos from them -
resulting in the playlist UI displaying, but starting with the specified
video rather than the first in the playlist.  Previously, just the
specified video would embed - without the playlist UI.
2015-02-13 09:46:02 +13:00
Paul Nicholls f266c90917 MDL-49059 medialib: Support start time params in Youtube URLs
Medialib (and thus the Multimedia Plugins filter) was ignoring start time
parameters on YouTube video URLs, meaning that the video would always
start at the start, even when the appropriate parameter was present.
2015-02-13 09:46:02 +13:00
Paul Nicholls 71ce7d03ee MDL-49059 medialib: Add tests for Youtube videos within playlists
As well as embedding playlists, you can embed specific videos from them -
resulting in the playlist UI displaying, but starting with the specified
video rather than the first in the playlist.  These URLs should be covered
by the tests to ensure that we're handling them properly.
2015-02-13 09:46:01 +13:00
Paul Nicholls 7c339df7cb MDL-49059 medialib: Add test cases for Youtube start times
Add test cases to core_medialib_testcase to cover YouTube videos with
start times.
2015-02-13 09:46:01 +13:00
Tim Hunt 8f990cc5bf MDL-49154 behat: step to type with focus on a given element 2015-02-12 20:15:49 +00:00
Andreas Grabs 51112014d2 MDL-49169 user - After MDL-48978-Fix description is not saved anymore 2015-02-12 12:26:03 +01:00
Mike Grant 361370bae3 MDL-37470 blocklib: Respect block weight and offset 2015-02-12 09:43:13 +00:00
David Monllao 201f5085c6 weekly release 2.8.3+ 2015-02-12 15:30:23 +08:00
David Monllao ea836818a5 Merge branch 'install_28_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_28_STABLE 2015-02-12 15:30:21 +08:00
David Monllao 2fb32e8591 Revert "Merge branch 'MDL-36009-28' of git://github.com/jethac/moodle into MOODLE_28_STABLE"
This reverts commit e89bda0f80, reversing
changes made to bec8c20cab.
2015-02-12 13:46:31 +08:00
Ruslan Kabalin d7e275f123 MDL-48841 admin: Fix scheduled task reset to defaults finctionality.
It is safe to make fields as non-required, because form validation will not
pass through any empty field anyway.
2015-02-11 11:18:40 +00:00
Marina Glancy 0a976df90c MDL-49003 login: prevent signup when user is logged in 2015-02-11 00:04:25 +01:00
AMOS bot 924ef95068 Automatically generated installer lang files 2015-02-11 00:04:12 +08:00
Eloy Lafuente (stronk7) 67c51ec7ec Merge branch 'MDL-48910_block_my_28' of https://github.com/andyjdavis/moodle into MOODLE_28_STABLE 2015-02-10 13:22:51 +01:00
Sara Cenni 6473207888 MDL-40776 grade: fix query for report outcomes
Add a missing space to the query for report outcomes to avoid error with Oracle.
2015-02-10 11:52:02 +01:00
David Monllao da6815741e MDL-48679 gradebook: Fixing trailing whitespace 2015-02-10 17:54:40 +08:00
David Monllao 537fd32c02 Merge branch 'MDL-48679-28' of git://github.com/lameze/moodle into MOODLE_28_STABLE 2015-02-10 17:53:19 +08:00
Simey Lameze 9461ad93fd MDL-48679 gradebook: fix grade publishing feature 2015-02-10 17:40:29 +08:00
Simey Lameze 32a491a8d2 MDL-48679 gradebook: helper methods for grade publishing 2015-02-10 17:40:29 +08:00
Dan Poltawski f4241a5974 Merge branch 'wip-mdl-49081-m28' of https://github.com/rajeshtaneja/moodle into MOODLE_28_STABLE 2015-02-10 09:17:58 +00:00
David Monllao 1c65824b82 MDL-48805 theme: Fixing trailing whitespace 2015-02-10 15:46:31 +08:00
David Monllao f556dce6a5 Merge branch 'm28_MDL-48805' of git://github.com/totara/moodle into MOODLE_28_STABLE 2015-02-10 15:27:04 +08:00
Andrew Davis 0cce3ea50d MDL-48910 core_block: user_can_addto() respects applicable formats 2015-02-10 08:17:32 +01:00
Mark Nelson 52781ec82f MDL-48884 mod_assign: prevented setting gradebook feedback unnecessarily 2015-02-09 22:18:15 -08:00
David Monllao 2ee301e041 Merge branch 'm28_MDL-49064' of git://github.com/totara/moodle into MOODLE_28_STABLE 2015-02-10 11:57:47 +08:00
David Monllao fdc6ac362e Merge branch 'MDL-48960-28' of git://github.com/danpoltawski/moodle into MOODLE_28_STABLE 2015-02-10 11:12:33 +08:00
Matt Porritt ceee804962 MDL-49034 enrol_self: Enforce maxlength in self enrolment form fields.
Alter self enrolment creation form to enforce max field lengths.
Limit "Custom instance name" (name) form field to 255 characters via maxlength.
Limit "Enrolment key" (password) form field to 50 characters via maxlength.

Fix for when the form is submitted causing a database write error to be thrown
as corresponding field "name" in the table mdl_enrol is set to varchar(255) and
database field "password" is varying(50).
2015-02-10 13:21:02 +11:00
Eloy Lafuente (stronk7) f16383191b Merge branch 'MDL-48964_28' of git://github.com/jmvedrine/moodle into MOODLE_28_STABLE 2015-02-10 01:10:17 +01:00
Eloy Lafuente (stronk7) 1e968e2d27 Merge branch 'MDL-49073-28' of git://github.com/jethac/moodle into MOODLE_28_STABLE 2015-02-10 01:04:57 +01:00
Dan Poltawski fa75bb63e3 Merge branch 'MDL-48544-28' of git://github.com/andrewnicols/moodle into MOODLE_28_STABLE 2015-02-09 22:42:14 +00:00
Eloy Lafuente (stronk7) d71119dbc5 Merge branch 'wip_MDL-49125_m28_install' of https://github.com/skodak/moodle into MOODLE_28_STABLE 2015-02-09 20:02:05 +01:00
Eloy Lafuente (stronk7) b60a617d3d Merge branch 'MDL-48357-28' of git://github.com/jleyva/moodle into MOODLE_28_STABLE 2015-02-09 15:51:56 +01:00
Dan Poltawski a1504fd7bc Merge branch 'wip-MDL-47558-m28' of git://github.com/marinaglancy/moodle into MOODLE_28_STABLE 2015-02-09 14:50:37 +00:00
Andrew Nicols 531cc5c727 MDL-48544 blocks: Only add docked tags if all blocks are docked
Previously, if all blocks were hidden, then the region was reported as
being docked eroniously and it was not possible to unhide the blocks.

Docking should have no relation to the presence of block content.
2015-02-09 20:55:44 +08:00
Eloy Lafuente (stronk7) 17f0e2a4af Merge branch 'wip-MDL-48794-m28' of git://github.com/marinaglancy/moodle into MOODLE_28_STABLE 2015-02-09 13:05:16 +01:00
Dan Poltawski 6561015165 Merge branch 'MDL-44520-28' of git://github.com/xow/moodle into MOODLE_28_STABLE 2015-02-09 11:33:14 +00:00
Dan Poltawski 69d4a9b94f Merge branch 'MDL-48294-28' of git://github.com/jleyva/moodle into MOODLE_28_STABLE 2015-02-09 11:28:21 +00:00
Dan Poltawski de90103193 Merge branch 'MDL_47085_28' of https://github.com/totara/openbadges into MOODLE_28_STABLE 2015-02-09 10:29:19 +00:00
Dan Poltawski e470238304 Merge branch 'MDL-47953-28' of git://github.com/FMCorz/moodle into MOODLE_28_STABLE 2015-02-09 10:21:42 +00:00
David Monllao 4d31580f93 Merge branch 'MDL-42138-28' of git://github.com/xow/moodle into MOODLE_28_STABLE 2015-02-09 17:18:48 +08:00
David Monllao e89bda0f80 Merge branch 'MDL-36009-28' of git://github.com/jethac/moodle into MOODLE_28_STABLE 2015-02-09 16:59:28 +08:00
Damyon Wiese 68b7d5ce4a MDL-48543 Mathjax: Update default config for JAWS Math player
JAWS Maths player does not recognise the math content when manually specifying the config for MathJax.
If you use one of the default config files it works.
So - we switch our config to the Accessible.js config that it is based off anyway.
There are no features changes with this approach.
2015-02-09 16:32:32 +08:00
Jetha Chan 1f70c8582d MDL-36009 grader_gradereport: filler and extra user cells should not be headers 2015-02-09 13:53:21 +08:00
Yuliya Bozhko 6db8c22913 MDL-47085 badges: Fix badges file download issues
Signed-off-by: Yuliya Bozhko <yuliya.bozhko@totaralms.com>
2015-02-09 16:01:09 +13:00
Petr Skoda 8b198fec72 MDL-49125 install: fix installer notices 2015-02-07 13:13:27 +13:00
Adrian Greeve bec8c20cab MDL-48038 mod_tag: Unit tests for tag cron functions. 2015-02-06 14:50:11 +08:00
Adrian Greeve 3359719ce9 MDL-48038 mod_tag: Improvement of tag cron. 2015-02-06 14:50:11 +08:00
Marina Glancy 9c6dab862a MDL-47558 resource: allow to edit module without being redirected
Thanks to Nathan Lewis for the code suggestion
2015-02-06 13:14:18 +08:00
Rajesh Taneja 6da3248b9f MDL-49110 behat: No expand form required in non-js mode 2015-02-06 13:06:52 +08:00
Tony Levi bd8926f9f3 MDL-49110 behat: Do not poll within spin for non-javascript mode 2015-02-06 13:06:44 +08:00
John Okely 93aa18b8de MDL-44520 behat: Change behat features to use new section selectors 2015-02-06 10:34:59 +08:00
John Okely 4dd5623f18 MDL-44520 behat: Add behat selectors for section, activity 2015-02-06 10:34:59 +08:00
John Okely 722e179f30 MDL-42138 user: Require custom profile fields when registering as guest
Previously when someone registers after logging in as a guest, required
custom profile fields would not be required.

Thanks to Andreas Diendorfer for providing the patch.
2015-02-06 10:11:42 +08:00
Tim Hunt c3ab0b8bbf MDL-49041 qtype_multianswer: don't reveal marks on partial responses
This commit also fixes MDL-32049 about the lack or valdiation message
when an incomplete respnses is submitted.

AMOS BEGIN
 CPY [pleaseananswerallparts,qtype_match],[pleaseananswerallparts,qtype_multianswer]
AMOS END
2015-02-05 20:00:53 +00:00
Jean-Michel Vedrine cc8ac87f01 MDL-48964 mod_lesson: Errors when updating matching questions 2015-02-05 13:23:51 +01:00
Dan Poltawski 96dc38c46a weekly release 2.8.3+ 2015-02-05 10:07:22 +00:00
Dan Poltawski 354e304f29 Merge branch 'install_28_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_28_STABLE 2015-02-05 10:07:20 +00:00
Dan Poltawski 89b92ecbb9 MDL-48960 output: use nofollow attribute to stop crawling invalid links
Both the calendar set url and switch theme links are displayed to
non-logged in users which mean they get crawled by search bots. This
prevents the search bots following these links.
2015-02-05 08:14:02 +00:00
Frederic Massart 37dd88e750 MDL-47953 gradereport_grader: Accurate pagination with suspended users
Thanks to Zvonko Martinovic for pointing out the source of the bug.
2015-02-05 15:08:21 +08:00
AMOS bot 1e826d374e Automatically generated installer lang files 2015-02-05 00:04:10 +08:00
Juan Leyva 14a59f1eee MDL-48294 settings: enablemobilewebservice appears twice 2015-02-04 10:27:00 +01:00
Jetha Chan f4966d09b2 MDL-49073 timezones: update to 2015a (2323 rules) 2015-02-04 13:19:31 +08:00
Rajesh Taneja d603a9c792 MDL-49081 tests: Removed dev option from composer
dev option is enabled by default in composer, so not required.
https://github.com/composer/composer/blob/master/CHANGELOG.md
2015-02-04 10:21:01 +08:00
Dan Poltawski 7606f81a88 Merge branch 'MDL-48942_survey_28' of https://github.com/andyjdavis/moodle into MOODLE_28_STABLE 2015-02-03 15:55:24 +00:00
Dan Poltawski abb61b1a65 Merge branch 'MDL-48955-28' of https://github.com/vadimonus/moodle into MOODLE_28_STABLE 2015-02-03 14:04:37 +00:00
Dan Poltawski 14caa61bd4 Merge branch 'wip-mdl-49002-m28' of https://github.com/rajeshtaneja/moodle into MOODLE_28_STABLE 2015-02-03 13:16:53 +00:00
Dan Poltawski 45acb77a3f Merge branch 'm28_MDL-48799_Incorrect_Legacy_Dir_Fallback' of https://github.com/scara/moodle into MOODLE_28_STABLE 2015-02-03 13:13:25 +00:00
Dan Poltawski 9e98e66cb2 Merge branch 'm28_MDL-48907' of https://github.com/totara/moodle into MOODLE_28_STABLE 2015-02-03 12:56:44 +00:00
Eloy Lafuente (stronk7) b7f6f1c601 MDL-48920 tool_generator: fix unit tests 2015-02-03 12:39:30 +00:00
Dan Poltawski 8bde103118 Merge branch 'MDL-44071-28' of git://github.com/zbdd/moodle into MOODLE_28_STABLE 2015-02-03 12:17:20 +00:00
Dan Poltawski ed67b6fb06 Merge branch 'MDL-48533_m28' of https://github.com/markn86/moodle into MOODLE_28_STABLE 2015-02-03 11:13:50 +00:00
Dan Poltawski 4151d0aa1f MDL-48624 behat: fix trailing whitespace 2015-02-03 11:02:20 +00:00
Dan Poltawski 8bca20b7ec Merge branch 'wip-mdl-48624-m28' of https://github.com/rajeshtaneja/moodle into MOODLE_28_STABLE 2015-02-03 11:01:57 +00:00
Eloy Lafuente (stronk7) a6de116442 Merge branch 'wip-mdl-48403-m28' of https://github.com/rajeshtaneja/moodle into MOODLE_28_STABLE 2015-02-03 11:57:53 +01:00
Eloy Lafuente (stronk7) 314c64ef2f Merge branch 'wip-mdl-49015-m28' of https://github.com/rajeshtaneja/moodle into MOODLE_28_STABLE 2015-02-03 11:52:22 +01:00
Andrew Nicols a43f2c6338 Merge branch 'MDL-48865-28' of git://github.com/xow/moodle into MOODLE_28_STABLE 2015-02-03 16:41:30 +08:00
Neill Magill 401697c397 MDL-48865 core_block: Show regions with only hidden blocks when editing
Before this patch if all the blocks in a block region are set to hidden the region will be docked even when editing is enabled.
This meant that as a user I would need to add a new block to the page and move it to that region via the configuration
menu before I could manipulate the hidden blocks again.
2015-02-03 16:14:36 +08:00
Andrew Nicols 8060291174 Merge branch 'MDL-48920-28' of git://github.com/FMCorz/moodle into MOODLE_28_STABLE 2015-02-03 16:11:44 +08:00
Andrew Nicols 45c07b94fd Merge branch 'tgz_fixing28' of https://github.com/tlevi/moodle into MOODLE_28_STABLE 2015-02-03 16:03:48 +08:00
Andrew Nicols 5b8a93a867 Merge branch '48968-28' of git://github.com/samhemelryk/moodle into MOODLE_28_STABLE 2015-02-03 14:24:42 +08:00
Andrew Nicols 93e95c2579 Merge branch 'MDL-48929-28' of git://github.com/FMCorz/moodle into MOODLE_28_STABLE 2015-02-03 14:09:53 +08:00
Andrew Nicols 8298719c51 MDL-48484 admin: Improve coding style 2015-02-03 13:43:29 +08:00
Andrew Nicols 76ec958619 Merge branch 'm28_MDL-48484' of https://github.com/totara/moodle into MOODLE_28_STABLE 2015-02-03 13:16:36 +08:00
Andrew Nicols fa224641d8 Merge branch 'm28_MDL-46467' of https://github.com/totara/moodle into MOODLE_28_STABLE 2015-02-03 12:59:12 +08:00
Andrew Nicols d9324ce9ee Merge branch 'MDL-48608_m28' of git://github.com/markn86/moodle into MOODLE_28_STABLE 2015-02-03 12:31:06 +08:00
Mark Nelson 7728a2cae3 MDL-48608 mod_assign: correctly display grades for group assignments 2015-02-02 20:16:18 -08:00
Eloy Lafuente (stronk7) 36125f82fa Merge branch 'MDL-48525-28' of git://github.com/jleyva/moodle into MOODLE_28_STABLE 2015-02-03 00:57:46 +01:00
Eloy Lafuente (stronk7) 9555ae2d10 Merge branch 'MDL-48578-28' of git://github.com/jleyva/moodle into MOODLE_28_STABLE 2015-02-03 00:47:40 +01:00
Brian Barnes 8ead44805a MDL-49064 bootstrapbase: fixed rtl alignment of leftalign CSS class 2015-02-03 09:19:29 +13:00
David Monllao e2d914b204 Merge branch 'MDL-31036-28' of git://github.com/zbdd/moodle into MOODLE_28_STABLE 2015-02-02 14:55:01 +08:00
David Monllao 47c6fb2bd3 Merge branch 'MDL-48772-28' of git://github.com/xow/moodle into MOODLE_28_STABLE 2015-02-02 12:29:42 +08:00
David Monllao 8bb969d6cc Merge branch 'wip-mdl-46626-m28' of git://github.com/rajeshtaneja/moodle into MOODLE_28_STABLE 2015-02-02 12:08:37 +08:00
Brian Barnes dcde7ca176 MDL-48484 admin: Added labels to configtime settings 2015-02-02 16:34:36 +13:00
AMOS bot 798790c4e8 Automatically generated installer lang files 2015-02-02 00:04:06 +08:00
Matteo Scaramuccia 48a515c37b MDL-48799 Files API: fixed legacy directory fallback. 2015-02-01 09:16:41 +01:00
Eloy Lafuente (stronk7) 68b1fd2c55 Moodle release 2.8.3 2015-01-30 12:35:40 +01:00
Zachary Durber 07f99ca6d6 MDL-31036 mod_assign: Don't strip quickgrading feedback of special chars 2015-01-30 14:37:55 +08:00
John Okely b4ac530cf2 MDL-48772 enrol_cohort: Replace hardcoded language with language strings 2015-01-30 11:36:06 +08:00
Rajesh Taneja b3486b0192 MDL-48403 behat: Select text in atto editor before inserting image 2015-01-30 10:10:46 +08:00
Tyler Bannister ab4a3e8cb1 MDL-46626 report_log: Removed HTML from log report export
This is a partial backport of MDL-34867
2015-01-30 09:09:37 +08:00
Rajesh Taneja c9d53c1e17 MDL-49002 mod_lesson: Added @_file_upload tag to avoid random fails 2015-01-30 09:01:13 +08:00
Rajesh Taneja 66293e8414 MDL-49015 mod_lesson: Removed unused image insert step in behat 2015-01-30 08:58:52 +08:00
Rajesh Taneja f8fe046fb5 MDL-49015 mod_lesson: Don't rely on external links in behat 2015-01-30 08:58:52 +08:00
Rajesh Taneja a686d8374a MDL-48624 behat: Added page load check in workshop step
i_allocate_submissions_in_workshop_as step sometimes
fails because of server speed. Added page load check
with extended timout.
2015-01-30 08:55:30 +08:00
Rajesh Taneja c441c21e7a MDL-48624 behat: Added extended timeout to ensure step pass
following_should_download_between_and_bytes step sometimes
fails because of server speed. Added extended timout
ensuring they wait enough before failing.
Also, not calling force download while running behat site
2015-01-30 08:55:29 +08:00
Vadim Dvorovenko d3f49a8c84 MDL-48955 filter_mathjax: Regexp fix for texfiltercompatibility mode
Fixing incorrect regexp for replacing text like
"$$a$$ and $$b$$" to "\(a\) and \(b\)". This is needed for
texfiltercompatibility to work as expected.
2015-01-29 23:16:51 +07:00
AMOS bot e5cfbd85d8 Automatically generated installer lang files 2015-01-30 00:04:12 +08:00
Juan Leyva 060c2d3c9c MDL-48357 webservices: Missing instance property in course contents ws 2015-01-29 14:15:16 +01:00
Tony Levi 846711d69f MDL-48924 backup: Fix some get_file_packer() calls for enabletgzbackups 2015-01-29 22:53:14 +10:30
Eloy Lafuente (stronk7) 6e1308b948 weekly release 2.8.2+ 2015-01-29 10:28:18 +01:00
Eloy Lafuente (stronk7) c889f1b592 Merge branch 'install_28_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_28_STABLE 2015-01-29 10:28:13 +01:00
Andrew Nicols 4d3403d5a7 Merge branch 'MDL-36877_28' of https://github.com/jmvedrine/moodle into MOODLE_28_STABLE 2015-01-29 09:10:04 +08:00
Jean-Michel Vedrine fc0613cb0c MDL-36877 mod_lesson: Fix while MDL-38578 is not solved 2015-01-28 21:25:55 +01:00
Juan Leyva 6dbf42a600 MDL-48525 webservices: Fixed profile user image is not always returned 2015-01-28 17:20:37 +01:00
Juan Leyva 4a97b8476b MDL-48578 webservices: Fixed missing required library 2015-01-28 14:44:48 +01:00
Simon Coggins 9b59baccb1 MDL-48855 dev: Fix ctags command to handle extra whitespace 2015-01-28 12:42:15 +01:00
Marina Glancy d08b45781f MDL-48978 user: fixed regression from MDL-37704 2015-01-28 11:58:48 +01:00
David Monllao 43439ea041 Merge branch 'MDL-48914-28' of git://github.com/rtcn2/moodle into MOODLE_28_STABLE 2015-01-28 17:44:49 +08:00
Andrew Nicols 2ceba911aa MDL-48542 user_menu: Handle invalid strings better 2015-01-28 15:38:56 +08:00
Damyon Wiese a72f2cca7f MDL-48980 Security: Always clean the result from min_get_slash_argument
The result from this function is used in send_file calls and if unclean
(windows dir separators, or .. path components) it could expose sensitive
files (e.g. .php files). Now we always clean the result from this function
even if it means double cleaning.

I also fixed the unit test for this function and added a new test for this cleaning.

I also updated the comments to point to get_file_argument as the full version of
min_get_slash_argument.
2015-01-28 14:38:11 +08:00
Andrew Nicols 2f12e58ce4 Merge branch 'MDL-41026-28-fixes' of git://github.com/andrewnicols/moodle into MOODLE_28_STABLE 2015-01-28 13:59:15 +08:00
Andrew Nicols e86817b76c MDL-41026 webservices: Correct unit tests 2015-01-28 13:58:46 +08:00
Andrew Nicols f6ab2b1ccf MDL-48542 user_menu: Increment index for all menu items
The invalid type was not causing the idx to incremented, thus missing off
the final divider.
2015-01-28 12:10:45 +08:00
Andrew Nicols ba43cfbd21 MDL-48542 user_menu: Improve user menu tests
Add additional test cases, and actually test that the output is roughly
what we expect.
2015-01-28 12:10:44 +08:00
Andrew Nicols cd1ea20389 Merge branch 'MDL-48542-28' of git://github.com/jethac/moodle into MOODLE_28_STABLE 2015-01-28 12:09:46 +08:00
Andrew Nicols 412aa0210b Merge branch 'MDL-41026-28' of git://github.com/ankitagarwal/moodle into MOODLE_28_STABLE 2015-01-28 10:06:28 +08:00
Eloy Lafuente (stronk7) 7e67e4d619 Merge branch 'MDL-48685-28' of git://github.com/andrewnicols/moodle into MOODLE_28_STABLE 2015-01-28 00:46:29 +01:00
Eloy Lafuente (stronk7) 510ffce704 Merge branch 'MDL-48660-m28' of https://github.com/sammarshallou/moodle into MOODLE_28_STABLE 2015-01-27 21:13:45 +01:00
AMOS bot ad93802610 Automatically generated installer lang files 2015-01-28 00:04:23 +08:00
Eloy Lafuente (stronk7) 8d4ef0df4b Merge branch 'MDL-40285_m28' of git://github.com/markn86/moodle into MOODLE_28_STABLE 2015-01-27 12:21:11 +01:00
Eloy Lafuente (stronk7) 01f200ad39 Merge branch 'MDL-48383-28' of git://github.com/FMCorz/moodle into MOODLE_28_STABLE 2015-01-27 12:01:24 +01:00
sam marshall b749aaa935 MDL-48660 Availability: filter_user_list() should respect 'view hidden'
Updated filter_user_list and get_user_list_sql to account for
the viewhiddenactivities and viewhiddensections capabilities.
2015-01-27 10:59:53 +00:00
Mark Nelson 041dd2902d MDL-40285 mod_assign: added extra group submissions behat scenario
Thanks a lot to Jody Steele for providing the basis for the scenario.
2015-01-27 00:35:31 -08:00
Mark Nelson 790eb7ee05 MDL-40285 mod_assign: show details for all default group members 2015-01-27 00:35:31 -08:00
Andrew Nicols 97f243a916 Merge branch 'MDL-47871_m28' of https://github.com/markn86/moodle into MOODLE_28_STABLE 2015-01-27 13:13:57 +08:00
Jerome Mouneyrac 27acee5df2 MDL-41026 webservices: use correct param format in external apis 2015-01-27 10:08:25 +05:30
James Henestofel 9f5571d405 MDL-44071 webservices: Sorting courses post deletion.
Signed-off-by: Zachary Durber <zdurber@gmail.com>
2015-01-27 11:40:58 +08:00
Mark Nelson aee1045f7e MDL-47871 tool_monitor: allow teachers to duplicate site rules 2015-01-26 19:36:27 -08:00
Frederic Massart fa5aa434bd MDL-48920 tool_generator: Use 'real' names during course generation 2015-01-27 11:27:55 +08:00
Andrew Nicols d110033f81 Merge branch 'MDL-48491-28' of git://github.com/zbdd/moodle into MOODLE_28_STABLE 2015-01-27 10:57:57 +08:00
Brian Barnes 1ff8d56a2e MDL-46467 forms: Labels have "for" attribute even when frozen 2015-01-27 14:55:26 +13:00
Andrew Nicols eeaf95494f MDL-48685 core_useragent: Correct IE 5.0 issues 2015-01-27 08:36:28 +08:00
Andrew Nicols 483bdb5c24 MDL-48685 tests: Add testing for supports_json_contenttype 2015-01-27 08:36:28 +08:00
Andrew Nicols 54d3ed0357 MDL-48685 tests: Add additional User Agents
* Firefox 33; Mac OS X 10.10
* Chrome 39; Mac OS X
* Safari; iPhone 6 Plus; iOS 8.1; Build 12B411
* Opera 12.15 (Build 1748); Mac OS X
2015-01-27 08:36:28 +08:00
Andrew Nicols 89cb4f9f35 MDL-48685 tests: Rewrite useragent tests 2015-01-27 08:36:27 +08:00
Eloy Lafuente (stronk7) 0c6add5bf9 Merge branch 'MDL-48916_28' of https://github.com/wesleysitu/moodle into MOODLE_28_STABLE 2015-01-27 01:09:35 +01:00
Eloy Lafuente (stronk7) f3a8098268 Merge branch 'MDL-48921-28-2nd' of git://github.com/FMCorz/moodle into MOODLE_28_STABLE 2015-01-27 01:02:46 +01:00
Eloy Lafuente (stronk7) c3e2b05d40 Merge branch 'wip-MDL-48325-28' of git://github.com/abgreeve/moodle into MOODLE_28_STABLE 2015-01-27 00:25:57 +01:00
Eloy Lafuente (stronk7) 7458e60445 Merge branch 'MDL-48720-28' of git://github.com/andrewnicols/moodle into MOODLE_28_STABLE 2015-01-26 19:11:34 +01:00
Eloy Lafuente (stronk7) bf986b9e45 Merge branch 'MDL-35765-28' of git://github.com/merrill-oakland/moodle into MOODLE_28_STABLE 2015-01-26 17:32:25 +01:00
Eloy Lafuente (stronk7) e534402886 Merge branch 'MDL-36877_28' of git://github.com/jmvedrine/moodle into MOODLE_28_STABLE 2015-01-26 16:04:37 +01:00
Andrew Davis 2e77d5ec7b MDL-48942 mod_survey: synced security checks in view.php and graph.php 2015-01-26 15:06:28 +01:00
Eloy Lafuente (stronk7) 22896c10ba Merge branch 'MDL-48711-28' of git://github.com/merrill-oakland/moodle into MOODLE_28_STABLE 2015-01-26 11:14:42 +01:00
Eloy Lafuente (stronk7) 58ad8a2321 Merge branch 'MDL-43421-28' of git://github.com/mr-russ/moodle into MOODLE_28_STABLE 2015-01-26 10:24:59 +01:00
Brian Barnes e5a35eb25f MDL-48805 theme: Collapse now collapses all data-target 2015-01-26 11:32:10 +13:00
Valerii Kuznetsov d5da6e42c2 MDL-48968 blocks: fixed bug with pagetype handling 2015-01-26 09:28:41 +13:00
Jean-Michel Vedrine cbc028dbae MDL-36877 Lesson: final page not displayed if show gradebook set to no 2015-01-25 19:44:19 +01:00
Rod Norfor fc811dd468 MDL-48914 admin: check maxuserperpage in existingroleholders->find_users 2015-01-23 15:59:34 +00:00
Nelson Moller 116dd8a02f MDL-48929 repository_filesystem: Valide relative path against realpath
On Windows systems, there could have been a mix of back and forward
slashes, causing the validation of the relative path to fail. Now
we will always get the realpath before comparing.
2015-01-23 17:28:19 +08:00
Andrew Nicols c06aa292b1 weekly release 2.8.2+ 2015-01-23 08:28:04 +08:00
Andrew Nicols e52a55c407 Merge branch 'install_28_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_28_STABLE 2015-01-23 08:27:57 +08:00
Dan Poltawski 0b331a73c6 Merge branch 'MDL-48949_28' of git://github.com/timhunt/moodle into MOODLE_28_STABLE 2015-01-22 17:53:23 +00:00
Tim Hunt a52b56b719 MDL-48949 mod_lti: tidy mod/lti/upgrade.txt 2015-01-22 17:29:39 +00:00
Adrian Greeve a6acd5ff4f MDL-48325 mod_data: Export to portfolio button uses capability.
The Export to portfolio button now checks the mod/data:exportownentry
capability to see if the export button should be shown.
2015-01-22 14:59:33 +08:00
Zachary Durber 3a57e2a532 MDL-48491 enrolments: Paypal enrolments send email as support user. 2015-01-22 13:47:45 +08:00
Andrew Nicols a1d1479ff1 Revert "Merge branch 'wip-mdl-48624-m28' of https://github.com/rajeshtaneja/moodle into MOODLE_28_STABLE"
This reverts commit 48549b6515, reversing
changes made to 87802c924f.
2015-01-22 12:16:27 +08:00
Frederic Massart 737a5f7fe4 MDL-48383 task: Indicate when a task will not run if plugin is disabled 2015-01-22 11:08:10 +08:00
Eloy Lafuente (stronk7) a51d8d8560 Merge branch 'MDL-48823_28' of git://github.com/dmonllao/moodle into MOODLE_28_STABLE 2015-01-21 12:32:28 +01:00
Frederic Massart b71598cf81 MDL-48921 admin: Keep the search string in the URL after form submission 2015-01-21 15:50:51 +08:00
Andrew Nicols 9a0284c657 MDL-48720 mod_forum: Tidy up whitespace to comply with coding style 2015-01-21 12:42:42 +08:00
Andrew Nicols 9a220d7976 MDL-48720 mod_forum: Only copy discussion preferences when moving posts
Rather than adding discussion preferences to a user based upon their
subscription to the source forum, only respect any actively selected
preference. That is to say that:
* if a user has opted into a discussion and following a move would be
  unsubscribed, re-subscribe them;
* if a user has opted out of a discussion and following a move would be
  subscribed once more, unsubscribe them; and
* if a user has not made an active choice, follow the discussion preference
  for the target forum.
2015-01-21 12:42:41 +08:00
David Monllao b550538ce3 MDL-48823 admin: Just one admin tree reload after settings changes 2015-01-21 10:42:17 +08:00
Andrew Nicols 89b5e52ba8 Merge branch 'wip-mdl-48761-m28' of https://github.com/rajeshtaneja/moodle into MOODLE_28_STABLE 2015-01-21 10:22:01 +08:00
Rajesh Taneja e947035dc7 MDL-48761 behat: Added new step for debugging scenarios 2015-01-21 10:17:39 +08:00
Wesley Situ 0c8e82aade MDL-48916 atto_undo: Clarify text for "Undo/Redo" 2015-01-20 16:21:02 -08:00
Eloy Lafuente (stronk7) af04908d0d Merge branch 'wip-MDL-48847-m28' of git://github.com/marinaglancy/moodle into MOODLE_28_STABLE 2015-01-21 00:28:38 +01:00
Eloy Lafuente (stronk7) 4c8fae005e Merge branch 'MDL-48830-m28' of https://github.com/micaherne/moodle into MOODLE_28_STABLE 2015-01-21 00:04:14 +01:00
Brian Barnes 044b689308 MDL-48907 grades: fixed display of grade tabs 2015-01-21 10:37:54 +13:00
Eric Merrill 2c1f64c0da MDL-48711 gradebook: Properly compute extra-redit status for cat grades
When seeing if a grade item for a category is computed for extra-credit
status, we need to use the *grandparent* of the item.
2015-01-20 16:06:02 -05:00
Eric Merrill e8a979d4bb MDL-35765 availability: Use category total full names 2015-01-20 15:38:07 -05:00
Eloy Lafuente (stronk7) c41fe79c85 Merge branch 'MDL-48873_moodle28' of https://github.com/StudiUM/moodle into MOODLE_28_STABLE 2015-01-20 19:27:22 +01:00
Eloy Lafuente (stronk7) 189dee55d4 Merge branch 'MDL-48813_m28' of git://github.com/sbourget/moodle into MOODLE_28_STABLE 2015-01-20 19:20:39 +01:00
Eloy Lafuente (stronk7) 7f2083fadf Merge branch 'wip-mdl-48837-m28' of https://github.com/rajeshtaneja/moodle into MOODLE_28_STABLE 2015-01-20 18:52:14 +01:00
Dan Poltawski f11c6059ea Merge branch 'MDL-48798-28' of https://github.com/vadimonus/moodle into MOODLE_28_STABLE 2015-01-20 17:50:24 +00:00
Eloy Lafuente (stronk7) 45b68d3cdd Merge branch 'MDL-48477_28' of git://github.com/timhunt/moodle into MOODLE_28_STABLE 2015-01-20 18:44:43 +01:00
Eloy Lafuente (stronk7) 38e8b26234 Merge branch 'MDL-48779-28' of https://github.com/vadimonus/moodle into MOODLE_28_STABLE 2015-01-20 18:41:21 +01:00
Eloy Lafuente (stronk7) dfe44858da Merge branch 'MDL-47792_28' of git://github.com/dmonllao/moodle into MOODLE_28_STABLE 2015-01-20 18:38:06 +01:00
Dan Poltawski 2f0f15c2e7 Merge branch 'wip-mdl-48831-m28' of https://github.com/rajeshtaneja/moodle into MOODLE_28_STABLE 2015-01-20 17:30:50 +00:00
Dan Poltawski f40423c766 Merge branch 'MDL-48829_28' of git://github.com/timhunt/moodle into MOODLE_28_STABLE 2015-01-20 17:07:54 +00:00
Eloy Lafuente (stronk7) 48549b6515 Merge branch 'wip-mdl-48624-m28' of https://github.com/rajeshtaneja/moodle into MOODLE_28_STABLE 2015-01-20 17:34:04 +01:00
Eloy Lafuente (stronk7) 87802c924f Merge branch 'MDL-47166-28' of git://github.com/andrewnicols/moodle into MOODLE_28_STABLE 2015-01-20 16:15:46 +01:00
David Monllao e31f7ac7b9 Merge branch 'MDL-48765-28' of git://github.com/gurgus/moodle into MOODLE_28_STABLE 2015-01-20 17:08:57 +08:00
David Monllao f3b0ba7c8f Merge branch 'MDL-48776-28' of git://github.com/gurgus/moodle into MOODLE_28_STABLE 2015-01-20 16:07:54 +08:00
Andrew Nicols 8b6412b1f7 Merge branch 'MDL-42172-28' of https://github.com/vadimonus/moodle into MOODLE_28_STABLE 2015-01-20 15:43:15 +08:00
Patrik Granlöv f9d5676c10 MDL-35486 outputlib: Fix typos in comments
Just a copy-past text error in two comments.
2015-01-20 14:03:34 +08:00
Andrew Nicols af152f8d1e Merge branch 'MDL-44560-28' of git://github.com/xow/moodle into MOODLE_28_STABLE 2015-01-20 13:26:02 +08:00
Andrew Nicols 628109a9cf Merge branch 'MDL-38277_m28' of https://github.com/sbourget/moodle into MOODLE_28_STABLE 2015-01-20 12:44:40 +08:00
Aaron Barnes 6aca5dd717 MDL-47792 javascript: Fix for cropped headers and horizontal align 2015-01-20 11:40:19 +08:00
Jean-Michel Vedrine 7e11f1b2f5 MDL-48596 mod_lesson: editing interface won't expand to full screen 2015-01-20 11:05:04 +08:00
Andrew Nicols 054221331a Merge branch 'MDL-48741_28' of git://github.com/stronk7/moodle into MOODLE_28_STABLE 2015-01-20 09:56:47 +08:00
Jetha Chan 2dfdb127b6 MDL-48542 user_menu: add proper divider support
Added divider support to the user menu; hardened the custom user menu against invalid input.
2015-01-19 23:58:40 +08:00
Jetha Chan 3014b8cb60 MDL-48542 user_menu: add custom user menu unit test 2015-01-19 23:58:40 +08:00
Dave Cooper 5c703c83fd MDL-48776 core_message: Fixed userid check.
Thanks to Oleg Demeshev for providing the patch.
2015-01-19 15:21:03 +08:00
Andrew Nicols 24b7c67edb Merge branch 'MDL-46976-28' of git://github.com/danpoltawski/moodle into MOODLE_28_STABLE 2015-01-19 12:19:16 +08:00
Andrew Nicols 695503a7f1 Merge branch 'MDL-48073-28' of git://github.com/gurgus/moodle into MOODLE_28_STABLE 2015-01-19 11:37:22 +08:00
Nivedita Setru 542db0f6fe MDL-48073 enrol: Fixed group filter resetting erroneously. 2015-01-19 11:26:07 +08:00
Rajesh Taneja 33211ce256 MDL-48624 behat: Added extended timeout in workshop step
i_allocate_submissions_in_workshop_as step sometimes
fails because of server speed. Added extended timout
ensuring they wait enough before failing.
2015-01-19 10:18:49 +08:00
Rajesh Taneja 20a095345b MDL-48624 behat: Added extended timeout to ensure step pass
following_should_download_between_and_bytes step sometimes
fails because of server speed. Added extended timout
ensuring they wait enough before failing.
Also, not calling force download while running behat site
2015-01-19 10:18:42 +08:00
Jean-Michel Vedrine 175b34c45d MDL-43386 Lesson: Grade essay student response formatting not correct 2015-01-18 20:41:51 +01:00
Vadim Dvorovenko a8808ad7ba MDL-42172 Authentification: Adding alternate names to "Lock user fields"
Adding alternate name fields (firstnamephonetic, lastnamephonetic,
middlename, alternatename) to "Lock user fields" for all
authentification plugins. This is needed to sync alternate name fields
with external data sources and to lock them for editing.
2015-01-17 23:10:09 +07:00
Vadim Dvorovenko 5e25d5630b MDL-48798 Statistics: Adding lang string for user activity.
New lang string for 'Activity' (meaning count of user actions) in stats
reports to disambiguate it with 'Activity' (meaning course module).

AMOS BEGIN
 CPY [activity,core],[useractivity,core]
AMOS END
2015-01-17 23:04:11 +07:00
AMOS bot 778e83669f Automatically generated installer lang files 2015-01-18 00:03:58 +08:00
Vadim Dvorovenko ad2c1a2156 MDL-48779 MNet: multibyte substr in certificate generation
Using core_text::substr instead of substr for trimming certificate
data. Is needed for sites with long unicode sitename to prevent
breaking line between unicode pair.
2015-01-17 23:01:47 +07:00
Gilles-Philippe Leblanc 6dc66f5a48 MDL-48873 auth_cas: Wrong redirection with bad multiauth login 2015-01-16 11:55:08 -05:00
Ray Bon 54ea4bee35 MDL-48837 phpunit: Restore system default timezone 2015-01-16 12:47:13 +08:00
John Okely 3bb4665841 MDL-44560 glossary: Fix pagination on glossary category view
Credit to Sebastian B for this fix
2015-01-16 11:12:42 +08:00
Rajesh Taneja f0724d200a MDL-48831 behat: Added behat test for label activity
Thanks to Neill Magill, for providing test feature.
2015-01-16 10:39:05 +08:00
Rajesh Taneja a43bbc7838 MDL-48831 behat: Fixed activity show hide for label
Labels are not links and have dimmed_text class
So updated find query for show/hide activity check
2015-01-16 10:39:05 +08:00
Eloy Lafuente (stronk7) 7e5840e4b6 MDL-48741 behat: add new moodle_list formatter (rerun compatible) 2015-01-16 03:14:56 +01:00
Stephen Bourget 521af16fe5 MDL-38277 Lesson: Fix strings on activity report 2015-01-15 12:56:25 -05:00
Tim Hunt 27fc1831e8 MDL-48829 quiz nav: add a data attr to buttons giving the page
This way, if you need to know which page each button goes to in
JavaScript, you can find out.
2015-01-15 10:18:39 +00:00
Tim Hunt 142c67ce07 MDL-48477 questions: no delete icon for only top-level category
The back end code already threw an exception if you clicked the icon,
so you could not delete the category, but we should not have shown the
icon in the first place.

Thanks to Pramith Dayananda for working out the fix for this issue. I am
just committing it.
2015-01-15 10:18:31 +00:00
Michael Aherne 5b469142de MDL-48830 accesslib: Add sort field to query 2015-01-15 10:17:08 +00:00
Andrew Nicols 2ea6a2b161 weekly release 2.8.2+ 2015-01-15 14:20:20 +08:00
Andrew Nicols 273eec1330 Merge branch 'install_28_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_28_STABLE 2015-01-15 14:20:09 +08:00
Charles Fulton 147d54f9ff MDL-48765 enrol: do not use a non-breaking space as a separator 2015-01-15 11:21:19 +08:00
Marina Glancy a9bac80cac MDL-48847 groups: fixed incorrect user count 2015-01-15 11:12:25 +08:00
Dan Poltawski 1dcf25db8b MDL-46976 user: trim whitespace from input email address
Don't complain about invalid email address, we are a computer, we
love the jobs users hate.

ref: https://www.youtube.com/watch?v=5tquSbZEP-g
2015-01-14 17:14:50 +00:00
AMOS bot e6b538e2a2 Automatically generated installer lang files 2015-01-15 00:04:03 +08:00
Dan Poltawski c5203c98bf Merge branch 'MDL-14730_28' of git://github.com/jmvedrine/moodle into MOODLE_28_STABLE 2015-01-14 10:27:46 +00:00
John Okely 27cf863db5 MDL-47761 enrol: Show more detail for self-enrolment errors
Thanks to Mirko Otto for the solution
2015-01-14 00:30:15 +01:00
Eloy Lafuente (stronk7) 76da38fd5c Merge branch 'M28_MDL-48574_workflow_state_updated_batch_single' of https://github.com/Dave-B/moodle into MOODLE_28_STABLE 2015-01-14 00:14:45 +01:00
Eloy Lafuente (stronk7) 87caaf87e3 Merge branch 'MDL-41166-28' of git://github.com/danpoltawski/moodle into MOODLE_28_STABLE 2015-01-13 23:42:25 +01:00
Eloy Lafuente (stronk7) bb1aaadf48 Merge branch 'MDL-48753_m28' of git://github.com/markn86/moodle into MOODLE_28_STABLE 2015-01-13 15:48:42 +01:00
Dan Poltawski 601c8883c8 Merge branch 'MDL-36824_m28' of https://github.com/sbourget/moodle into MOODLE_28_STABLE 2015-01-13 13:15:06 +00:00
Dan Poltawski f049403ed1 Merge branch 'MDL-39103-28' of git://github.com/xow/moodle into MOODLE_28_STABLE
Conflicts:
	mod/lesson/lib.php
2015-01-13 12:54:53 +00:00
Dan Poltawski 7e6be7ba1f Merge branch 'MDL-45784-28' of git://github.com/xow/moodle into MOODLE_28_STABLE 2015-01-13 12:34:45 +00:00
Dan Poltawski 1d0a5a5be9 Merge branch 'MDL-48474_28' of git://github.com/timhunt/moodle into MOODLE_28_STABLE 2015-01-13 11:47:53 +00:00
Stephen Bourget 871a756d06 MDL-48750 Lesson: Behat test for lesson attempt info
behat test provided by Jean-Michel Vedrine
2015-01-13 10:59:53 +00:00
Stephen Bourget 6c5b72e889 MDL-48750 Lesson: Fix attempt info displayed by course overview block 2015-01-13 10:59:29 +00:00
Dan Poltawski 7f3932c840 Merge branch 'MDL-40326_28' of git://github.com/jmvedrine/moodle into MOODLE_28_STABLE 2015-01-13 10:08:18 +00:00
Dan Poltawski 4ed7ae68a0 Merge branch 'MDL-48510-28' of git://github.com/ankitagarwal/moodle into MOODLE_28_STABLE 2015-01-13 08:29:11 +00:00
Ankit Agarwal 64a15b04b1 MDL-48510 inbound: use 0 expiration for private files handler 2015-01-13 09:29:13 +05:30
Ankit Agarwal 8293f6c86f MDL-48510 inbound: Support disabling of expiration changes in UI 2015-01-13 09:26:20 +05:30
Ankit Agarwal 5a8291753a MDL-48510 inbound: Use correct value of expiration 2015-01-13 09:26:20 +05:30
Andrew Nicols 312163cd26 Merge branch 'MDL-43898-28' of git://github.com/danpoltawski/moodle into MOODLE_28_STABLE 2015-01-13 10:28:12 +08:00
Stephen Bourget 282c5c2b7d MDL-48813 Lesson: Remove unused GROUPMEMBERSONLY 2015-01-12 16:38:47 -05:00
Eloy Lafuente (stronk7) de12ede98e MDL-35155 database: better sql_substr() impl. for mssql/sqlsrv + unit tests
MSSQL's substring() implementation is somehow silly/strict and unable to
perform implicit casts to integer both for the start and length parameters.

This hits Moodle badly because of another problems (MDL-23997) we decided
to cast to string all bound placeholders long ago.

So this commit just enforces the cast of the start and length parameters to
integer. And includes unit tests for using placeholders on all positions in
the sql_substr() method.
2015-01-12 18:26:38 +01:00
Eloy Lafuente (stronk7) 817f22818b Merge branch 'MDL-35155-28' of git://github.com/danpoltawski/moodle into MOODLE_28_STABLE 2015-01-12 18:26:29 +01:00
AMOS bot 2aaab5b275 Automatically generated installer lang files 2015-01-13 00:04:00 +08:00
AMOS bot 3571d0a90e Automatically generated installer lang files 2015-01-13 00:04:00 +08:00
Dan Poltawski d926178366 Merge branch 'MDL-31774_28' of git://github.com/jmvedrine/moodle into MOODLE_28_STABLE 2015-01-12 14:37:51 +00:00
Dan Poltawski 1cc4ac0486 Merge branch 'MDL-47935-28' of git://github.com/gurgus/moodle into MOODLE_28_STABLE 2015-01-12 12:59:39 +00:00
Dan Poltawski f7ae8d3b11 Merge branch 'MDL-44907-28' of git://github.com/FMCorz/moodle into MOODLE_28_STABLE 2015-01-12 11:30:32 +00:00
Marina Glancy 054609f8b0 MDL-48794 report_log: make sure y-axis gridlines in graphs are integers 2015-01-12 16:21:37 +08:00
Andrew Nicols 595b56d28d Merge branch 'MDL-46671-28' of https://github.com/pjking07/moodle into MOODLE_28_STABLE 2015-01-12 13:57:10 +08:00
Andrew Nicols 55f84c72b4 Merge branch 'MDL-47425-28' of git://github.com/zbdd/moodle into MOODLE_28_STABLE 2015-01-12 13:44:26 +08:00
Sam Hemelryk 2dcc434f67 MDL-48753 badges: converted func to named params
Converted the SQL params within badges_get_user_badges to
named params.
Unit tests added for this function at the same time.
UI covered by behat already.
2015-01-11 20:12:29 -08:00
Andrew Nicols 80eec75b85 Merge branch 'MDL-38142-28' of git://github.com/FMCorz/moodle into MOODLE_28_STABLE 2015-01-12 11:56:30 +08:00
Andrew Nicols 270c4a7fa3 Merge branch 'MDL-47692_m28' of git://github.com/markn86/moodle into MOODLE_28_STABLE 2015-01-12 11:30:00 +08:00
Jean-Michel Vedrine db63d99dbf MDL-31774 mod_lesson: Wrong jumps in lessons with mutiple clusters 2015-01-10 18:41:00 +01:00
AMOS bot 362834051b Automatically generated installer lang files 2015-01-11 00:04:06 +08:00
Eloy Lafuente (stronk7) f2c730fecf Moodle release 2.8.2 2015-01-10 13:12:58 +01:00
Stephen Bourget 26879477ce MDL-36824 Lesson: Media File should be displayed as a block 2015-01-09 18:17:15 -05:00
David Balch aed75e9597 MDL-48574 assign: Test workflow_state_updated fired on batch and single. 2015-01-09 15:24:25 +00:00
Jean-Michel Vedrine 6d4858392b MDL-14730 mod_lesson: allow linking to pages inside a lesson 2015-01-09 11:39:40 +01:00
Dave Cooper 19f78c1c84 MDL-47935 Atto: Moved atto notification message position 2015-01-09 15:55:18 +08:00
Zachary Durber b79691baea MDL-47425 mod_assign: Allow sorting by state without submissions.
Special thanks to Antton Rodriguez for the suggested patch.
2015-01-09 14:49:45 +08:00
Frederic Massart fec61db075 MDL-38142 mod_forum: Allow viewing of student posts in hidden courses 2015-01-09 11:38:12 +08:00
Andrew Nicols dde9be79c3 MDL-47166 atto_indent: Swap Outdent and Indent 2015-01-09 09:21:59 +08:00
Tim Hunt c38eb4e6e6 MDL-48474 qtype_shortanswer: answers were not being trimmed.
This fix is based on Oleg Sychev's suggestion. Thanks.
2015-01-08 17:43:18 +00:00
AMOS bot 812779dfa2 Automatically generated installer lang files 2015-01-09 00:04:08 +08:00
Dan Poltawski ed46f0deb1 weekly release 2.8.1+ 2015-01-08 10:00:28 +00:00
Dan Poltawski 9c1f1cda90 Merge branch 'install_28_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_28_STABLE 2015-01-08 10:00:26 +00:00
Frederic Massart 2981fb45a0 MDL-44907 admin: Better styling of admin settings validation errors
Conflicts:
	theme/bootstrapbase/style/moodle.css
2015-01-08 16:23:34 +08:00
Dan Poltawski fa01f2b45a MDL-35155 dml: add unit test which exposes substr problem
Previously, when using parameters, substring broke on mssql.
2015-01-08 08:14:10 +00:00
Simon Coggins 48ddb7968f MDL-35155: Fix MSSQL bug in sql_substr() 2015-01-08 08:14:09 +00:00
Mark Nelson 7bc0151a4c MDL-48533 report_backups: added ability to view backup logs 2015-01-07 22:25:04 -08:00
Mark Nelson 85f5d4ac95 MDL-48533 core_backup: use default log level when none specified 2015-01-07 22:25:03 -08:00
John Okely fd648fd5f0 MDL-45784 lesson: Remove preview link for students viewing lesson
Credit to Pete Jones for the fix.
2015-01-08 13:28:48 +08:00
Eloy Lafuente (stronk7) b78438abc0 Merge branch 'MDL-37584-28' of git://github.com/ankitagarwal/moodle into MOODLE_28_STABLE 2015-01-08 00:46:41 +01:00
Eloy Lafuente (stronk7) 19389fc511 Merge branch '37680-28' of git://github.com/samhemelryk/moodle into MOODLE_28_STABLE 2015-01-08 00:40:52 +01:00
Zachary Durber 63ed941a93 MDL-48546 filters: Split on all tags for multimedia filter check. 2015-01-07 18:56:49 +01:00
Eloy Lafuente (stronk7) 2d90c646be Merge branch 'MDL-48748-28-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_28_STABLE 2015-01-07 17:23:19 +01:00
AMOS bot 324dfc764c Automatically generated installer lang files 2015-01-08 00:03:59 +08:00
David Balch 0697df81aa MDL-48574 assign: Fire workflow_state_updated event on batch and single.
This change adds the workflow_state_updated event when changing workflow
state using the single grading page and the quick grading mechanisms.
Previously, it only fired for batch updates using
process_set_batch_marking_workflow_state().
2015-01-07 14:47:22 +00:00
Ankit Agarwal f517d1c20b MDL-48688: inbound: remove spaces from exception 2015-01-07 13:44:25 +08:00
Mark Nelson f7f477a65d MDL-46498 mod_assign: fixed failing behat test due to GS 2015-01-07 13:30:12 +08:00
Zachary Durber 01da07a42b MDL-48546 filters: ReDoS protection for multimedia links. 2015-01-07 12:28:22 +08:00
Andrew Nicols 5cb84b5ba4 Merge branch 'MDL-45930-28' of git://github.com/danpoltawski/moodle into MOODLE_28_STABLE 2015-01-07 12:08:16 +08:00
David Monllao fb270fd5de Merge branch 'MDL-48549_m28' of git://github.com/markn86/moodle into MOODLE_28_STABLE 2015-01-07 09:40:22 +08:00
David Monllao 2111c597ac Merge branch 'wip-MDL-48523-28' of git://github.com/abgreeve/moodle into MOODLE_28_STABLE 2015-01-07 09:21:53 +08:00
Eloy Lafuente (stronk7) cd663df1ad Merge branch 'MDL-32088-28' of git://github.com/danpoltawski/moodle into MOODLE_28_STABLE 2015-01-07 02:11:48 +01:00
David Monllao b68c14c98d Merge branch 'MDL-48697-28' of git://github.com/ankitagarwal/moodle into MOODLE_28_STABLE 2015-01-07 09:07:13 +08:00
David Monllao 2fe7bf0585 Merge branch 'MDL-48688-28' of git://github.com/ankitagarwal/moodle into MOODLE_28_STABLE 2015-01-07 08:48:05 +08:00
Mark Nelson 7cadfa8e86 MDL-47692 mod_quiz: added additional question_manually_graded trigger 2015-01-06 15:13:28 -08:00
Helen Foster 59ea75fd37 MDL-48748 lang: Merge English strings from the en_fix language pack 2015-01-06 21:57:11 +01:00
Jean-Michel Vedrine c80603ddc4 MDL-48034 mod_lesson: grade capability missing RISK_XSS 2015-01-06 12:52:21 +00:00
Dan Poltawski 8b7e92206c Merge branch 'MDL-44393-28' of git://github.com/ankitagarwal/moodle into MOODLE_28_STABLE 2015-01-06 12:21:04 +00:00
Dan Poltawski 787d05f3d3 Merge branch 'MDL-46015_28' of git://github.com/jmvedrine/moodle into MOODLE_28_STABLE 2015-01-06 12:04:09 +00:00
Dan Poltawski acb579245a Merge branch 'MDL-48372-28' of git://github.com/ankitagarwal/moodle into MOODLE_28_STABLE 2015-01-06 11:24:30 +00:00
Dan Poltawski f704c30f8a Merge branch 'MDL-48442-28' of git://github.com/ankitagarwal/moodle into MOODLE_28_STABLE 2015-01-06 11:19:33 +00:00
Dan Poltawski e54fe38e2b Merge branch 'MDL-48534_m28' of https://github.com/markn86/moodle into MOODLE_28_STABLE 2015-01-06 11:11:43 +00:00
Dan Poltawski 921e63c880 Merge branch 'MDL-48655-28' of git://github.com/merrill-oakland/moodle into MOODLE_28_STABLE 2015-01-06 11:09:43 +00:00
Simey Lameze 693918c30e MDL-47964 auth_shibboleth: Fix DOS on the shibboleth logout 2015-01-06 11:05:25 +00:00
Marco Rougeth 6bb02c27d5 MDL-48640 report_configchanges: Remove duplicated code 2015-01-06 15:52:57 +08:00
John Okely 502a403b43 MDL-39103 lesson: Fix lesson administration block
Credit to Joseph Rézeau for the fix
2015-01-06 14:53:29 +08:00
David Monllao 63a07d3a21 Merge branch 'MDL-38222_28' of git://github.com/jmvedrine/moodle into MOODLE_28_STABLE 2015-01-06 12:27:20 +08:00
Andrew Nicols ac1c429ebd Merge branch 'MDL-48701-28' of git://github.com/ankitagarwal/moodle into MOODLE_28_STABLE 2015-01-06 12:06:01 +08:00
Andrew Nicols 42f3477091 Merge branch 'MDL-48704-28' of git://github.com/ankitagarwal/moodle into MOODLE_28_STABLE 2015-01-06 11:59:15 +08:00
Andrew Nicols 9b2438597a Merge branch 'MDL-48707_28' of git://github.com/jmvedrine/moodle into MOODLE_28_STABLE 2015-01-06 11:51:14 +08:00
Andrew Nicols 7a5e665072 Merge branch '28067-28' of git://github.com/samhemelryk/moodle into MOODLE_28_STABLE 2015-01-06 10:53:50 +08:00
Andrew Nicols 2c908ec30b MDL-20304 lesson: Uncomment tests following MDL-48631 2015-01-06 10:37:42 +08:00
Andrew Nicols f595e3cbae Merge branch 'MDL-20304-28' of git://github.com/danpoltawski/moodle into MOODLE_28_STABLE 2015-01-06 10:37:37 +08:00
David Monllao 1bacd164c3 Merge branch 'MDL-35078-28' of git://github.com/danpoltawski/moodle into MOODLE_28_STABLE 2015-01-06 10:34:50 +08:00
David Monllao 76dd58bb4f Merge branch 'MDL-48631_28' of git://github.com/jmvedrine/moodle into MOODLE_28_STABLE 2015-01-06 09:09:24 +08:00
Dan Poltawski 8e293f17cf Merge branch 'MDL-48441_profile_guest_28' of https://github.com/andyjdavis/moodle into MOODLE_28_STABLE 2015-01-05 18:30:25 +00:00
Dan Poltawski 4afd408b55 Merge branch 'MDL-46498_m28' of https://github.com/markn86/moodle into MOODLE_28_STABLE 2015-01-05 17:48:39 +00:00
Andrew Nicols 8d9a3b3b62 MDL-48104 mod_assign: Strip out use of eval() for string parsing
I've also replaced other  occurrences of M.str with the correct use of
M.util.get_string() instead.
2015-01-05 17:21:14 +00:00
Dan Poltawski 0aee829cd3 Merge branch 'MDL-43679-28' of git://github.com/FMCorz/moodle into MOODLE_28_STABLE 2015-01-05 15:49:26 +00:00
Simey Lameze 88929ca824 MDL-48017 core_calendar: add context validation to get_calendar_events 2015-01-05 14:13:48 +00:00
Andrew Nicols 5770e51478 MDL-48106 mod_glossary: Add missing sesskey checks 2015-01-05 13:38:01 +00:00
David Monllao e72516ccde MDL-48329 core_message: Checking that messaging system is enabled 2015-01-05 13:14:03 +00:00
Simey Lameze 38ca8793b6 MDL-48368 course: fix xss on course request pending page 2015-01-05 12:58:53 +00:00
Jetha Chan faf0cd9098 MDL-47920 mod_lti: add capability checks, http headers 2015-01-05 12:50:18 +00:00
Andrew Nicols f7714bb67b Merge branch 'MDL-42519_28' of git://github.com/timhunt/moodle into MOODLE_28_STABLE 2015-01-05 16:18:13 +08:00
Andrew Nicols 764247be6b Merge branch 'MDL-48582-28' of git://github.com/merrill-oakland/moodle into MOODLE_28_STABLE 2015-01-05 15:27:44 +08:00
Andrew Nicols 289ac435d1 Merge branch 'MDL-48644_restoreLegacyLogs28' of https://github.com/moodlerooms/moodle into MOODLE_28_STABLE 2015-01-05 14:32:28 +08:00
Andrew Nicols dcfe7694d4 Merge branch 'MDL-46183-28' of git://github.com/FMCorz/moodle into MOODLE_28_STABLE 2015-01-05 13:58:12 +08:00
Andrew Nicols 34d16a7737 Merge branch 'wip-MDL-40097-28' of git://github.com/abgreeve/moodle into MOODLE_28_STABLE 2015-01-05 13:41:28 +08:00
Andrew Nicols 863ffc884f Merge branch 'MDL-48700-28' of git://github.com/merrill-oakland/moodle into MOODLE_28_STABLE 2015-01-05 13:31:42 +08:00
Aaron Barnes f8bebe363d MDL-40097 completion: Apply robust role detection to samesite restores. 2015-01-05 10:34:49 +08:00
Adrian Greeve 45151248c4 MDL-40097 completion: Update of code to meet guidlines. 2015-01-05 10:34:38 +08:00
Aaron Barnes 39ed46b158 MDL-40097 completion: Make restoring grade criteria more robust 2015-01-05 10:34:27 +08:00
Russell Smith 6e8d598cff MDL-43421 logging: Ignore race condition in access update. 2015-01-03 20:42:09 +11:00
PJ King 39afb9e4b3 MDL-46671 availability: DEBUG when course_module does not exist.
There was a fatal error when calendar event linked to non-extant activities.

Now, instead of throwing an exception when a course_module does not exist, is_user_visible() will print a debug statement.
2015-01-02 10:32:30 -05:00
Ankit Agarwal de290738c9 MDL-48442 tasks: Make sure first run is as per schedule 2015-01-02 14:55:22 +05:30
Ankit Agarwal 004ec71505 MDL-44393 tasks: Add unit tests for cron field validations 2015-01-02 11:03:03 +05:30
Ankit Agarwal 045b5235f2 MDL-44393 tasks: Validate cron fields 2015-01-02 11:03:03 +05:30
Ankit Agarwal 2d066f19ba MDL-48372 mod_data: Add http to urls without it during import 2015-01-02 10:47:34 +05:30
Frederic Massart b4e7dcaa8a MDL-43679 core: Handle Meridio user agents with MS Word 2015-01-02 11:24:00 +08:00
Frederic Massart e618263437 MDL-43679 core: Never use HTTP redirect when the user agent is MS Word 2015-01-02 11:24:00 +08:00
Paul Nicholls 04a2fc7427 MDL-43679 core_useragent: add test cases for MS Word
The new is_msword() check should always return false for regular browsers.
It should return true for known MS Word, but false for known MS Outlook.
2015-01-02 11:24:00 +08:00
Paul Nicholls 7ed6f826ad MDL-43679 core_useragent: add basic MS Word detection
Basic detection for MS Word's internal link checker.  This is not perfect,
as older versions use IE6/7 user agent string with no identifying marks,
and newer versions don't necessarily identify themselves as Word (just as
Office).  Version information is not reliably available, even when there
is sufficient other information to identify it as Word's link checker.
This is also based on a small sample of Word / OS version pairings, so
there may be some which are identifiable but not currently covered.
2015-01-02 11:23:59 +08:00
Jean-Michel Vedrine 986cc05789 MDL-40326 mod_lesson: progress bar is not reset by course reset 2015-01-01 13:22:28 +01:00
Lloyd Powell 7f15ca3eab MDL-43898 lesson: Fix for positioning of blocks on continue.php 2014-12-31 09:09:44 +00:00
Ankit Agarwal 07a06264dc MDL-37584 tasks: Use a senisible maximum time window for the task 2014-12-31 14:03:09 +05:30
Dan Poltawski 15252c8803 MDL-41166 assign: don't display portfolio button when no permissions
Thanks to Katja Krüger for the basis of the patch.
2014-12-30 16:48:44 +00:00
Dan Poltawski 73416d1b9a MDL-45930 filemanager: Don't display filesize when unknown
Thanks to Marina Glancy for the patch

Conflicts:
	theme/bootstrapbase/style/moodle.css
2014-12-30 14:24:29 +00:00
Vishal Raheja f70a6d3245 MDL-32088 user: Correct the Moodle docs link
This patch links the moodle docs link to user profile Moodle doc when
the user sees the user profile for a particular course. The page is set
to course view type to load course specific blocks. So, we use
set_docs_path to change the Moodle docs link instead of changing the
pagetype.
2014-12-30 13:47:41 +00:00
Mark Nielsen 2d18472382 MDL-48644 backup tool_log: Fixing coding style
Wrap long function definition
to next line.
2014-12-29 11:26:37 -08:00
Dan Poltawski 04babc675b MDL-43198 folder: respect ignorefilesizelimits permission
Thanks to Miryan Salas for the patch.
2014-12-29 12:13:37 +00:00
Jean-Michel Vedrine eeae1784c6 MDL-48631 mod_lesson: tables 'grade' item have incorrect precision
Conflicts:
	mod/lesson/db/upgrade.php
	mod/lesson/version.php
2014-12-29 10:54:01 +01:00
Ankit Agarwal 112e95f6b4 MDL-48704 inbound: Fix notices in pickup task 2014-12-29 14:40:41 +05:30
Eugene Venter 3e061bf55d MDL-46015 lesson: Optimise report - use recordsets
Change-Id: I61f3ed30c6dbd8f88d1dfb1adfe2fc291853e0e1
2014-12-28 11:09:38 +01:00
AMOS bot deb3e69e37 Automatically generated installer lang files 2014-12-28 00:04:15 +08:00
Mark Nelson 0532dad71b MDL-48549 mod_assign: added upgrade to clean the tables 2014-12-26 18:55:53 -08:00
Mark Nelson a0102708b6 MDL-48549 mod_assign: delete entries from the flags/mapping tables 2014-12-26 18:54:51 -08:00
Mark Nelson a12afaf7dd MDL-46498 mod_assign: added behat tests 2014-12-26 17:49:58 -08:00
Mark Nelson 57897685c0 MDL-46498 mod_assign: display correct grading status 2014-12-26 17:17:25 -08:00
Jean-Michel Vedrine 216655b54d MDL-48707 mod_lesson: ignore plugins question types during import 2014-12-26 08:29:33 +01:00
Jean-Michel Vedrine 899d7c1bb2 MDL-38222 mod_lesson: Error in Lesson Cluster for Unseen Questions 2014-12-25 21:19:33 +01:00
Dan Poltawski 440085ecf8 weekly release 2.8.1+ 2014-12-24 13:22:29 +00:00
Dan Poltawski a5e8cb4aea Merge branch 'install_28_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_28_STABLE 2014-12-24 13:22:26 +00:00
Mark Nelson d8d912443f MDL-48534 mod_assign: display correct workflow state and marker 2014-12-23 22:58:32 -08:00
Ankit Agarwal e3effa63fd MDL-48701 inbound: Use correct method in invalid email handler
Invalid email handler doesn't allow alteration in validate sender config. Make sure this is reflected in the UI as well
2014-12-24 10:20:43 +05:30
Ankit Agarwal 870e0fb822 MDL-48697 libraries: Use proper path for core_completion 2014-12-24 08:10:36 +05:30
Eric Merrill 4e8c1f2681 MDL-48700 gradereport_history: Don't limit downloads by pages. 2014-12-23 16:11:23 -05:00
Dan Poltawski 12f025749a MDL-20304 lesson: add behat test for practice lessons 2014-12-23 17:05:36 +00:00
Dan Poltawski 29006301ed MDL-20304 lesson: do not display gradebook link when in practice mode
Practice mode means the grades do not go to the gradebook, so do not
display the gradebook link at the end of the lesson
2014-12-23 17:05:35 +00:00
Atanas Atanasov c1eb2c3ddf MDL-20304 lesson: do not send practice lesson grades to gradebook 2014-12-23 17:05:35 +00:00
Dan Poltawski 7783fcd76f Merge branch 'MDL-48213-m28-master' of https://github.com/dthies/moodle into MOODLE_28_STABLE 2014-12-23 16:13:14 +00:00
AMOS bot 4dbc9b18b4 Automatically generated installer lang files 2014-12-24 00:04:15 +08:00
Eloy Lafuente (stronk7) e9b36ac653 MDL-45699 behat: Don't use behat/lib.php functions in core.
behat/lib.php script should not be usually included, neither any of its functions
used within mooodle code at all. It's for exclusive use of behat and
moodle setup.php. For places requiring a different/special behavior
needing to check if are being run  as part of behat tests, use:
    if (defined('BEHAT_SITE_RUNNING')) { ...
2014-12-23 13:28:46 +01:00
Dan Poltawski db5fb4ce76 Revert "Merge branch 'MDL-48534_m28' of https://github.com/markn86/moodle into MOODLE_28_STABLE"
This reverts commit 7c4b6a84dd, reversing
changes made to 03d3dfbfc5.
2014-12-23 10:46:30 +00:00
Dan Poltawski 008e28478d Revert "Merge branch 'MDL-48591_m28' of https://github.com/jrchamp/moodle into MOODLE_28_STABLE"
This reverts commit a6af290ea4, reversing
changes made to 267ac74ef3.
2014-12-23 10:43:37 +00:00
Frederic Massart 510fafed8a MDL-46183 theme_more: Background is seen through the activity chooser 2014-12-23 17:16:58 +08:00
Eloy Lafuente (stronk7) 7e911af220 Merge branch '45699-28' of git://github.com/samhemelryk/moodle into MOODLE_28_STABLE
Conflicts:
	cache/upgrade.txt
2014-12-23 02:04:12 +01:00
Eloy Lafuente (stronk7) d25a7f21a3 MDL-48568 cache: make tests aware of default application store
When an alternative cache configuration is used, aka:

define('TEST_CACHE_USING_ALT_CACHE_CONFIG_PATH', true);
$CFG->altcacheconfigpath = '/tmp/xxxxx.php';

the get_expected_application_cache_store() method was not able of
retroffiting the default application store being used.

This commit just implements that functionality so, when
executing unit tests using alternative configuration, assertions
looking for that will pass without a problem.
2014-12-23 02:03:06 +01:00
Eloy Lafuente (stronk7) 3c6dac879f Merge branch '48568-28' of git://github.com/samhemelryk/moodle into MOODLE_28_STABLE 2014-12-23 02:02:47 +01:00
Eloy Lafuente (stronk7) d81cdaaf13 Merge branch 'MDL-48593-28' of git://github.com/andrewnicols/moodle into MOODLE_28_STABLE 2014-12-22 21:51:20 +01:00
Tim Hunt 4a057abc11 MDL-42519 qformat_xml: Correctly export questions containing ]]> 2014-12-22 19:47:10 +00:00
Eloy Lafuente (stronk7) d102926592 Merge branch 'MDL-48639_28' of git://github.com/timhunt/moodle into MOODLE_28_STABLE 2014-12-22 19:09:52 +01:00
Dan Poltawski 05ea4e002d Merge branch 'MDL28-48421' of https://github.com/timpricecatalyst/moodle into MOODLE_28_STABLE 2014-12-22 17:01:06 +00:00
Dan Poltawski c6c1b3596f MDL-48638 course: update unit test to new message 2014-12-22 16:25:47 +00:00
Dan Poltawski bf671547ab Merge branch 'MDL-48638-28' of git://github.com/merrill-oakland/moodle into MOODLE_28_STABLE 2014-12-22 15:25:35 +00:00
Dan Poltawski 1b78a209a0 Merge branch 'MDL-48643-28' of git://github.com/merrill-oakland/moodle into MOODLE_28_STABLE 2014-12-22 15:22:33 +00:00
Dan Poltawski 42486cac98 MDL-43004 blog: fix upgrade.txt typo 2014-12-22 15:14:05 +00:00
Dan Poltawski 9b27f063c8 Merge branch 'MDL-48062-m28-master' of https://github.com/dthies/moodle into MOODLE_28_STABLE 2014-12-22 14:36:42 +00:00
Brian Barnes 83a36ad89b MDL-48423 messages: improved accessibility of contacts list 2014-12-22 14:16:31 +00:00
Dan Poltawski 61040870bb Merge branch 'MDL-48224-28' of git://github.com/xow/moodle into MOODLE_28_STABLE 2014-12-22 14:04:23 +00:00
Josh Marshall 999f4ac9fa MDL-48445 report_loguser: Include logstore parameter for pagination 2014-12-22 13:56:59 +00:00
Dan Poltawski 7c4b6a84dd Merge branch 'MDL-48534_m28' of https://github.com/markn86/moodle into MOODLE_28_STABLE 2014-12-22 13:52:41 +00:00
Dan Poltawski 03d3dfbfc5 Merge branch 'm28_MDL-48483' of https://github.com/totara/moodle into MOODLE_28_STABLE 2014-12-22 13:44:29 +00:00
Dan Poltawski cf447b8c0f Merge branch 'MDL-48580-28' of git://github.com/lameze/moodle into MOODLE_28_STABLE 2014-12-22 13:41:13 +00:00
Dan Poltawski a6af290ea4 Merge branch 'MDL-48591_m28' of https://github.com/jrchamp/moodle into MOODLE_28_STABLE 2014-12-22 13:38:06 +00:00
Dan Poltawski 267ac74ef3 MDL-48653 behat: fix incorrect phpdoc 2014-12-22 13:13:51 +00:00
Dan Poltawski a4b06536fb Merge branch 'MDL-48653_28' of git://github.com/timhunt/moodle into MOODLE_28_STABLE 2014-12-22 13:10:46 +00:00
Dan Poltawski 6303e895e4 Merge branch 'MDL-48088-28' of git://github.com/jethac/moodle into MOODLE_28_STABLE 2014-12-22 13:07:46 +00:00
Dan Poltawski db6bbcbc16 Merge branch 'MDL-48666_28' of git://github.com/timhunt/moodle into MOODLE_28_STABLE 2014-12-22 12:09:18 +00:00
Andrew Davis 55f1261257 MDL-48441 core_user: profile.php, view.php now handle guests the same 2014-12-22 09:56:04 +01:00
Ankit Agarwal 6227a1f3e7 MDL-48688 inbound: Fix incorrect class names 2014-12-22 13:50:43 +05:30
Adrian Greeve 0f60d011dc MDL-48523 gradebook: Fix for incorrect behat steps. 2014-12-22 15:05:18 +08:00
Eric Merrill 21fa68e52f MDL-48643 Javascript: Create modals hidden, then show, to prevent scroll
Modal dialogs need to be created with visible: false and then call
.show() on it to make it visible. This prevents the page from jumping to
the top.
2014-12-21 22:58:59 -05:00
AMOS bot 085df3ed05 Automatically generated installer lang files 2014-12-22 00:04:10 +08:00
AMOS bot 4645ff7ddc Automatically generated installer lang files 2014-12-20 00:04:14 +08:00
Tim Hunt 2a6e070cd4 MDL-48666 quiz: let JS to get a Qs slot number on the summary page 2014-12-19 14:39:40 +00:00
Tim Hunt 3e8e8641b3 MDL-48639 behat upload: support absolute paths & better errors
In a custom step I needed to be able to upload a file I had previously
saved to $CFG->dataroot/temp, but that was not possible.

Also, the failure was not at all obvious. I have made it throw a clear
exception if the file you are trying to upload does not exist.
2014-12-19 12:00:17 +00:00
Brian Barnes 6f1e7d2db2 MDL-48483 admin: attached color label to input control 2014-12-19 14:19:39 +13:00
Daniel Thies 330ac09e0d MDL-48062 atto_image: Add image select on single click 2014-12-18 18:29:46 -06:00
Daniel Thies 37e2d30c84 MDL-48213 filter_algebra,filter_tex: Require sesskey for debug actions 2014-12-18 16:40:46 -06:00
Tim Price 4105c6c329 MDL-48421 navigation: accounting for potential regression 2014-12-19 09:18:35 +11:00
Tim Price 07bd586492 MDL-48421 navigation: correctly load child categories if parent is loaded 2014-12-19 09:18:35 +11:00
Eric Merrill ada9b1ed77 MDL-48655 gradebook: Don't treat a scale with a gradepass of 0 as passed 2014-12-18 16:18:28 -05:00
Mark Nielsen 60c034fe27 MDL-48644 backup: Preserve log IP and time during restore 2014-12-18 11:36:47 -08:00
Tim Hunt 8850deb74d MDL-48653 behat: Steps to click and dismiss a dialogue.
We already had the corresponding
    I click on "Home" "link" confirming the dialogue
but I needed the opposite
    I click on "Home" "link" dismissing the dialogue
2014-12-18 19:31:27 +00:00
Eric Merrill 4077b738a0 MDL-48582 gradereport_grader: Adding back grade pass/fail CSS 2014-12-18 14:13:21 -05:00
Eric Merrill 0ab4c9d029 MDL-48638 database SQL: Fix typo in exception constructor 2014-12-18 13:34:20 -05:00
jrchamp 3925c74634 MDL-48591 calendar: Mini Cal Display DST Events 2014-12-18 09:28:09 -05:00
Dan Poltawski 2c48f2ed4c weekly release 2.8.1+ 2014-12-18 11:25:09 +00:00
Dan Poltawski 88d1474104 Merge branch 'install_28_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_28_STABLE 2014-12-18 11:25:07 +00:00
Mark Nelson b621820ea1 MDL-45324 mod_assign: always notify students when requested 2014-12-18 14:09:23 +08:00
Mark Nelson a2a8653aa2 MDL-48534 mod_assign: display correct workflow state and marker 2014-12-17 20:43:27 -08:00
David Monllao bfa4e840d8 Merge branch 'MDL-48235-28-fixes' of git://github.com/xow/moodle into MOODLE_28_STABLE 2014-12-18 12:37:01 +08:00
Zachary Durber dda30b1906 MDL-47442 mod_assign: Notify student when quick-grading grade 2014-12-18 12:15:41 +08:00
Marina Glancy c0070d8d88 MDL-48452 Completion: js correction to behat test 2014-12-18 11:28:31 +08:00
John Okely 582ab13d73 MDL-48235 mod_assign: Fix grade of 0 not showing on feedback page in oracle 2014-12-18 10:25:39 +08:00
Wiktor Wandachowicz f826599632 MDL-35078 enrol: allow times to be chose on bulk enrolment forms
Previously only a date was available, which made it ambigious whether
the the enrolment was inclusive of the date. Now we use a time to make
it less ambigious.

This matches changes done in other forms in MDL-41173.
2014-12-17 12:02:30 +00:00
Dan Poltawski cf7167cbae Merge branch 'MDL-44829_MOODLE_28_STABLE' of git://github.com/BenKelada/moodle into MOODLE_28_STABLE 2014-12-17 10:11:41 +00:00
BKelada 999f2b3aea MDL-44829 libraries: Update android user agent detection 2014-12-17 16:37:03 +11:00
David Monllao 5ef46dad4b Merge branch 'MDL-48243_M28' of git://github.com/lazydaisy/moodle into MOODLE_28_STABLE 2014-12-17 11:49:15 +08:00
Andrew Nicols 724b6446d1 MDL-48593 messageinbound: Correct header retrieval from IMAP server
Header retrieval should only be performed on the base message, and not each
part of the message as is currently performed.

This came to light because Google changed their IMAP server such that, if
you inform the data query that you wish to retrieve the headerText for a
part which does not contain a MIME header, then no message is retrieved in
the search causing a general failure of the IMAP fetch.

In normal circumstances, headers should only be a part of the base message
part.
2014-12-17 09:35:38 +08:00
Dan Poltawski 535a794f90 Merge branch 'MDL-43462_landscape_pdf_28' of git://github.com/davosmith/moodle into MOODLE_28_STABLE 2014-12-16 19:20:23 +00:00
Dan Poltawski fa59a794f6 Merge branch 'MDL-42501-28' of git://github.com/lameze/moodle into MOODLE_28_STABLE 2014-12-16 19:18:03 +00:00
Eloy Lafuente (stronk7) f48a890017 Merge branch 'MDL-48452-m28' of https://github.com/sammarshallou/moodle into MOODLE_28_STABLE 2014-12-16 19:09:18 +01:00
sam marshall 78d8dc13c8 MDL-48452 Completion: Expected date doesn't save when form is locked
The completion fields are locked when a user has already completed the
task, to prevent you accidentally causing it to recalculate the data.

This lock doesn't apply to the expected date field, as this doesn't
affect user completion. However, changes to the field in this
situation were incorrectly not saved.
2014-12-16 17:31:36 +00:00
Dan Poltawski e42056413c Merge branch 'MDL-48587-28' of git://github.com/xow/moodle into MOODLE_28_STABLE 2014-12-16 17:05:04 +00:00
Eloy Lafuente (stronk7) e61ab464f3 Merge branch 'm28_MDL-48532' of https://github.com/totara/moodle into MOODLE_28_STABLE 2014-12-16 15:47:29 +01:00
Dan Poltawski f0066ff80c Merge branch 'MDL-46442-28' of git://github.com/zbdd/moodle into MOODLE_28_STABLE 2014-12-16 13:54:12 +00:00
Dan Poltawski 5ef5c6c1e2 Merge branch 'MDL-47610-28' of git://github.com/zbdd/moodle into MOODLE_28_STABLE 2014-12-16 13:00:02 +00:00
Davo Smith a4c72b69e8 MDL-43462 assignfeedback_editpdf: fix display of landscape PDFs
The size of the drawing canvas is now set from the size of the generated page image, with automatic
scrolling if it is too wide to display
Absolutely-positioned nodes (comments + stamps) are repositioned as the drawing canvas is scrolled
2014-12-16 12:01:42 +00:00
Dan Poltawski a95cd718f9 Merge branch 'MDL-46651-MOODLE_28_STABLE-restore-course-completion-duplicate-key' of https://github.com/Trii/moodle into MOODLE_28_STABLE 2014-12-16 11:58:47 +00:00
Zachary Durber df91b1d861 MDL-47694 mod_assign: Grades require a grade to show as graded
Special thanks to Howard Miller.
2014-12-16 11:20:09 +01:00
Frederic Massart f34fc42d9b MDL-48495 curl: Limit usage of curl to HTTP and HTTPS protocols 2014-12-16 10:08:47 +00:00
David Monllao 43c3b0ec7b Merge branch 'MDL-48318-28' of git://github.com/lameze/moodle into MOODLE_28_STABLE 2014-12-16 16:41:21 +08:00
Zachary Durber 2a841b12fd MDL-46442 mod_assign: Notify users when grades are changed 2014-12-16 14:49:53 +08:00
David Monllao 73c991dd3f Merge branch 'MDL-48547-28' of git://github.com/danpoltawski/moodle into MOODLE_28_STABLE 2014-12-16 14:13:54 +08:00
David Monllao ecc60ffeb7 Merge branch 'm28_MDL-48567' of git://github.com/totara/moodle into MOODLE_28_STABLE 2014-12-16 13:34:41 +08:00
Brian Barnes 83ef244a83 MDL-48286 core_files: Improved accessibility of file management 2014-12-16 13:26:30 +08:00
Simey Lameze f6c149226f MDL-48580 report_log: fix site errors dropdown
Thanks Renaat Debleu for pointing this bug and share a solution.
2014-12-16 12:39:17 +08:00
David Monllao c0c2921586 Merge branch 'wip-MDL-48569-m28' of git://github.com/marinaglancy/moodle into MOODLE_28_STABLE 2014-12-16 12:27:02 +08:00
David Monllao 2abcbc0251 Merge branch 'MDL-48164-28' of git://github.com/andrewnicols/moodle into MOODLE_28_STABLE 2014-12-16 12:03:35 +08:00
Andrew Nicols 270705c279 Merge branch 'MDL-46472_28' of git://github.com/dmonllao/moodle into MOODLE_28_STABLE 2014-12-16 10:39:56 +08:00
Andrew Nicols 26156e72d9 MDL-48164 messageinbound: Attempt to detect autoreplies
Any message which includes:
* Precedence: bulk
* X-Autoreply: !no
* X-Autoresponse: !no
* Auto-Submitted: !no

Will not be detected as a bulk message and therefore ignored.
2014-12-16 09:35:58 +08:00
Andrew Nicols 7a56557c45 MDL-48164 mod_forum: Add additional headers to prevent OOF replies
This adds the X-Auto-Response-Suppress header to outbound messages.
2014-12-16 09:35:58 +08:00
Zachary Durber 4c23fb82ab MDL-47610 gradebook: Show extra credit icon in grades column 2014-12-16 09:17:00 +08:00
Eloy Lafuente (stronk7) 30fbe29595 Merge branch 'MDL-47037-28' of git://github.com/jethac/moodle into MOODLE_28_STABLE 2014-12-16 01:42:39 +01:00
Eloy Lafuente (stronk7) 5e425cc89b Merge branch 'MDL-46491-28' of git://github.com/andrewnicols/moodle into MOODLE_28_STABLE 2014-12-16 00:36:18 +01:00
Eloy Lafuente (stronk7) b2a786539e Merge branch 'MDL-48556-28' of git://github.com/ankitagarwal/moodle into MOODLE_28_STABLE 2014-12-15 17:54:04 +01:00
Dan Poltawski 744dc6e647 Merge branch 'MDL-38128_28' of https://github.com/dmonllao/moodle into MOODLE_28_STABLE 2014-12-15 16:10:17 +00:00
Dan Poltawski 0e956b0452 Merge branch 'MDL-45324_28' of git://github.com/jonof/moodle into MOODLE_28_STABLE 2014-12-15 14:59:37 +00:00
Dan Poltawski 82dd025984 Merge branch 'MDL-47176_MOODLE_28_STABLE' of https://github.com/crazyserver/moodle into MOODLE_28_STABLE 2014-12-15 14:14:24 +00:00
Dan Poltawski b2e9074f3c Merge branch 'MDL-48169-28' of git://github.com/jethac/moodle into MOODLE_28_STABLE 2014-12-15 12:32:13 +00:00
Dan Poltawski 73ed5ce9fb Merge branch 'MDL-47475-28' of git://github.com/andrewnicols/moodle into MOODLE_28_STABLE 2014-12-15 12:21:11 +00:00
Joseph Rezeau cd16f43ba1 MDL-36673 mod_lesson: slideshow mode not working 2014-12-15 11:55:34 +00:00
David Monllao 49b881c876 Merge branch 'MDL-48235-assign-reopen-until-pass-28_STABLE' of git://github.com/mpetrowi/moodle into MOODLE_28_STABLE 2014-12-15 17:33:09 +08:00
John Okely ef19d61d4d MDL-48587 core: Fix error in getremoteaddr for unsupported php versions 2014-12-15 16:56:44 +08:00
Simey Lameze a54229b629 MDL-42501 course: add help icon on delete gradebook options 2014-12-15 16:23:11 +08:00
David Monllao 373fd13876 Merge branch 'wip-MDL-48347-28' of git://github.com/abgreeve/moodle into MOODLE_28_STABLE 2014-12-15 13:45:22 +08:00
Jetha Chan 244c69709e MDL-48088 calendar: normalize DTEND, add romance standard time
Thanks to Cedric Mortiers (cmortiers@stjohns.be) for providing the patch.
2014-12-15 12:10:29 +08:00
Andrew Nicols 675564277d MDL-47475 mod_assign: Copy files to other group members for editpdf 2014-12-15 08:50:48 +08:00
AMOS bot 3e7b053221 Automatically generated installer lang files 2014-12-13 00:03:57 +08:00
Pau Ferrer Ocaña abcec0fe9a MDL-47176 qtype_match: Avoid sql_compare to solve problems with Oracle 2014-12-12 16:04:24 +01:00
David Monllao fa0a765c20 MDL-38128 mod_assign: Counts and groups unit tests 2014-12-12 15:07:57 +08:00
David Monllao 5ad9e84664 MDL-46472 theme: Removing standard as an uninstallable theme 2014-12-12 13:33:46 +08:00
David Monllao 79a143130b MDL-38128 mod_assign: Fixing count teams and submissions with status
We should restrict the groups to the activity active group. Also
improving performance caching get_submission_group() results.
2014-12-12 13:28:14 +08:00
David Monllao 08b7d0bacc MDL-38128 mod_assign: Adding group selector to grading summary page
Thanks to Pau Ferrer Ocaña and Avi Levy for
their work on this issue.
2014-12-12 13:28:14 +08:00
Andrew Nicols b1a381ffcf MDL-48224 cron: Buffer SMTP connections around tasks 2014-12-12 10:39:19 +08:00
Marina Glancy 3719994057 MDL-48569 profile: behat test for user full profile access 2014-12-12 10:29:22 +08:00
Marina Glancy be2641dc8c MDL-48569 profile: show link to full profile if anybody can see it 2014-12-12 10:29:22 +08:00
Daniel Thies 3c726433cc MDL-48213 filter_algebra: Allow cookies in debug script 2014-12-11 20:00:45 -06:00
Sam Hemelryk 78a4b45ffc MDL-28067 navigation: my private files in profile only 2014-12-12 13:48:10 +13:00
Sam Hemelryk 3900f28e28 MDL-37680 repositories: added blocks to manage page 2014-12-12 13:37:01 +13:00
Joshua Johnston 48d0e75068 MDL-46651 Backup: Handle duplicate course completions during restore
Cron can cause duplicate completion records if triggered during a long
running restore process. If this is the case, replace the new record
with the record from the backup file
2014-12-11 15:58:00 -05:00
Sam Hemelryk c7a0fb64a0 MDL-48568 cache: stores now determine testing
Cache stores are now responsible for deciding if they are suitable
for use as the primary cache store during unit and acceptance tests

Changes are as follows:
* New method: cache_store::ready_to_be_used_for_testing
* Core cache store have been updated to override this method as
  required.
* MongoDB usesafe default changed to true to match actual default
  behaviour.
2014-12-12 09:34:25 +13:00
Dan Poltawski 8542d1875f weekly release 2.8.1+ 2014-12-11 09:55:19 +00:00
Dan Poltawski 087fd13442 Merge branch 'install_28_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_28_STABLE 2014-12-11 09:55:17 +00:00
Ankit Agarwal dd96737556 MDL-48556 backup: Use correct conditions before checking dir permissions 2014-12-11 14:34:10 +05:30
Andrew Nicols fde7c5f003 MDL-46491 course: Correct activity visibility on section show 2014-12-11 14:50:50 +08:00
Brian Barnes 4afb72f2de MDL-48567 core_badges: fixed display of badge created date 2014-12-11 14:50:33 +13:00
Avi Levy 23f751ee38 MDL-47037 grader_gradereport: Enable sort in other language then English 2014-12-11 07:39:42 +08:00
Frederic Massart 79fc19f5d7 MDL-48496 block_rss_client: Do not display curl error messages 2014-12-11 00:26:30 +01:00
AMOS bot f89ee726b4 Automatically generated installer lang files 2014-12-11 00:04:05 +08:00
Jonathon Fowler 9592c8e99c MDL-45324 assign: notify when workflow is Off, or if state is Released
When marking workflow is enabled, students will be notified only when
the workflow state transitions to 'Released'. Until that happens,
sending of messages will be held and the 'Notify students' grading
form option will be locked.

Additionally, the batch set marking workflow state facility gains
the 'Notify students' option.

Credit to Steve Upton and David Balch for the basis of this patch.
2014-12-10 22:28:20 +10:00
Sam Hemelryk 18453fec76 MDL-48430 customment: improved exception handling 2014-12-10 13:26:11 +01:00
pau.ferrer-ocana 4656c6ab53 MDL-48430 custom_menu: Malformed url in custom menu cannot break the platform 2014-12-10 13:26:11 +01:00
Dan Poltawski 36700a125e MDL-48547 thirdparty: remove incorrect entry 2014-12-09 23:12:36 +00:00
Dan Poltawski 80154bd033 Merge branch 'MDL-47323-enrol-plugin-backup-28_STABLE' of https://github.com/mpetrowi/moodle into MOODLE_28_STABLE 2014-12-09 22:30:01 +00:00
Dan Poltawski fd37fba94b Merge branch 'MDL-45430-28' of git://github.com/ankitagarwal/moodle into MOODLE_28_STABLE 2014-12-09 21:22:18 +00:00
Sam Hemelryk f3586f59c4 Merge branch 'm28_MDL-48389' of https://github.com/totara/moodle into MOODLE_28_STABLE 2014-12-10 09:27:28 +13:00
Matt Petro 384f71b42c MDL-48235 mod_assign: Fix reopen until pass behavior 2014-12-09 10:45:23 -05:00
Eloy Lafuente (stronk7) 55f47d94f7 Merge branch 'MDL-31822_28' of https://github.com/dmonllao/moodle into MOODLE_28_STABLE 2014-12-09 16:12:24 +01:00
Dan Poltawski 673d38078c MDL-45679 mod_lesson: do not overqualify styles 2014-12-09 12:35:18 +00:00
Dan Poltawski e732d0d9ca Merge branch 'MDL-45679_28' of git://github.com/jmvedrine/moodle into MOODLE_28_STABLE 2014-12-09 12:34:20 +00:00
Dan Poltawski 28e38410c5 Merge branch 'MDL-48394-28' of git://github.com/jethac/moodle into MOODLE_28_STABLE 2014-12-09 10:53:38 +00:00
Dan Poltawski b16b0a61a4 Merge branch 'MDL-41846-28' of git://github.com/xow/moodle into MOODLE_28_STABLE 2014-12-09 10:35:10 +00:00
Sam Hemelryk 19f5623bf6 Merge branch 'wip_MDL-36499_M28' of git://github.com/gjb2048/moodle into MOODLE_28_STABLE 2014-12-09 16:57:11 +13:00
David Monllao 6967547062 MDL-31822 course: Formatting the section name 2014-12-09 11:52:30 +08:00
David Balch 519413892e MDL-31822 course: Show custom Section name on Front page. 2014-12-09 11:52:28 +08:00
Sam Hemelryk ceee447066 Merge branch 'wip-MDL-46486-m28' of git://github.com/marinaglancy/moodle into MOODLE_28_STABLE 2014-12-09 16:20:50 +13:00
Dan Poltawski 934c72979b MDL-40552 course: fixup unit test
Previously there was an assertion which was never used, now
we ensure to test the course themes functionality each time.
2014-12-09 16:14:23 +13:00
Sam Hemelryk bf42737370 Merge branch 'MDL-34437-28' of git://github.com/ankitagarwal/moodle into MOODLE_28_STABLE 2014-12-09 15:58:56 +13:00
Sam Hemelryk 6966842459 Merge branch 'm28_MDL-46172' of https://github.com/greg-or/moodle-mod_assign into MOODLE_28_STABLE 2014-12-09 15:38:51 +13:00
Brian Barnes 9e06074bbe MDL-48389 forms: added page title to help text 2014-12-09 15:18:54 +13:00
Sam Hemelryk 41ea5affc4 Merge branch 'mdl48517_28' of https://github.com/tlevi/moodle into MOODLE_28_STABLE 2014-12-09 15:16:00 +13:00
Brian Barnes 8e0c012bbb MDL-48532 core_roles: Set correct heading on user roles page 2014-12-09 14:24:42 +13:00
Sam Hemelryk f071a177b0 Merge branch 'wip-MDL-48366-m28' of git://github.com/marinaglancy/moodle into MOODLE_28_STABLE 2014-12-09 13:43:38 +13:00
Sam Hemelryk e0b7f5492a Merge branch 'wip-mdl-48426-m28' of https://github.com/rajeshtaneja/moodle into MOODLE_28_STABLE 2014-12-09 12:13:36 +13:00
Sam Hemelryk 664d834cd1 MDL-45699 cache: renamed cache_config_phpunittest
Renamed cache_config_phpunittest to cache_config_testing
2014-12-09 10:51:20 +13:00
Sam Hemelryk faa3b4022f MDL-45699 cache: acceptance test improvements
We now use the unit test cache config class when running
acceptance tests so that the same defines are applicable there.
2014-12-09 10:51:17 +13:00
Eloy Lafuente (stronk7) 2d16c385d7 Merge branch 'MDL-48255-28' of git://github.com/lameze/moodle into MOODLE_28_STABLE 2014-12-08 19:15:12 +01:00
Eloy Lafuente (stronk7) b2959dbe9b Merge branch 'wip-MDL-48390-m28' of git://github.com/marinaglancy/moodle into MOODLE_28_STABLE 2014-12-08 18:49:09 +01:00
Dan Poltawski 5eb62533cd Merge branch 'MDL-48410_28' of git://github.com/timhunt/moodle into MOODLE_28_STABLE 2014-12-08 15:19:11 +00:00
Dan Poltawski 7e5947b986 Merge branch 'MDL-48373_28' of git://github.com/timhunt/moodle into MOODLE_28_STABLE 2014-12-08 15:15:41 +00:00
Dongsheng Cai 592f05a064 MDL-35983 Try to use real file name from EQUELLA 2014-12-08 14:24:09 +00:00
Dan Poltawski 4f2e496184 Merge branch 'MDL-47246_28' of git://github.com/dmonllao/moodle into MOODLE_28_STABLE 2014-12-08 13:34:03 +00:00
Dan Poltawski 793e74fef3 Merge branch 'MDL-14908-28' of git://github.com/FMCorz/moodle into MOODLE_28_STABLE 2014-12-08 13:22:17 +00:00
Dan Poltawski bc11b6c138 MDL-48273 upgrade.txt version fix 2014-12-08 11:23:11 +00:00
Simey Lameze 788727862d MDL-48273 singleview: unit tests of load_user method 2014-12-08 11:22:38 +00:00
Simey Lameze adbbc7bd9e MDL-48273 singleview: add load_user method and other group validations
All credits goes to Damyon, thanks!
2014-12-08 11:22:38 +00:00
David Monllao 18450eab27 MDL-47246 mod_forum: Limit last post restriction to Q and A 2014-12-08 14:50:42 +08:00
Adrian Greeve aef3679316 MDL-48347 gradebook: More behat tests for single view. 2014-12-08 14:25:39 +08:00
Adrian Greeve fe32471819 MDL-48347 gradebook: Single view shows all grade items.
Manual grade items, course totals, and categroy totals
were not being displayed in the single view.
2014-12-08 14:24:39 +08:00
Jetha Chan c8316e2894 MDL-48169 themes: extra upgrade notes 2014-12-08 14:08:05 +08:00
Tony Levi 13dfdb0b5f MDL-48517: behat: Fix reset ordering reversal (MDL-48302) 2014-12-08 13:08:31 +10:30
Sam Hemelryk 36814aaec6 Merge branch 'MDL-37704-28' of git://github.com/ankitagarwal/moodle into MOODLE_28_STABLE 2014-12-08 14:51:01 +13:00
Sam Hemelryk fef242fa65 Merge branch 'MDL-48058-28' of git://github.com/andrewnicols/moodle into MOODLE_28_STABLE 2014-12-08 13:58:24 +13:00
Gareth J Barnard 422d1c4625 MDL-36499 javascript: Expand height of the file element in embedded view. 2014-12-06 12:11:56 +00:00
Sam Hemelryk 0bd78bb334 MDL-45699 behat: can now use alt cache config 2014-12-06 12:09:49 +13:00
Gregory Faller 14cd37913c MDL-46172 mod/assign: Stop suspended users getting assign group emails 2014-12-06 08:29:08 +10:30
AMOS bot 3cca19d176 Automatically generated installer lang files 2014-12-06 00:03:54 +08:00
Jean-Michel Vedrine 468efb3171 MDL-45679 mod_lesson: Essay grading page has no mark for essay status 2014-12-05 15:04:58 +01:00
Tim Hunt b56a1518ad MDL-48410 behat, quiz: step for efficiently adding questions 2014-12-05 12:18:06 +00:00
Tim Hunt fed2e156e2 MDL-48373 behat, questions: convert tests to use the new steps
The new steps make it more efficient to create questions.

While making the changes, I took the opportunity to alter the tests to
follow Behat best practices, and only test one thing per scenario.
2014-12-05 12:18:05 +00:00
Tim Hunt 51a0c7cda7 MDL-48373 behat: generators for questions and categories 2014-12-05 12:18:05 +00:00
Tim Hunt 6292878644 MDL-48373 behat: find table columns better.
It was not possible to select the question bank 'Created by'
or 'Modified by' columns without this change.
2014-12-05 12:18:04 +00:00
Tim Hunt 201e19d7b6 MDL-48373 behat: new container selector for list items. 2014-12-05 12:18:04 +00:00
Eloy Lafuente (stronk7) ae2a9c0e66 weekly release 2.8.1+ 2014-12-05 11:05:30 +01:00
Eloy Lafuente (stronk7) dc2dd0cf72 Merge branch 'install_28_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_28_STABLE 2014-12-05 11:05:24 +01:00
Mark Nielsen 9c08bf4a6a MDL-48058 core_message: Default message outputs: Maintain Forced status 2014-12-05 14:43:57 +08:00
Ankit Agarwal ba1f0fbd39 MDL-45430 mod_book: Automate MDLQA-2428
This test verifies that an admin can generate and view all the book log entries
2014-12-05 09:26:32 +05:30
Rajesh Taneja e784850b5a MDL-48318 behat: Fixed JS Exception
M is not created on all pages, like cron and
Steps which check for exported data. So we need
to ensure M is defined, before using it in
behat_hooks::wait_for_pending_js()
2014-12-05 11:47:49 +08:00
John Okely 6ae671b784 MDL-41846 repository_url: Escape > < ' " in input url
And throw an exception when a url is incorrectly formatted
2014-12-05 11:23:42 +08:00
John Okely dbe6a4d188 MDL-41846 repository_url: Convert spaces to %20 in input url 2014-12-05 11:23:42 +08:00
Andrew Nicols 9427be40aa MDL-48309 mod_forum: Do not escape ampersands in plain text email 2014-12-04 12:59:08 +01:00
Eloy Lafuente (stronk7) acfbe693b2 Merge branch '48425-48374-28' of git://github.com/samhemelryk/moodle into MOODLE_28_STABLE 2014-12-04 12:59:07 +01:00
Eloy Lafuente (stronk7) 760c41ca09 MDL-48374 behat: Added missing $session 2014-12-04 12:59:07 +01:00
Rajesh Taneja 8d7e6ecfc8 MDL-48374 behat: Check flag before searching for span on page 2014-12-04 12:59:07 +01:00
Andrew Nicols aa39908cef MDL-48374 behat: improved page load detection
Check that page load detection was correctly started before testing that a
new page was loaded.

Without this, it is possible to have mutliple subsequent cases of:
    And a new page should have loaded since I started watching

Without first starting the page load detection.
2014-12-04 12:59:06 +01:00
Sam Hemelryk fba1d33198 Merge branch 'M28_MDL46116_IMSCP_container_items' of https://github.com/Dave-B/moodle into MOODLE_28_STABLE 2014-12-04 12:59:05 +01:00
Dan Poltawski f304fd2e6c Merge branch 'wip-mdl-48290-m28' of https://github.com/rajeshtaneja/moodle into MOODLE_28_STABLE 2014-12-04 12:59:05 +01:00
Dan Poltawski c538b47443 Merge branch 'MDL-34627_28' of https://github.com/dmonllao/moodle into MOODLE_28_STABLE 2014-12-04 12:59:04 +01:00
Eloy Lafuente (stronk7) ea2a48fb4a Merge branch '48374-28' of git://github.com/samhemelryk/moodle into MOODLE_28_STABLE 2014-12-04 12:59:04 +01:00
Sam Hemelryk f40124002b Merge branch 'MDL-40419-28-2nd' of git://github.com/FMCorz/moodle into MOODLE_28_STABLE 2014-12-04 12:59:03 +01:00
Dan Poltawski 8f8ace5cdd Merge branch 'wip_MDL-48420_m28_lasttypo' of https://github.com/skodak/moodle into MOODLE_28_STABLE 2014-12-04 12:59:03 +01:00
Dan Poltawski efc6ed5e34 Merge branch 'MDL-48342_28' of git://github.com/jmvedrine/moodle into MOODLE_28_STABLE 2014-12-04 12:59:02 +01:00
Dan Poltawski 7a1b7e41d9 Merge branch 'MDL-40241_28' of https://github.com/dmonllao/moodle into MOODLE_28_STABLE 2014-12-04 12:59:02 +01:00
Marina Glancy f8b446f399 MDL-48366 blocks: always display custom regions in dropdown 2014-12-04 16:08:28 +08:00
AMOS bot 708cabea4d Automatically generated installer lang files 2014-12-04 00:04:36 +08:00
Matt Petro 9f4662b228 MDL-47323 backup: added enrol plugin backup structure and annotation 2014-12-02 22:03:43 -05:00
David Balch 186f4563cb MDL-46116 mod_imscp: Fix some jshint issues. 2014-12-02 11:17:40 +00:00
Simey Lameze 53e96ae4e1 MDL-48255 auth_ldap: make ldap cookie check more robust
Thanks to Baptiste Desprez for spotting this and provide a solution.
2014-12-02 15:32:33 +08:00
Ankit Agarwal 39ab2e44d0 MDL-37704 user_profile: Make sure description field can be locked
Thanks JD for the initial patch.
2014-12-02 09:43:55 +05:30
Rajesh Taneja 5367656ae8 MDL-48290 behat: Add log out after checking exported file
If the download step is the last in the scenario then we
can sometimes run into the situation where the download page
causes a http redirect but behat has already conducted its
reset (generating an error). By putting a logout step we avoid
behat doing the reset until we are off that page.
2014-12-02 09:39:27 +08:00
Sam Hemelryk 2fca03ec2a MDL-48425 course: management behat tests improved 2014-12-02 11:45:16 +13:00
Sam Hemelryk f2ebd53dba MDL-48374 behat: improved page load exceptions
The following improvements have been made to the page load watching:
* Improved the exceptions when a page load expectation fails.
* Added an exception if start watching happens twice without a page load.
* Improved the page load span and xpath to make it faster and less likely
  to interfer in the future.
2014-12-02 11:44:02 +13:00
Tim Hunt 886bc21b8b MDL-48374 behat: new steps for detecting page loads. 2014-12-02 08:58:11 +13:00
Mary Evans 5b1efbcab4 MDL-48243 theme_bootstrapbase: Fixed inconsistancy between LTR/RTL LESS 2014-12-01 17:32:46 +00:00
Didier Raboud 9dfc203245 MDL-34437 shibboleth: Correct the shibboleth wiki links. 2014-12-01 14:57:37 +05:30
Frederic Massart 278642a380 MDL-14908 user: Parents are not restricted when separated groups is used 2014-12-01 15:16:15 +08:00
David Monllao 1101fd22f2 MDL-40241 core_completion: Minor fixes to provided patch
Thanks to Aaron Barnes and Jon Sharp for working on this issue.
2014-12-01 15:01:14 +08:00
Marina Glancy db956269fe MDL-46486 coursecat: remove function forgotten in MDL-38147 2014-12-01 13:22:38 +08:00
Rajesh Taneja 1538a20679 MDL-48426 behat: soft-reset mink session before scenario 2014-12-01 12:40:18 +08:00
Rajesh Taneja 4eac169974 MDL-48426 behat: Wait for redirection after save
After saving wiki comment, page is redirected
Make sure to wait for redirection after save
to avoid random fails
2014-12-01 11:25:26 +08:00
Charles Fulton 5445d98144 MDL-34627 feedback: Convert default format value during restore 2014-12-01 10:58:38 +08:00
Aaron Barnes 258c0449b6 MDL-40241 blocks_completionstatus: Fix notices 2014-12-01 10:05:50 +08:00
Aaron Barnes 0a39d64927 MDL-40241 completion: Default roles unable to manually complete course
Thanks to Jon Sharp for authoring the original patch!
2014-12-01 10:05:48 +08:00
Sam Hemelryk c40f1f184f Merge branch 'wip-MDL-48377-m28' of git://github.com/marinaglancy/moodle into MOODLE_28_STABLE 2014-12-01 14:02:15 +13:00
Sam Hemelryk fc7ab00709 Merge branch 'MDL-48382_28' of git://github.com/timhunt/moodle into MOODLE_28_STABLE 2014-12-01 13:58:20 +13:00
Sam Hemelryk a76c20c20e Merge branch 'MDL-46618_m28' of git://github.com/kordan/moodle into MOODLE_28_STABLE 2014-12-01 11:59:36 +13:00
Sam Hemelryk 824c31e592 Merge branch 'MDL-14402-28' of git://github.com/andrewnicols/moodle into MOODLE_28_STABLE 2014-12-01 11:35:53 +13:00
Sam Hemelryk cba386b636 Merge branch 'MDL-48384-28' of git://github.com/danpoltawski/moodle into MOODLE_28_STABLE 2014-12-01 11:31:36 +13:00
Sam Hemelryk 438b185951 Merge branch 'MDL-48309-28' of git://github.com/andrewnicols/moodle into MOODLE_28_STABLE 2014-12-01 11:10:29 +13:00
Sam Hemelryk 3f1b091aa2 MDL-47133 editor_atto: fixed lint errors 2014-12-01 10:36:38 +13:00
Sam Hemelryk 0fec60deea Merge branch 'MDL-47133-28' of git://github.com/FMCorz/moodle into MOODLE_28_STABLE 2014-12-01 10:19:31 +13:00
Petr Skoda 9e28b040df MDL-48420 test: fix lasttnamephonetic typo 2014-12-01 09:26:22 +13:00
Sam Hemelryk f7e646a5c1 Merge branch 'MDL-48227-28' of git://github.com/ankitagarwal/moodle into MOODLE_28_STABLE 2014-12-01 09:14:50 +13:00
Ankit Agarwal d2b8475e3e MDL-42717 backups: set correct backup status and add logs
Set a correct backup status of ERROR when we fail to copy a file to an external directory given the backup configs demand it.
Also a lot of logs are added around this area to let admins easily find the problem if backup fails because of directory permissions.
2014-12-01 09:11:06 +13:00
Sam Hemelryk af9e696b79 Merge branch 'wip-mdl-48192-m28' of https://github.com/rajeshtaneja/moodle into MOODLE_28_STABLE 2014-12-01 08:33:57 +13:00
AMOS bot aa29beabe8 Automatically generated installer lang files 2014-11-29 00:04:01 +08:00
Jean-Michel Vedrine 71a673cc3b MDL-48342 Question: qformat_default::readquestion is broken 2014-11-28 15:38:21 +01:00
Tim Hunt 105dbe93d5 MDL-48382 quiz behat: make add question step more robust. 2014-11-28 13:43:31 +00:00
Ankit Agarwal d141109dc2 MDL-48227 forum: Update the message shown in emails
AMOS BEGIN
 CPY [deleteoriginalonreply,mod_forum],[replytopostbyemail,mod_forum]
AMOS END
2014-11-28 15:31:25 +05:30
Dan Poltawski 97cf440401 weekly release 2.8.1+ 2014-11-28 08:04:49 +00:00
Dan Poltawski bb2f54224c Merge branch 'install_28_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_28_STABLE 2014-11-28 08:04:47 +00:00
Damyon Wiese 6c20557845 Revert "Merge branch 'MDL-38128_28' of https://github.com/dmonllao/moodle into MOODLE_28_STABLE"
This reverts commit 349c877872.

This reverts commit f67638b05f, reversing
changes made to c604a8079a.
2014-11-28 15:12:30 +08:00
David Monllao 349c877872 MDL-38128 mod_assign: Changes in grading summary page using team submissions
If there is an active group and (groupmode != NOGROUPS)
the displayed info is related with that single group.
2014-11-28 05:49:22 +08:00
Dan Poltawski 5ae74cad15 Revert "Merge branch 'MDL-43127-28' of git://github.com/FMCorz/moodle into MOODLE_28_STABLE"
This reverts commit d758f054b9, reversing
changes made to f67638b05f.
2014-11-27 09:35:00 +00:00
Dan Poltawski e393866a36 Revert "Merge branch 'MDL-43127-28-fixup' of https://github.com/FMCorz/moodle into MOODLE_28_STABLE"
This reverts commit f603096c47, reversing
changes made to 5169661ee2.
2014-11-27 09:34:58 +00:00
Rajesh Taneja 99c0919993 MDL-48192 tool_monitor: check output buffer and not ignore it.
Check what is thrown in output buffer and
make sure output is expected output.
2014-11-27 17:03:54 +08:00
Frederic Massart c83dc49d3c MDL-40419 backup: Advanced comparison when restoring blocks in course 2014-11-27 16:20:11 +08:00
Frederic Massart 9a59701f0f MDL-40419 blocks: Function to get page type patterns from pattern 2014-11-27 16:20:11 +08:00
Jetha Chan 1cd8f3c645 MDL-48394 core_renderers: remove role=presentation on user picture links 2014-11-27 15:34:10 +08:00
David Monllao c3e67edfac MDL-22309 enrol_self: Fixing get_role_users usage 2014-11-27 11:34:01 +08:00
Marina Glancy 92b71540b3 MDL-48390 cohorts: do not limit number of cohorts in dropdowns 2014-11-27 11:15:09 +08:00
Eloy Lafuente (stronk7) bba645d102 Merge branch 'wip-mdl-48190-m28' of https://github.com/rajeshtaneja/moodle into MOODLE_28_STABLE 2014-11-26 13:25:41 +01:00
Dan Poltawski 7cc923f443 MDL-48384 thirdpartylibs: correct location of yui 2014-11-26 12:13:04 +00:00
Frederic Massart da53c524f1 MDL-47133 editor_atto: Use strict validation of keyboard shortcuts 2014-11-26 17:40:50 +08:00
Dan Poltawski f603096c47 Merge branch 'MDL-43127-28-fixup' of https://github.com/FMCorz/moodle into MOODLE_28_STABLE 2014-11-26 09:23:08 +00:00
Frederic Massart 480c254ac1 MDL-43127 tool_uploadcourse: Empty enrolment method is acceptable
Without the patch a course would not be created if it contained
an enrolment method column with an empty value. e.g.:

shortname,fullname,category,enrolment_1,enrolment_1_disable
courserestored,Course restored,1,,
courserestored2,Course restored 2,manual,1
2014-11-26 17:14:50 +08:00
Andrew Nicols 5169661ee2 MDL-48148 mod_forum: Use correct original subject when handling replies 2014-11-26 08:56:24 +00:00
Dan Poltawski a76630d700 Merge branch 'MDL-48210-28-checker-caching' of git://github.com/mudrd8mz/moodle into MOODLE_28_STABLE 2014-11-26 08:20:42 +00:00
David Mudrák 475f4a6272 MDL-48210 updates checker: Fix empty return type
Credit goes to Marina Glancy for catching during the testing.
2014-11-26 09:07:50 +01:00
Marina Glancy 9e74aef0a9 MDL-48377 forum: do not swallow spaces in notification emails 2014-11-26 12:17:40 +08:00
Sam Hemelryk 58aabfcedd Merge branch 'MDL-22309_28' of git://github.com/dmonllao/moodle into MOODLE_28_STABLE 2014-11-26 09:06:11 +13:00
Sam Hemelryk eccf806ad0 Merge branch 'MDL-48191-28' of git://github.com/jethac/moodle into MOODLE_28_STABLE
Conflicts:
	grade/report/grader/yui/build/moodle-gradereport_grader-gradereporttable/moodle-gradereport_grader-gradereporttable-min.js
2014-11-26 08:59:13 +13:00
Sam Hemelryk 1198f5ae01 Merge branch 'MDL-47329-28' of git://github.com/jethac/moodle into MOODLE_28_STABLE 2014-11-26 08:43:36 +13:00
Eloy Lafuente (stronk7) cc9161bebc Merge branch 'MDL-48276-28' of git://github.com/danpoltawski/moodle into MOODLE_28_STABLE 2014-11-25 18:45:31 +01:00
Eloy Lafuente (stronk7) bea43ad49a Merge branch 'MDL-48277-28' of git://github.com/danpoltawski/moodle into MOODLE_28_STABLE 2014-11-25 18:42:12 +01:00
Heiko Schach 9c41fd2377 MDL-48036 course: change multilang cache key 2014-11-25 14:35:14 +00:00
Dan Poltawski b0b7c2d808 Merge branch 'MDL-41155-28' of git://github.com/gurgus/moodle into MOODLE_28_STABLE 2014-11-25 13:18:14 +00:00
Eloy Lafuente (stronk7) 3ca610e89a Merge branch 'MDL-48210-28-checker-caching' of git://github.com/mudrd8mz/moodle into MOODLE_28_STABLE 2014-11-25 13:22:14 +01:00
Dan Poltawski 71d7788366 Merge branch 'MDL-46416-28' of git://github.com/FMCorz/moodle into MOODLE_28_STABLE 2014-11-25 11:21:21 +00:00
Dan Poltawski d758f054b9 Merge branch 'MDL-43127-28' of git://github.com/FMCorz/moodle into MOODLE_28_STABLE 2014-11-25 11:18:52 +00:00
Dan Poltawski f67638b05f Merge branch 'MDL-38128_28' of https://github.com/dmonllao/moodle into MOODLE_28_STABLE 2014-11-25 11:07:53 +00:00
Eloy Lafuente (stronk7) c604a8079a Merge branch '48189-28' of git://github.com/samhemelryk/moodle into MOODLE_28_STABLE 2014-11-25 11:23:34 +01:00
Dave Cooper 9b36c64056 MDL-41155 Lesson: Fixed multiple question attempts logic
Thanks to Rajneel Totaram for providing this patch.
2014-11-25 14:16:37 +08:00
Dave Cooper b110dd77a4 MDL-41155 Lesson: Added behat tests for multiple question attempts 2014-11-25 14:16:37 +08:00
Frederic Massart 086199c4e9 MDL-43127 tool_uploadcourse: Add support for more enrolment methods 2014-11-25 11:01:30 +08:00
Sam Hemelryk b42123f38c Merge branch 'MDL-22043-28' of git://github.com/andrewnicols/moodle into MOODLE_28_STABLE 2014-11-25 15:54:20 +13:00
David Monllao c440b9947e MDL-38128 mod_assign: Adding group selector to grading summary page
Thanks to Pau Ferrer Ocaña and Avi Levy for
their work on this issue.
2014-11-25 10:52:29 +08:00
Rajesh Taneja b64a526dba MDL-48190 behat: Fixed visit background in MoodleScenarioTester 2014-11-25 09:42:38 +08:00
Sam Hemelryk b9bfc5f15a MDL-23839 navigation: fixed php5.5ism 2014-11-25 14:35:47 +13:00
Andrew Nicols 94ae0d9f3b MDL-48309 mod_forum: Handle discussion subscriptions correctly 2014-11-25 09:29:39 +08:00
Andrew Nicols da9d46b5c0 MDL-48309 mod_forum: Add discussion subscription to the navigation 2014-11-25 09:29:38 +08:00
Sam Hemelryk b3351c0133 Merge branch 'MDL-23839-28' of git://github.com/andrewnicols/moodle into MOODLE_28_STABLE 2014-11-25 14:07:24 +13:00
Sam Hemelryk e8ffea7bd5 Merge branch 'MDL-23912-28' of git://github.com/jethac/moodle into MOODLE_28_STABLE 2014-11-25 12:29:04 +13:00
Eloy Lafuente (stronk7) 25e135af74 Merge branch '38343-28' of git://github.com/samhemelryk/moodle into MOODLE_28_STABLE 2014-11-25 00:28:18 +01:00
Eloy Lafuente (stronk7) e4e04cdb84 Merge branch '48304-28' of git://github.com/samhemelryk/moodle into MOODLE_28_STABLE 2014-11-25 00:23:49 +01:00
Sam Hemelryk 222f015381 Merge branch 'MDL-48246-M28' of git://github.com/lazydaisy/moodle into MOODLE_28_STABLE
Conflicts:
	theme/bootstrapbase/style/moodle.css
2014-11-25 10:52:59 +13:00
Sam Hemelryk 5a9e656628 Merge branch 'm28_MDL-48265' of https://github.com/totara/moodle into MOODLE_28_STABLE 2014-11-25 09:42:56 +13:00
Dan Poltawski 5ff9df857e Merge branch '47832-28-removed' of git://github.com/samhemelryk/moodle into MOODLE_28_STABLE 2014-11-24 17:30:20 +00:00
Dan Poltawski c97952e6af Merge branch 'MDL-45867-m28-master' of https://github.com/dthies/moodle into MOODLE_28_STABLE 2014-11-24 17:11:15 +00:00
Mark Nelson e2e8a3e859 MDL-47601 core_backup: ensure removal of automated backups 2014-11-24 17:03:04 +00:00
Dan Poltawski edfb84865a Merge branch 'wip-MDL-48252-28' of git://github.com/abgreeve/moodle into MOODLE_28_STABLE 2014-11-24 16:29:27 +00:00
AMOS bot 78d7e090b2 Automatically generated installer lang files 2014-11-25 00:04:11 +08:00
Dan Poltawski 774522ff7e Merge branch 'MDL-48274-28' of git://github.com/andrewnicols/moodle into MOODLE_28_STABLE 2014-11-24 15:37:53 +00:00
Dan Poltawski 3a9daf6f9a Merge branch 'wip-mdl-48302-m28' of https://github.com/rajeshtaneja/moodle into MOODLE_28_STABLE 2014-11-24 11:57:11 +00:00
Dan Poltawski 1913d60133 Merge branch 'MDL-48180-28' of git://github.com/FMCorz/moodle into MOODLE_28_STABLE 2014-11-24 11:53:55 +00:00
David Monllao 3aeec06364 MDL-22309 report_singleview: Fixing wrong uses of get_role_users() 2014-11-24 10:59:02 +08:00
David Monllao de64c655e2 MDL-22309 accesslib: Preventing incorrect get_role_users() uses 2014-11-24 10:59:02 +08:00
David Monllao 7d3f51c262 MDL-22309 accesslib: Adding unit test to expose the issue 2014-11-24 10:59:02 +08:00
Sam Hemelryk b4d7288e94 Merge branch 'MDL-48148-28' of git://github.com/andrewnicols/moodle into MOODLE_28_STABLE 2014-11-24 15:58:03 +13:00
Sam Hemelryk 43e413f93f Merge branch 'MDL-48064-m28-master' of https://github.com/dthies/moodle into MOODLE_28_STABLE 2014-11-24 14:54:25 +13:00
Andrew Nicols afcae55712 MDL-48148 mod_forum: Use the standard forum reply subject as default
When a user replies by e-mail, the course name has been included in the
original e-mail. As a result, the reply subject becomes longer and longer.

In cases whether either:
* the discussion name; or
* the replied-to-post subject

is present in the mail subject, the standard reply subject is instead used.
2014-11-24 09:11:22 +08:00
Mark Nelson 65e2d354aa MDL-35494 core_backup: fixed activity restoration issue 2014-11-24 10:33:50 +13:00
Sam Hemelryk c19e95c871 Merge branch 'MDL-48288-28' of git://github.com/jethac/moodle into MOODLE_28_STABLE 2014-11-24 10:02:47 +13:00
David Mudrák 6237bb2f2f MDL-48210 updates checker: Improve cron notifications processing
These are cosmetic improvements spotted while working on the issue.

1. Do not waste time if there are no changes to notify about.
2. Fix the legacy plugin manager's get_plugins() call.
2014-11-21 12:07:55 +01:00
David Mudrák 87082d0f1c MDL-48210 plugin_manager: Invalidate caches after fetching updates info 2014-11-21 12:07:55 +01:00
Jetha Chan 229171be1a MDL-48288 gradebook: fix floating footer exception when averages disabled
The code we use to update styles on floating elements did not account for
situations where those floating elements don't exist. This was discovered
when a test site didn't have column averages enabled, resulting in no
floating footer element being created, so when _handleScrollEvent was
fired the first time, a null reference exception was thrown trying to
apply styles to a non-existent element.
2014-11-21 10:56:47 +08:00
Rajesh Taneja 62a703b655 MDL-48302 behat: Reverted temp fix added by MDL-48251 2014-11-21 10:41:09 +08:00
Rajesh Taneja c4c810491a MDL-48302 behat: Reset all data, before starting behat suite 2014-11-21 10:41:03 +08:00
Rajesh Taneja 46388b5e48 MDL-48302 behat: Make sure to clear php file cache 2014-11-21 10:40:56 +08:00
Rajesh Taneja 54bd82d4ae MDL-48302 behat: Reset cache before scenario 2014-11-21 10:40:49 +08:00
Jetha Chan ffd5282986 MDL-47329 mod_book: missing RTL styles, added page body selectors 2014-11-21 10:24:45 +08:00
Jetha Chan 07bff34437 MDL-47329 mod_book: use embedded pagetype instead of hardcoded HTML 2014-11-21 10:04:50 +08:00
Kordan 66649405b5 MDL-46618 tool_xmldb: added styles_bootstrapbase.css 2014-11-20 10:42:10 +01:00
Dan Poltawski 702e65c9ed weekly release 2.8.1+ 2014-11-20 08:38:26 +00:00
Dan Poltawski 81c559d05e Merge branch 'install_28_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_28_STABLE 2014-11-20 08:38:24 +00:00
Sam Hemelryk fa23afbe30 MDL-48304 moodle_url: compare now considers anchor 2014-11-20 15:38:48 +13:00
Adrian Greeve 6d5f68a832 MDL-48252 scheduled tasks: file_temp_cleanup_task does full delete.
This scheduled task was previously only doing a partial delete
due to the fact that the directory modification time would be
updated when a child file was deleted. It would then have to
wait another week before that directory could be deleted.
2014-11-20 10:34:33 +08:00
Adrian Greeve 88690b92e4 MDL-48252 scheduled tasks: Unit test for file_temp_cleanup_task. 2014-11-20 10:28:18 +08:00
Sam Hemelryk 472b438486 MDL-47832 cache: removed data source aggregate functionality
Cache data source aggregate functionality was found to be broken
and unused, because of this the decision was made to remove it
rather than fix it.
As it was broken we did not follow typical deprecation methods and
instead the code was removed outright with only structure
remaining and left deprecated.
2014-11-20 11:25:04 +13:00
Sam Hemelryk 04c92d672f MDL-43628 mod_assign: fixed formatting of statement 2014-11-20 10:18:42 +13:00
Eloy Lafuente (stronk7) 57ebd7b1b1 Merge branch '48206-28' of git://github.com/samhemelryk/moodle into MOODLE_28_STABLE 2014-11-19 21:19:41 +01:00
Rajesh Taneja 1cda99f39b MDL-48251 behat: Shuffling activity creation fix quiz behat 2014-11-19 20:06:54 +01:00
Dan Poltawski 93d5459125 MDL-29585 wiki: fix unit test fails 2014-11-19 11:40:37 +00:00
Frederic Massart 62845bce83 MDL-29585 mod_wiki: Prevent broken links in editable sections
When a section name ended with a URL, the '<a' part of [edit] link
that is appended to the section was considered as part of the URL
in the section, thus causing the [edit] link to be broken.
2014-11-19 10:34:36 +00:00
Dan Poltawski d9eedd1a68 MDL-48277 css: initial csslint config file 2014-11-19 09:20:50 +00:00
Rajesh Taneja 3dfecf93cc MDL-46865 report_log: Fixed site name in behat step 2014-11-19 06:41:13 +00:00
Mario Wehr 0858e593e6 MDL-48274 mod_forum: Add missing context to has_capability call 2014-11-19 14:06:36 +08:00
Dan Poltawski ddf83f51d4 MDL-48276 qformat_xhtml: avoid uncessary html in .css file
In order to help automated tools move the html out of the css
file.
2014-11-19 05:56:41 +00:00
Andrew Nicols ba8ca6604d MDL-22043 mod_forum: Fix toggle subscription editing button behaviour
Update the user session property before generating the button which relies
upon it.
2014-11-19 13:32:23 +08:00
Andrew Nicols f8da8ae382 MDL-14402 blocks: Do not show assign roles on my home 2014-11-19 11:18:49 +08:00
Andrew Nicols 5c86569096 MDL-23839 navigation: Check for assignable course category roles 2014-11-19 08:55:56 +08:00
Sam Hemelryk 921d045174 MDL-33606 tests: fixed broken unit test 2014-11-19 11:30:42 +13:00
Sam Hemelryk c81ae06997 Merge branch 'MDL-33606_28' of git://github.com/dmonllao/moodle into MOODLE_28_STABLE 2014-11-19 09:37:24 +13:00
Daniel Thies 3228da2e5c MDL-45867 atto_equation: Change preview update to asynchronous 2014-11-18 13:30:33 -06:00
Mary Evans 236351fdc3 MDL-47915 mod/scorm: Added JS fallback for themes using copied layouts. 2014-11-18 17:49:08 +00:00
AMOS bot 752fdd2479 Automatically generated installer lang files 2014-11-19 00:05:40 +08:00
Dan Poltawski 29a036aa59 Merge branch 'MDL-48146_28' of git://github.com/timhunt/moodle into MOODLE_28_STABLE 2014-11-18 12:07:10 +00:00
Sam Hemelryk 299f1bcdbd Merge branch 'wip-mdl-48250-m28' of https://github.com/rajeshtaneja/moodle into MOODLE_28_STABLE 2014-11-18 17:38:08 +13:00
Sam Hemelryk 09de24667f Merge branch 'MDL-29585-28' of git://github.com/FMCorz/moodle into MOODLE_28_STABLE 2014-11-18 16:47:30 +13:00
Brian Barnes a7d7354c85 MDL-48265 feedback: Added alt text to ghostscript test image 2014-11-18 16:46:00 +13:00
Jetha Chan 31830a539d MDL-23912 core_comment: update count after deletion 2014-11-18 09:35:23 +08:00
Sam Hemelryk 67ccf63800 MDL-38343 cache: better test server strings 2014-11-18 12:34:30 +13:00
Sam Hemelryk 292e991b86 Merge branch 'MDL-47618_28' of git://github.com/timhunt/moodle into MOODLE_28_STABLE 2014-11-18 11:12:32 +13:00
Daniel Thies 65e345c3f4 MDL-48064 atto_editor: Expand event subscription for saving selection 2014-11-17 11:36:43 -06:00
Mark Nelson 554f0bd206 MDL-30619 mod_data: fixed deletion of files on reset 2014-11-17 16:49:00 +00:00
Dan Poltawski 38d6b6eb17 Merge branch 'MDL-48199_M28' of git://github.com/lazydaisy/moodle into MOODLE_28_STABLE
Conflicts:
	theme/bootstrapbase/style/moodle.css
2014-11-17 16:42:44 +00:00
AMOS bot 931d7216cc Automatically generated installer lang files 2014-11-18 00:05:48 +08:00
Dan Poltawski 6dfc37accf Merge branch 'MDL-47648_28' of git://github.com/timhunt/moodle into MOODLE_28_STABLE 2014-11-17 15:41:38 +00:00
Rajesh Taneja 9e273e7556 MDL-46865 report_log: Fixed showuser and showcourse in report log 2014-11-17 15:34:16 +00:00
Dan Poltawski 2d747884c6 Merge branch 'm28_MDL-48023_Theme_Setting_Files_Cacheable_By_Both_Browsers_And_Proxies' of https://github.com/scara/moodle into MOODLE_28_STABLE 2014-11-17 15:20:17 +00:00
Dan Poltawski af2c296364 Merge branch 'MDL-48042_28' of git://github.com/ppichet/moodle into MOODLE_28_STABLE 2014-11-17 15:13:19 +00:00
Mary Evans ec1a6a6996 MDL-48246 theme: Fixed typo in 'hidepanelicon' 2014-11-17 15:06:34 +00:00
Dan Poltawski 3b8a871233 Merge branch 'MDL-42756_28' of git://github.com/aolley/moodle into MOODLE_28_STABLE 2014-11-17 13:52:49 +00:00
Adrian Greeve ccfd014d42 MDL-36240 backup: Activity calendar events backed up.
Activity calendar events can now be backed up and restored
when no user data is selected.
2014-11-17 13:31:19 +00:00
Dan Poltawski 0c0714ae3b Merge branch 'MDL-43987-28' of git://github.com/xow/moodle into MOODLE_28_STABLE 2014-11-17 13:17:40 +00:00
Dan Poltawski 4d7f88d55c Merge branch 'MDL-46640-28' of git://github.com/FMCorz/moodle into MOODLE_28_STABLE 2014-11-17 12:52:36 +00:00
Dan Poltawski d5f6d962e2 Merge branch 'MDL-48150-28' of git://github.com/andrewnicols/moodle into MOODLE_28_STABLE 2014-11-17 11:44:15 +00:00
Andrew Nicols 97f5b7b8a2 MDL-48150 mod_forum: Generate message inbound keys for all posts
This code was previously misplaced so that only posts in discussion which
had not yet been processed in the current cron run would have keys
generated. If two posts were generated in the same discussion and sent out
on the same cron cycle, only the first post to be processed would have a
key generated.
2014-11-17 15:48:12 +08:00
Frederic Massart 410d8eda9a MDL-48180 mod_assign: By default do not count 'new' submissions 2014-11-17 15:14:59 +08:00
Rajesh Taneja c42974048a MDL-48250 enrol_ldap: set default category
As in other enrol plugins (database), set default
category to 1 (pointing to Miscellaneous)
2014-11-17 14:42:27 +08:00
Frederic Massart fce8127ff0 MDL-46640 navigation: Handle block contexts within a category 2014-11-17 12:42:09 +08:00
Frederic Massart 864e404348 MDL-29585 mod_wiki: Handle special characters in headings/sections 2014-11-17 10:39:26 +08:00
Jetha Chan cfbc7d903f MDL-48191 gradebook: fixed floating headers when emails not displayed 2014-11-17 10:17:53 +08:00
Sam Hemelryk 0b9dc284e8 MDL-48196 phpunit: fixed the fail after this change 2014-11-17 15:07:39 +13:00
John Okely e92d84244c MDL-43987 core: Remove port numbers in cleanremoteaddr 2014-11-17 09:48:32 +08:00
Sam Hemelryk e9f7276481 Merge branch 'MDL-48115_28' of https://github.com/totara/openbadges into MOODLE_28_STABLE 2014-11-17 14:37:58 +13:00
Sam Hemelryk b1dd1c8656 Merge branch 'MDL-48194-28' of git://github.com/andrewnicols/moodle into MOODLE_28_STABLE 2014-11-17 13:39:17 +13:00
Sam Hemelryk 6b5f44b214 Merge branch 'MDL-48171-28' of git://github.com/ankitagarwal/moodle into MOODLE_28_STABLE 2014-11-17 13:21:05 +13:00
Mary Evans 068c7a8706 MDL-48199 theme_bootstrapbase: Page padding left is wrong when in RTL 2014-11-17 00:02:13 +00:00
Sam Hemelryk e3adeba886 Merge branch 'MDL-48179-m28' of https://github.com/sammarshallou/moodle into MOODLE_28_STABLE 2014-11-17 12:48:12 +13:00
Sam Hemelryk 666ac939d5 Merge branch 'MDL-48196-28' of git://github.com/andrewnicols/moodle into MOODLE_28_STABLE 2014-11-17 12:34:16 +13:00
Sam Hemelryk d2fe097e20 Merge branch 'm28_MDL-47993' of https://github.com/totara/moodle into MOODLE_28_STABLE 2014-11-17 12:21:37 +13:00
Sam Hemelryk b1298c7690 Merge branch 'MDL-43628_v28' of https://github.com/scyrma/moodle into MOODLE_28_STABLE 2014-11-17 11:45:01 +13:00
Ankit Agarwal 6748b5ee5c MDL-35638 backup: Do not print headers during redirects 2014-11-17 10:38:50 +13:00
Sam Hemelryk 583cf99ebd Merge branch 'MDL-47590_28' of git://github.com/timhunt/moodle into MOODLE_28_STABLE 2014-11-17 10:38:49 +13:00
Sam Hemelryk c1ca23afa3 Merge branch 'MDL-44657-28' of git://github.com/FMCorz/moodle into MOODLE_28_STABLE 2014-11-17 10:38:49 +13:00
Sam Hemelryk 0c96741ef7 MDL-48189 grade: letters now covered by behat 2014-11-17 08:54:30 +13:00
Matteo Scaramuccia b73158d3d0 MDL-48023 Files API: Theme files must be cache-able by shared proxies.
The profile image AKA user icon will be cache-able by shared proxies too,
under its specific accessibility constraints/conditions.
2014-11-16 09:59:22 +01:00
Pierre Pichet f6fd6787d1 MDL-48042 Questions: Reset Calculated qtype comments on datasets
Reset back the modifications of Calculated qtype comments on datasets
    done by MDL-47224

Signed-off-by: Pierre Pichet <pichet.pierre@uqam.ca>
2014-11-15 16:54:27 -05:00
sam marshall 60fef215f6 MDL-48179 Backup progress: Can time out when compressing large backup 2014-11-14 18:30:17 +00:00
Daniel Thies 4587188ad9 MDL-48064 atto_editor: Check if activeElement is child node in isActive 2014-11-14 12:15:22 -06:00
Tim Hunt bc575d2bea MDL-47590 question backup: include response file only with userdata 2014-11-14 16:21:38 +00:00
Ankit Agarwal 806f6f642c MDL-48171 gradebook: Use proper apis to get item name 2014-11-14 14:05:52 +05:30
Sam Hemelryk acad969077 MDL-48206 block_comments: textarea width 100% 2014-11-14 11:40:32 +13:00
Oleg Demeshev 066751547d MDL-47993 calendar: Fix ical import Microsoft calendar issue 2014-11-14 10:39:34 +13:00
Eloy Lafuente (stronk7) 296b602f2c Moodle release 2.8.1 2014-11-13 12:22:51 +01:00
Eloy Lafuente (stronk7) 76db660264 Merge branch 'MDL-48214-28-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_28_STABLE 2014-11-13 12:05:17 +01:00
Helen Foster e5381b67e9 MDL-48214 Merge English strings from the en_fix language pack 2014-11-13 11:32:24 +01:00
Paul Holden 309a919074 MDL-44657 forms: Form identifiers should only contain basic characters 2014-11-13 16:25:12 +08:00
Andrew Nicols 367a26d088 MDL-48196 phpunit: Set e-mail address for admin user at installation 2014-11-13 08:58:55 +08:00
Eugene Venter 8d4e07d86d MDL-48204 mod_wiki: admin.php - fix syntax error 2014-11-13 00:47:16 +01:00
Tim Hunt 89eb7cf302 MDL-48146 quiz settings: fix non-percent feedback boundaries 2014-11-12 15:46:55 +00:00
Dan Poltawski b37f9889d0 weekly release 2.8+ 2014-11-12 11:33:31 +00:00
Dan Poltawski c8900a5152 MDL-48174 tool_langimport: info about skipped update
So admins can work out why the task might not be having an effect.
2014-11-12 11:22:45 +00:00
Rajesh Taneja 4c4d53ebaf MDL-48174 core_lang: support for ->skiplangupgrade in lang cron task
Similar to upgrade_language_pack(), update_langpacks_task should
respect skiplangupgrade config. Also, this should be added to behat
whitelist, so it can be disabled during on-sync period, when lang
pack for master is not available.
2014-11-12 11:03:55 +00:00
David Monllao a26ce935c7 MDL-30968 mod_forum: No picture link to group when no groups mode 2014-11-12 07:43:08 +00:00
David Monllao 2a3e89465c MDL-33606 course: Adding section info to course_viewed log 2014-11-12 13:58:35 +08:00
Andrew Nicols 6d8019438f MDL-48194 testing: Adjust naming of testsuites in phpunit.xml
This will make it easier to run phpunit for a specific component by making
all testsuite names consistent, guessable, and in-line with the naming of
the parameter (testsuite vs. test suite).
2014-11-12 12:06:45 +08:00
Adam Olley b19e9ae457 MDL-42756 dock: Trigger actionmenu enhance when showing dock panel
Additionally fixes the styling for the actionmenu icon size in
bootstrapbase'd themes.
2014-11-12 14:11:33 +10:30
Frederic Massart c6a1e9bed3 MDL-46416 group: Use a revision number for group pictures 2014-11-12 11:29:22 +08:00
James Ballard 0df5893423 MDL-47391 Update pagelayout for default profile configuration 2014-11-12 12:34:27 +13:00
Frederic Massart dd818fdb44 MDL-39692 grade: Little code clean up of letter boundary deletion 2014-11-12 12:19:31 +13:00
Huy Hoang 1fd2bc4810 MDL-39692 grade: Ability to delete letter boundary 2014-11-12 12:19:31 +13:00
Yuliya Bozhko 3f3f7ce52a MDL-48115 badges: Fix strtoupper() output in badges
Signed-off-by: Yuliya Bozhko <yuliya.bozhko@totaralms.com>
2014-11-12 09:30:29 +13:00
Amanda Doughty 088c4fb280 MDL-30968 mod/forum Fixed group link 2014-11-12 09:00:16 +13:00
Dan Poltawski 0ed92e6a37 MDL-47502 statslib tests: improve test
While integrating I noticed some problems which already existed in this
test:
* The enrolment data generator was not used
* The student roleid was hardocded
* The role assignment was at site level..
2014-11-11 19:26:03 +00:00
Eugene Venter afc8bd9672 MDL-47502 test_statslib_cron_daily: fix provider
Fiddling with the database in the data provider causes "out of sync"
errors when running suite tests.
2014-11-11 19:12:46 +00:00
Damyon Wiese c2dd91bfef MDL-47975 assign: Stop gap fix for random time fails. 2014-11-11 19:06:38 +00:00
sam marshall b0ac83b82b MDL-48093 HTML 5 video: Firefox now supports .mp4 2014-11-11 19:00:12 +00:00
Dan Poltawski 272ad5b577 Merge branch 'MDL-48168_28' of git://github.com/timhunt/moodle into MOODLE_28_STABLE 2014-11-11 18:48:36 +00:00
David Balch 7805d03a9e MDL-46116 mod_imscp: Display first item with content on load. 2014-11-11 18:42:29 +00:00
Tim Hunt ecb40b963d MDL-47618 quiz statistics: fatal error with groups.
The problem was that the names of query placeholders were changing. The
fix was to do things ourself, rather than using get_in_or_equal.
2014-11-11 18:29:31 +00:00
David Balch b45e110c3a MDL-46116 mod_imscp: Don't create links on items without content. 2014-11-11 18:16:39 +00:00
Darko Miletic 928497310e MDL-39376 enrol: Optimized setting for ldap and database 2014-11-11 17:23:01 +00:00
David Mudrák 5755d70f2e MDL-48156 task: Skip the scheduled task only for really disabled plugins 2014-11-11 17:18:03 +00:00
Tim Hunt ff8aaa2dd4 MDL-47648 admin unit tests: fix file perms on mimetex.exe
This was causing the
core_admintree_testcase::test_admin_setting_configexecutable unit test
to fail.
2014-11-11 14:04:20 +00:00
Mathieu Petit-Clair 5ebde631c0 MDL-43628 assign: make submissionagreement usable on multilingual sites 2014-11-10 16:53:49 -05:00
Tim Hunt 21c633a8c6 MDL-48168 quiz editing: max grade should be editable after attempts
Note that there was a lot of legacy code left from Moodle 2.7 which is
no longer required, and I took this opportunity to delete it.
2014-11-10 19:00:33 +00:00
Eloy Lafuente (stronk7) 25fe23f5f5 MDL-48144 upgrade: add v2.8.0 sep lines 2014-11-10 18:09:20 +01:00
71064 changed files with 1880304 additions and 8087050 deletions
+3
View File
@@ -0,0 +1,3 @@
--errors=errors,duplicate-properties
--warnings=known-properties,display-property-grouping,empty-rules,important
--exclude-list=vendor/,lib/editor/tinymce/,lib/yuilib/,theme/bootstrapbase/style/
-185
View File
@@ -1,185 +0,0 @@
// 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/>.
/**
* Generates tsconfig.aliases.json for cross-component TypeScript imports.
*
* Moodle ESM source files can import from other components using the alias
* scheme @moodle/lms/<component>/* (e.g. @moodle/lms/core/SomeUtil). This
* file reads the Moodle component registry (.grunt/components.js), finds every
* component that has a js/esm/src/ directory, and writes the corresponding
* TypeScript path mappings to tsconfig.aliases.json.
*
* tsconfig.json extends tsconfig.aliases.json, so TypeScript picks up the
* mappings automatically. The file is skipped if its content is unchanged, to
* avoid unnecessary rebuilds.
*
* This must run before esbuild compilation. The Grunt `jsconfig` task calls
* generateAliases() so that both jsconfig.json and tsconfig.aliases.json are
* kept in sync. The `react` task depends on `jsconfig`, so aliases are always
* up to date before a React build.
*
* @copyright 2026 Adrian Greeve <adrian@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
import fs from "fs";
import path from "path";
import { createRequire } from "module";
const rootDir = process.cwd();
const tsconfigOut = path.join(rootDir, "tsconfig.aliases.json");
const TS_ALIASES_WARNING =
"// WARNING: Do not edit this file manually. It is generated by `grunt jsconfig`.\n";
/**
* Load Moodle component paths from `.grunt/components.js`.
*
* @returns {Record<string, string>} Map of component paths to component names.
*/
function loadComponentPathMap() {
const require = createRequire(import.meta.url);
// Load Moodle's components data from .grunt/components.js.
const { fetchComponentData } = require(
path.join(process.cwd(), ".grunt", "components.js")
);
// Format: `{ components: { "public/lib": "core", ... } }`.
const componentsData = fetchComponentData().components;
// Expected:
// `{ "public/lib": "core", "public/ai": "core_ai", ... }`.
return componentsData;
}
/**
* Compare two TypeScript `paths` maps for exact equality.
*
* @param {Record<string, string[]>} a First paths map.
* @param {Record<string, string[]>} b Second paths map.
* @returns {boolean} True when keys and values match in order.
*/
function pathsEqual(a, b) {
const aKeys = Object.keys(a);
const bKeys = Object.keys(b);
if (aKeys.length !== bKeys.length) {
return false;
}
for (const key of aKeys) {
if (!Object.prototype.hasOwnProperty.call(b, key)) {
return false;
}
const aArr = a[key] ?? [];
const bArr = b[key] ?? [];
if (aArr.length !== bArr.length) {
return false;
}
for (let i = 0; i < aArr.length; i++) {
if (aArr[i] !== bArr[i]) {
return false;
}
}
}
return true;
}
/**
* Parse JSON content and tolerate line comments.
*
* @param {string} content Raw JSON/JSONC file content.
* @returns {unknown}
*/
function parseJsonWithComments(content) {
const stripped = content
.replace(/^\uFEFF/, "")
.replace(/^\s*\/\/.*$/gm, "");
return JSON.parse(stripped);
}
/**
* Convert JSON output so single-value arrays are rendered on one line.
*
* @param {unknown} obj Data to stringify.
* @returns {string} JSON string with flattened single-value arrays.
*/
function stringifyFlatArrays(obj) {
const json = JSON.stringify(obj, null, 2);
return TS_ALIASES_WARNING + json.replace(/\[\s+\"(.*?)\"\s+\]/g, '["$1"]') + "\n";
}
/**
* Generate `tsconfig.aliases.json` from Moodle component metadata.
*
* Includes core aliases, discovers plugin React source aliases, and skips
* rewriting when aliases have not changed.
*
* @returns {void}
*/
export function generateAliases() {
const componentPathMap = loadComponentPathMap();
// Build TS paths for tsconfig.aliases.json
/** @type {Record<string, string[]>} */
const tsPaths = {
// Always include core alias.
"@moodle/lms/core/*": ["./public/lib/js/esm/src/*"],
};
for (const [componentPath, componentName] of Object.entries(componentPathMap)) {
const runtimeAliasKey = `@moodle/lms/${componentName}/*`;
const targetPattern = `./${path
.join(componentPath, "js", "esm", "src", "*")
.replace(/\\/g, "/")}`;
tsPaths[runtimeAliasKey] = [targetPattern];
}
const tsconfig = {
compilerOptions: { paths: tsPaths },
};
// If tsconfig paths didn't change, skip regeneration
let previousPaths = null;
let hasWarningHeader = false;
if (fs.existsSync(tsconfigOut)) {
try {
const previousContent = fs.readFileSync(tsconfigOut, "utf8");
hasWarningHeader = previousContent.startsWith(TS_ALIASES_WARNING);
const previousTsconfig = /** @type {{compilerOptions?: {paths?: Record<string, string[]>}}} */ (
parseJsonWithComments(previousContent)
);
previousPaths = previousTsconfig.compilerOptions?.paths ?? {};
} catch {
// ignore parse errors and treat as "no previous cache"
previousPaths = null;
}
}
if (previousPaths && hasWarningHeader && pathsEqual(previousPaths, tsPaths)) {
console.log("✓ Generating tsconfig.aliases.json was skipped. No alias modifications detected.");
return;
}
// Write tsconfig.aliases.json
fs.writeFileSync(tsconfigOut, stringifyFlatArrays(tsconfig));
console.log("✓ Generating tsconfig.aliases.json");
}
-324
View File
@@ -1,324 +0,0 @@
// 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/>.
/**
* Core esbuild library for Moodle ESM components.
*
* This is the single source of all build logic. The Grunt tasks
* (.grunt/tasks/react.js) import from here rather than duplicating
* configuration or build steps.
*
* Source layout convention:
* <component>/js/esm/src/**\/*.{ts,tsx} → <component>/js/esm/build/**\/*.js
*
* Exports:
* createBuildConfig(isDev) esbuild config object; pass isDev=true
* to disable minification / add sourcemaps.
* buildPluginComponents(isDev) Glob for every js/esm/src tree across
* core and plugins, compile all in parallel.
* buildSingleFile(filePath, isDev) Compile one source file; used by the
* Grunt watch task on incremental changes.
* watchComponents(isDev) Start esbuild's native watch mode so the
* compiler rebuilds affected files on save.
* resolveComponentPaths(entry) Map an absolute source path to its
* relative input path and output path.
*
* @copyright 2026 Adrian Greeve <adrian@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
import esbuild from "esbuild";
import { glob } from "glob";
import chalk from "chalk";
import path from "path";
import fs from "fs";
const projectRoot = process.cwd();
/**
* Resolve a path from the current project root.
*
* @param {...string} segments Path segments to resolve.
* @returns {string} Absolute path from project root.
*/
const fromRoot = (...segments) => path.resolve(projectRoot, ...segments);
/**
* Create an incremental dot progress indicator.
* Prints one dot per completed build and wraps lines for readability.
*
* @param {number} total Total number of items to build.
* @returns {{ start: () => void, tick: () => void, succeed: (msg: string) => void, fail: (msg: string) => void }}
*/
function createDotProgress(total) {
const dotsPerLine = 60;
let printed = 0;
return {
start: () => {
process.stdout.write(`${chalk.cyan("Building")} `);
},
tick: () => {
printed++;
process.stdout.write(chalk.cyan("."));
if (printed % dotsPerLine === 0 && printed < total) {
process.stdout.write(` ${chalk.dim(`[${printed}/${total}]`)}\n`);
}
},
succeed: (msg) => {
process.stdout.write(` ${chalk.dim(`[${printed}/${total}]`)}\n`);
process.stdout.write(`${chalk.green("✓")} ${msg}\n`);
},
fail: (msg) => {
process.stdout.write(` ${chalk.dim(`[${printed}/${total}]`)}\n`);
process.stdout.write(`${chalk.red("✗")} ${msg}\n`);
},
};
}
/**
* Build a single React component entry file.
*
* @param {string} entry Absolute entry file path.
* @param {import('esbuild').BuildOptions} buildConfig Shared esbuild configuration.
* @returns {Promise<{file: string, output?: string, error: Error|null}>}
*/
async function buildComponent(entry, buildConfig) {
const resolved = resolveComponentPaths(entry);
if (!resolved) {
return { file: entry, error: new Error(`Unknown path pattern: ${entry}`) };
}
const { file, output } = resolved;
fs.mkdirSync(path.dirname(output), { recursive: true });
try {
await esbuild.build({
...buildConfig,
entryPoints: [entry],
outfile: output,
});
return { file, output, error: null };
} catch (error) {
return { file, error: error instanceof Error ? error : new Error(String(error)) };
}
}
/**
* Resolve source and output paths for a component entry.
*
* @param {string} entry Absolute component source path.
* @returns {{file: string, output: string} | null} Relative file info and output path, or null for unsupported paths.
*/
export function resolveComponentPaths(entry) {
const rel = path.relative(projectRoot, entry);
if (rel.includes(path.join('esm', 'src'))) {
const [part, rawFile] = rel.split(path.join('esm', 'src'));
const file = rawFile.replace(/^[\/\\]/, '');
return {
file,
output: fromRoot(part, 'esm', 'build', file.replace(/\.(ts|tsx)$/, '.js')),
};
}
return null;
}
/**
* Run all builds in parallel, showing incremental dot progress.
*
* @param {string[]} entryPoints Absolute entry file paths.
* @param {import('esbuild').BuildOptions} buildConfig Shared esbuild configuration.
* @returns {Promise<{errors: {file: string, output?: string, error: Error|null}[]}>}
*/
async function runParallelBuilds(entryPoints, buildConfig) {
const total = entryPoints.length;
/** @type {{file: string, output?: string, error: Error|null}[]} */
const errors = [];
const startTime = Date.now();
const progress = createDotProgress(total);
progress.start();
await Promise.all(entryPoints.map(async (entry) => {
const result = await buildComponent(entry, buildConfig);
if (result.error) {
errors.push(result);
}
progress.tick();
}));
const elapsed = ((Date.now() - startTime) / 1000).toFixed(1);
const succeeded = total - errors.length;
if (errors.length > 0) {
progress.fail(`${succeeded}/${total} built · ${elapsed}s`);
for (const e of errors) {
console.error(chalk.red(`${e.file}: ${e.error?.message ?? ''}`));
}
} else {
progress.succeed(chalk.bold(`${total} components built`) + chalk.dim(` · ${elapsed}s`));
}
return { errors };
}
/**
* Create the shared esbuild build configuration.
*
* @param {boolean} isDev Whether development mode is enabled.
* @returns {import('esbuild').BuildOptions} esbuild configuration object.
*/
export function createBuildConfig(isDev) {
return {
bundle: true,
format: "esm",
external: ["react", "react/*", "react-dom", "react-dom/*", "@moodlehq/design-system", "@moodlehq/design-system/*", "@moodle/lms", "@moodle/lms/*"],
jsx: "automatic",
minify: !isDev,
sourcemap: isDev ? 'inline' : false,
jsxDev: isDev,
keepNames: isDev,
treeShaking: !isDev,
define: { 'process.env.NODE_ENV': isDev ? '"development"' : '"production"' },
};
}
/**
* Build all plugin and core React components.
*
* @param {boolean} isDev Whether development mode is enabled.
* @returns {Promise<void>}
*/
export async function buildPluginComponents(isDev) {
console.log(chalk.green('> Building components...'));
const entryPoints = glob.sync("**/js/esm/src/**/*.{ts,tsx}", {
cwd: projectRoot,
absolute: true,
ignore: [
`${process.cwd()}/node_modules/**`,
`${process.cwd()}/vendor/**`,
],
});
const buildConfig = createBuildConfig(isDev);
const { errors } = await runParallelBuilds(entryPoints, buildConfig);
if (errors.length > 0) {
throw new Error(`React build failed: ${errors.length} component(s) could not be built`);
}
}
/**
* Start esbuild in native watch mode over all React components.
*
* Creates a single incremental build context for all entry points so that
* esbuild can reuse its internal graph between rebuilds instead of starting
* from scratch on every file change.
*
* @param {boolean} isDev Whether to build in development mode.
* @param {((srcFiles: string[]) => void) | undefined} [onRebuild] Called with the rebuilt entry source
* files (relative to project root) after each non-initial successful rebuild. Use this to run
* follow-up tasks such as linting without coupling them to this module.
* @returns {Promise<import('esbuild').BuildContext|null>} The active context, or null if no source files exist.
*/
export async function watchComponents(isDev, onRebuild) {
const entryPoints = glob.sync("**/js/esm/src/**/*.{ts,tsx}", {
cwd: projectRoot,
absolute: true,
ignore: [
`${process.cwd()}/node_modules/**`,
`${process.cwd()}/vendor/**`,
],
});
if (entryPoints.length === 0) {
return null;
}
const buildConfig = createBuildConfig(isDev);
// Map each source file to an {in, out} pair so esbuild can write each
// component to its custom output directory while sharing a single context.
// The 'out' path is relative to outdir (projectRoot) and has no extension —
// esbuild appends the appropriate extension automatically.
// Build entry pairs and ensure output directories exist in a single pass.
const entryPairs = entryPoints.flatMap(entry => {
const resolved = resolveComponentPaths(entry);
if (!resolved) {
return [];
}
fs.mkdirSync(path.dirname(resolved.output), { recursive: true });
return [{ in: entry, out: path.relative(projectRoot, resolved.output).replace(/\.js$/, '') }];
});
// Report build results to the terminal after every build (initial and on each change).
// metafile: true populates result.metafile.outputs so we know which files were written.
// On a rebuild only the affected outputs appear, so it effectively names the changed file.
/** @type {import('esbuild').Plugin} */
const watchReporter = {
name: 'watch-reporter',
setup(build) {
let isInitial = true;
let startTime = 0;
build.onStart(() => {
startTime = Date.now();
});
build.onEnd(result => {
const now = new Date().toLocaleTimeString();
const elapsed = ((Date.now() - startTime) / 1000).toFixed(1);
if (result.errors.length > 0) {
console.error(chalk.red(`[${now}] ✗ Build failed (${result.errors.length} error(s))`) + chalk.dim(` · ${elapsed}s`));
return;
}
const outputs = Object.keys(result.metafile?.outputs ?? {});
console.log(chalk.green(`[${now}] ✓ ${outputs.length} component(s) built`) + chalk.dim(` · ${elapsed}s`));
if (isInitial) {
isInitial = false;
} else if (onRebuild) {
// entryPoint is the source file (relative to projectRoot) that triggered
// this rebuild. Pass it to the caller so they can run follow-up tasks
// (e.g. linting) without this module needing to know about them.
const srcFiles = Object.values(result.metafile?.outputs ?? {})
.map(output => output.entryPoint)
.filter(/** @param {string|undefined} f */ f => !!f);
onRebuild(/** @type {string[]} */ (srcFiles));
}
});
},
};
const ctx = await esbuild.context({
...buildConfig,
entryPoints: entryPairs,
outdir: projectRoot,
metafile: true,
plugins: [watchReporter],
});
await ctx.watch();
return ctx;
}
-266
View File
@@ -1,266 +0,0 @@
{
'plugins': [
'@babel',
'promise',
'jsdoc'
],
'extends': [
'eslint:recommended',
'plugin:promise/recommended'
],
'env': {
'browser': true,
// Enable ES6+ features by default.
// See http://eslint.org/docs/user-guide/configuring#specifying-environments
// Note: The YUI override must exactly match this when disabling the ES6+ version because those features are not supported by Shifter.
'es2020': true,
'amd': true
},
'globals': {
'M': true,
'Y': true
},
// Warn about unused eslint-disable statements.
'reportUnusedDisableDirectives': true,
'rules': {
// See http://eslint.org/docs/rules/ for all rules and explanations of all
// rules.
// === Possible Errors ===
'comma-dangle': 'off',
'no-console': 'error',
'no-empty': 'warn',
'no-extra-parens': 'off',
'no-prototype-builtins': 'off',
'no-unreachable': 'warn',
// === Best Practices ===
// (these mostly match our jshint config)
'array-callback-return': 'warn',
'block-scoped-var': 'warn',
'complexity': 'warn',
'consistent-return': 'warn',
'curly': 'error',
'dot-notation': 'warn',
'no-alert': 'warn',
'no-caller': 'error',
'no-div-regex': 'error',
'no-empty-function': 'warn',
'no-eq-null': 'error',
'no-eval': 'error',
'no-extend-native': 'error',
'no-extra-bind': 'warn',
'no-floating-decimal': 'warn',
'no-global-assign': 'warn',
'no-implied-eval': 'error',
'no-invalid-this': 'error',
'no-iterator': 'error',
'no-labels': 'error',
'no-loop-func': 'error',
'no-multi-spaces': 'warn',
'no-multi-str': 'error',
'no-new-func': 'error',
'no-new-wrappers': 'error',
'no-octal-escape': 'error',
'no-proto': 'error',
'no-redeclare': 'warn',
'no-restricted-globals': ['error', { 'name': 'Notification' }],
'no-return-assign': 'error',
'no-script-url': 'error',
'no-self-compare': 'error',
'no-sequences': 'warn',
'no-throw-literal': 'warn',
'no-unmodified-loop-condition': 'error',
'no-unused-expressions': 'error',
'no-useless-call': 'warn',
'no-useless-escape': 'warn',
'wrap-iife': ['error', 'any'],
// === Variables ===
'no-undef-init': 'error',
'no-unused-vars': ['error', { 'caughtErrors': 'none' }],
// === Stylistic Issues ===
'array-bracket-spacing': 'warn',
'block-spacing': 'warn',
'brace-style': ['warn', '1tbs'],
'camelcase': 'warn',
'capitalized-comments': ['warn', 'always', { 'ignoreConsecutiveComments': true }],
'comma-spacing': ['warn', { 'before': false, 'after': true }],
'comma-style': ['warn', 'last'],
'computed-property-spacing': 'error',
'consistent-this': 'off',
'eol-last': 'off',
'func-call-spacing': ['warn', 'never'],
'func-names': 'off',
'func-style': 'off',
// indent currently not doing well with our wrapping style, so disabled.
'indent': ['off', 4, { 'SwitchCase': 1 }],
'key-spacing': ['warn', { 'beforeColon': false, 'afterColon': true, 'mode': minimum }],
'keyword-spacing': 'warn',
'linebreak-style': ['error', 'unix'],
'lines-around-comment': 'off',
'max-len': ['error', 132],
'max-lines': 'off',
'max-depth': 'warn',
'max-nested-callbacks': ['warn', 5],
'max-params': 'off',
'max-statements': 'off',
'max-statements-per-line': ['warn', { max: 2 }],
'new-cap': ['warn', { 'properties': false }],
'new-parens': 'warn',
'newline-per-chained-call': 'off',
'no-array-constructor': 'off',
'no-bitwise': 'error',
'no-continue': 'off',
'no-inline-comments': 'off',
'no-lonely-if': 'off',
'no-mixed-operators': 'off',
'no-multiple-empty-lines': 'warn',
'no-negated-condition': 'off',
'no-nested-ternary': 'warn',
'no-new-object': 'off',
'no-plusplus': 'off',
'no-tabs': 'error',
'no-ternary': 'off',
'no-trailing-spaces': 'error',
'no-underscore-dangle': 'off',
'no-unneeded-ternary': 'off',
'no-whitespace-before-property': 'warn',
'object-curly-newline': 'off',
'object-curly-spacing': 'warn',
'object-property-newline': 'off',
'one-var': 'off',
'one-var-declaration-per-line': ['warn', 'initializations'],
'operator-assignment': 'off',
'operator-linebreak': 'off',
'padded-blocks': 'off',
'quote-props': ['warn', 'as-needed', {'unnecessary': false, 'keywords': true, 'numbers': true}],
'quotes': 'off',
'semi': 'error',
'semi-spacing': ['warn', {'before': false, 'after': true}],
'sort-vars': 'off',
'space-before-blocks': 'warn',
'space-before-function-paren': ['warn', 'never'],
'space-in-parens': 'warn',
'space-infix-ops': 'warn',
'space-unary-ops': 'warn',
'spaced-comment': 'warn',
'unicode-bom': 'error',
'wrap-regex': 'off',
// === Promises (override plugin:promise/recommended) ===
'promise/always-return': 'warn',
'promise/no-return-wrap': 'warn',
'promise/param-names': 'warn',
'promise/catch-or-return': ['warn', {terminationMethod: ['catch', 'fail', 'always'], allowFinally: true}],
'promise/no-native': 'warn',
'promise/avoid-new': 'warn',
// === Deprecations ===
"no-restricted-properties": ['warn', {
'object': 'M',
'property': 'str',
'message': 'Use "core/str" module or M.util.get_string()'
}],
},
overrides: [
{
files: ["**/yui/src/**/*.js"],
'env': {
// Disable ES6+ for YUI files.
'es2020': false,
},
// Disable some rules which we can't safely define for YUI rollups.
rules: {
'no-undef': 'off',
'no-unused-vars': 'off',
'no-unused-expressions': 'off',
// === JSDocs ===
"jsdoc/check-access": 'off',
"jsdoc/check-alignment": 'off',
"jsdoc/check-param-names": 'off',
"jsdoc/check-property-names": 'off',
"jsdoc/empty-tags": 'off',
"jsdoc/implements-on-classes": 'off',
"jsdoc/multiline-blocks": 'off',
"jsdoc/require-jsdoc": 'off',
"jsdoc/require-param": 'off',
"jsdoc/require-param-name": 'off',
"jsdoc/require-param-type": 'off',
"jsdoc/require-property": 'off',
"jsdoc/require-property-name": 'off',
"jsdoc/require-property-type": 'off',
}
},
{
files: ["**/amd/src/*.js", "**/amd/src/**/*.js", "Gruntfile.js", ".grunt/*.js", ".grunt/tasks/*.js", "jsdoc.conf.js"],
// We're using babel transpiling so use their parser
// for linting.
parser: '@babel/eslint-parser',
// Check AMD with some slightly stricter rules.
rules: {
'no-implicit-globals': 'error',
// Disable all of the rules that have babel versions.
'new-cap': 'off',
// Not using this rule for the time being because it isn't
// compatible with jQuery and ES6.
'no-invalid-this': 'off',
'object-curly-spacing': 'off',
'quotes': 'off',
'semi': 'off',
'no-unused-expressions': 'off',
// Enable all of the babel version of these rules.
'@babel/new-cap': ['warn', { 'properties': false }],
// Not using this rule for the time being because it isn't
// compatible with jQuery and ES6.
'@babel/no-invalid-this': 'off',
'@babel/object-curly-spacing': 'warn',
'@babel/semi': 'error',
'@babel/no-unused-expressions': 'error',
// === Promises ===
// We have Promise now that we're using ES6.
'promise/no-native': 'off',
'promise/avoid-new': 'off',
// === JSDocs ===
'jsdoc/check-access': 'error',
'jsdoc/check-alignment': 1, // Recommended.
'jsdoc/check-param-names': 'error',
'jsdoc/check-property-names': 'error',
'jsdoc/empty-tags': 'error',
'jsdoc/implements-on-classes': 'error',
'jsdoc/multiline-blocks': 'error',
'jsdoc/require-jsdoc': 'error',
'jsdoc/require-param': 'error',
'jsdoc/require-param-name': 'error',
'jsdoc/require-param-type': 'error',
'jsdoc/require-property': 'error',
'jsdoc/require-property-name': 'error',
'jsdoc/require-property-type': 'error'
},
parserOptions: {
'sourceType': 'module',
'requireConfigFile': false
}
},
{
files: ["**/*.ts", "**/*.tsx"],
parser: '@typescript-eslint/parser',
parserOptions: {
sourceType: 'module',
ecmaFeatures: {
jsx: true
},
allowSyntheticDefaultImports: true
},
rules: {
// promise/no-native crashes on TypeScript ASTs (same reason it is
// disabled for AMD files above). Native Promises are standard in TS.
'promise/no-native': 'off',
'promise/avoid-new': 'off',
}
}
]
}
-24
View File
@@ -1,24 +0,0 @@
{
"indentation": ["on",{
"Feature": 0,
"Background": 2,
"Scenario": 2,
"Examples": 4,
"example": 6,
"Step": 4,
"given": 4,
"and": 4
}],
"no-dupe-feature-names": "on",
"no-dupe-scenario-names": "off",
"no-empty-file": "on",
"no-files-without-scenarios": "on",
"no-multiple-empty-lines": "on",
"no-partially-commented-tag-lines": "on",
"no-trailing-spaces": "on",
"no-unnamed-features": "on",
"no-unnamed-scenarios": "on",
"no-scenario-outlines-without-examples": "on",
"no-examples-in-scenarios": "on",
"new-line-at-eof": ["on", "yes"]
}
-9
View File
@@ -1,9 +0,0 @@
**/yui/build/** -diff
**/amd/build/** -diff
**.js.map -diff
**-min.js -diff
**.min.js -diff
# Remove composer lock file changes from standard diff views.
/composer.lock -diff
/lib/js/bundles/*/*.js -diff
-2
View File
@@ -1,2 +0,0 @@
# Primary donations pages.
custom: ["https://moodle.com/donations/"]
-7
View File
@@ -1,7 +0,0 @@
*** PLEASE DO NOT OPEN PULL REQUESTS VIA GITHUB ***
The moodle.git repository at Github is just a mirror of the official repository. We do not accept pull requests at Github.
See CONTRIBUTING.md guidelines for how to contribute patches for Moodle. Thank you.
--
-6
View File
@@ -1,6 +0,0 @@
> [!IMPORTANT]
> PLEASE DO NOT PUBLISH SECURITY FINDINGS PUBLICLY.
If you discover a potential security issue, please report it via our [Security Submission Form](https://moodle.org/security/report).
For more information about our security processes and responsible disclosure policy, see the [Security Procedures documentation](https://moodledev.io/general/development/process/security).
-1
View File
@@ -1 +0,0 @@
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1231.24 314.44" preserveAspectRatio="xMinYMid meet"><defs><style>.cls-1{fill:#f48020;}.cls-2,.cls-3{fill:#383738;stroke:#4a4a4c;}.cls-2{stroke-width:2.37px;}.cls-3{stroke-width:2.38px;}.cls-4{fill:#585858;}</style></defs><title>Moodle_Logo_UseonBlack_RGB</title><path class="cls-1" d="M1086.3,235.34a53.42,53.42,0,0,0,16.71,29q13.26,12.27,29.48,12.27,11.29,0,24.56-5.89,16.23-6.88,16.22-16.22l58-.49q-12.29,29-41.76,45.2-27.52,15.23-60.43,15.24-42.25,0-70-26.29t-27.75-68.54q0-43.73,27.75-69.51t72-25.8q48.15,0,75.17,31.94,25.07,29.47,25.06,79.1Zm89.91-33.91q-3.43-17.69-14.73-29-12.8-12.28-29.49-12.29-17.21,0-28.74,11.79t-15.47,29.48Z"/><path class="cls-1" d="M965.45,308.54V0h55V308.54Z"/><path class="cls-1" d="M892.69,308.54V290.36q-7.38,9.83-25.06,15.72a92.31,92.31,0,0,1-30,5.41q-39.31,0-63.13-27T750.7,217.65q0-39.3,23.34-65.84t62.15-26.53q43.71,0,56.5,23.58V0h53.55V308.54Zm0-102.68q0-14.75-14-28.26t-28.74-13.51q-21.12,0-33.41,17.2-10.8,15.24-10.8,37.33,0,21.63,10.8,36.85,12.29,17.71,33.41,17.69,12.78,0,27.76-12t15-24.81Z"/><path class="cls-1" d="M647,313.45q-41.77,0-69-26.53t-27.27-68.3q0-41.73,27.27-68.28t69-26.53q41.75,0,69.27,26.53t27.52,68.28q0,41.79-27.52,68.3T647,313.45ZM647,168q-19.89,0-30.58,15.07t-10.68,35.79q0,20.73,9.94,35.05,11.43,16.31,31.32,16.28t31.32-16.28q10.44-14.31,10.44-35.05t-9.94-35Q667.42,168,647,168Z"/><path class="cls-1" d="M448.07,313.45q-41.76,0-69-26.53t-27.27-68.3q0-41.73,27.27-68.28t69-26.53q41.74,0,69.28,26.53t27.5,68.28q0,41.79-27.5,68.3T448.07,313.45Zm0-145.43q-19.89,0-30.59,15.07t-10.69,35.79q0,20.73,9.94,35.05,11.43,16.31,31.34,16.28t31.32-16.28q10.42-14.31,10.44-35.05t-9.94-35Q468.45,168,448.07,168Z"/><path class="cls-1" d="M288.89,309.11V201q0-33.9-28-33.9t-28,33.9V309.11h-55V201q0-33.9-27.52-33.9-28,0-28,33.9V309.11h-55V194.65q0-35.37,24.56-53.54,21.61-16.22,58.46-16.22,37.35,0,55,19.16,15.23-19.16,55.51-19.16,36.86,0,58.45,16.22,24.57,18.16,24.57,53.54V309.11Z"/><path class="cls-2" d="M.76,145.76"/><path class="cls-3" d="M1.73,145.32"/><path class="cls-4" d="M173.86,116.85l55.08-40.1-.7-2.44C135,83.92,80.42,96.44,0,144.13l.73,2.38,21-.67c15.17.52,30.85,1.26,46,1.32-1,24.09.83,32.65.83,32.65,51.92,17.58,101.22,1.53,127.14-43.9A248.72,248.72,0,0,0,173.86,116.85Z"/><path class="cls-4" d="M113.78,110c-.3-1.08-2.23-1.48-4.28-.9a4.73,4.73,0,0,0-3.14,2.19c-18.53,5-49.16,13.72-70.73,21l-1.33.45c-16.68,5.61-24.73,8.49-25.22,12.55-2.29,18.44-.87,42.18-.86,42.48l.19,6.4c-9.74,27.56.06,49.6,8.38,69.77.06-24.92,1.07-45.22-6-71-.2-3.82-1.49-30.36.61-47.34.34-2.75,11.65-6.56,23.63-10.59l1.33-.44c22-7.42,53.57-16.39,71.9-21.29a6.75,6.75,0,0,0,2.29-.25C112.64,112.43,114.08,111.09,113.78,110Z"/></svg>

Before

Width:  |  Height:  |  Size: 2.7 KiB

-31
View File
@@ -1,31 +0,0 @@
name: 'Close Pull Requests'
on:
pull_request_target:
types: opened
workflow_dispatch:
jobs:
close:
# Avoid forks to run this job
if: github.repository_owner == 'moodle'
name: Close Pull Requests
runs-on: ubuntu-latest
steps:
- uses: dessant/repo-lockdown@v4
with:
process-only: prs
close-pr: true
skip-closed-pr-comment: true
pr-comment: >
**Please, don't open pull requests via GitHub.**
This repository (moodle.git) at GitHub is just a mirror of the official Moodle repository.
For how to contribute patches for Moodle see
[CONTRIBUTING.md](https://github.com/moodle/moodle/blob/main/CONTRIBUTING.md).
Closing this pull request.
-118
View File
@@ -1,118 +0,0 @@
name: Run tests in a Composed Moodle Setup
on:
push:
branches-ignore:
- main
- MOODLE_[0-9]+_STABLE
tags-ignore:
- v[0-9]+.[0-9]+.[0-9]+*
workflow_dispatch:
inputs:
phpunit_extra_options:
description: Additional options to apply to PHPUnit
required: false
default: ''
env:
php: 8.4
jobs:
PHPUnit:
runs-on: ${{ matrix.os }}
services:
exttests:
image: moodlehq/moodle-exttests
ports:
- 8080:80
redis:
image: redis
ports:
- 6379:6379
postgres:
image: ${{ matrix.db == 'pgsql' && 'postgres:16' || '' }}
env:
POSTGRES_DB: test
POSTGRES_USER: test
POSTGRES_PASSWORD: test
ports:
- 5432:5432
strategy:
fail-fast: false
matrix:
include:
# MySQL builds always run with the lowest PHP supported version.
- os: ubuntu-24.04
php: 8.3
extensions:
db: mysqli
# PostgreSQL builds always run with the highest PHP supported version.
- os: ubuntu-24.04
php: 8.4
db: pgsql
steps:
- name: Run MySQL Server
if: ${{ matrix.db == 'mysqli' }}
run: |
docker run --rm \
-e MYSQL_DATABASE=test \
-e MYSQL_USER=test \
-e MYSQL_PASSWORD=test \
-e MYSQL_ROOT_PASSWORD=test \
-p 3306:3306 \
-d \
--tmpfs /var/lib/mysql:rw,noexec,nosuid,size=1024M \
mysql:8.4 \
--skip-log-bin \
--collation-server=utf8mb4_bin
- name: Configuring git vars
uses: rlespinasse/github-slug-action@v5
- name: Setting up PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ matrix.extensions }}
ini-values: max_input_vars=5000
coverage: none
tools: composer
- name: Checking out code from ${{ env.GITHUB_REF_SLUG }}
uses: actions/checkout@v6
with:
path: 'moodle'
- name: 'Preparing the environment'
run: |
echo "pathtophp=$(which php)" >> $GITHUB_ENV # Inject installed pathtophp to env. The template config needs it.
sudo locale-gen en_AU.UTF-8
- name: Create the new Composer Project
run: |
mkdir testsite
cp moodle/.github/workflows/composed/composer.json testsite/composer.json
cp moodle/.github/workflows/composed/config.php testsite/config.php
mkdir -p testsite/data/moodledata
mkdir -p testsite/data/phpunitdata
- name: Install the Moodle test site
working-directory: testsite
run: |
composer install --no-interaction
- name: Setting up PHPUnit
working-directory: testsite
env:
dbtype: ${{ matrix.db }}
run: |
php moodle/public/admin/tool/phpunit/cli/init.php --no-composer-self-update
- name: Running PHPUnit tests
working-directory: testsite
env:
dbtype: ${{ matrix.db }}
phpunit_options: ${{ secrets.phpunit_options }}
run: |
vendor/bin/phpunit $phpunit_options ${{ inputs.phpunit_extra_options }}
-25
View File
@@ -1,25 +0,0 @@
{
"type": "project",
"require": {
"moodle/composer-installer": "^1",
"moodle/moodle-composer-scaffold": "^1",
"moodle/moodle": "@dev",
"moodle/moodle-testing": "^1.0"
},
"repositories": [
{
"name": "moodleundertest",
"type": "path",
"url": "../moodle"
}
],
"config": {
"audit": {
"block-insecure": false
},
"allow-plugins": {
"moodle/composer-installer": true,
"moodle/moodle-composer-scaffold": true
}
}
}
-67
View File
@@ -1,67 +0,0 @@
<?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/>.
/**
* Template configuraton file for GitHub Actions CI/CD using Composer.
*
* @package core
* @copyright 2020 onwards Eloy Lafuente (stronk7) {@link https://stronk7.com}
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
// This cannot be used out from a GitHub Actions workflow, so just exit.
getenv('GITHUB_WORKFLOW') || die; // phpcs:ignore moodle.Files.MoodleInternal.MoodleInternalGlobalState
unset($CFG);
global $CFG;
$CFG = new stdClass();
$CFG->dbtype = getenv('dbtype');
$CFG->dblibrary = 'native';
$CFG->dbhost = '127.0.0.1';
$CFG->dbname = 'test';
$CFG->dbuser = 'test';
$CFG->dbpass = 'test';
$CFG->prefix = 'm_';
$CFG->dboptions = ['dbcollation' => 'utf8mb4_bin'];
$host = 'localhost';
$CFG->wwwroot = "http://{$host}";
$CFG->dataroot = __DIR__ . '/data/moodledata';
$CFG->admin = 'admin';
$CFG->directorypermissions = 0777;
// Debug options - possible to be controlled by flag in future.
$CFG->debug = (E_ALL); // DEBUG_DEVELOPER.
$CFG->debugdisplay = 1;
$CFG->debugstringids = 1; // Add strings=1 to url to get string ids.
$CFG->perfdebug = 15;
$CFG->debugpageinfo = 1;
$CFG->allowthemechangeonurl = 1;
$CFG->passwordpolicy = 0;
$CFG->cronclionly = 0;
$CFG->pathtophp = getenv('pathtophp');
$CFG->phpunit_dataroot = __DIR__ . '/data/phpunitdata';
$CFG->phpunit_prefix = 't_';
$CFG->routerconfigured = true;
define('TEST_EXTERNAL_FILES_HTTP_URL', 'http://localhost:8080');
define('TEST_EXTERNAL_FILES_HTTPS_URL', 'http://localhost:8080');
define('TEST_SESSION_REDIS_HOST', 'localhost');
define('TEST_CACHESTORE_REDIS_TESTSERVERS', 'localhost');
-73
View File
@@ -1,73 +0,0 @@
<?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/>.
/**
* Template configuraton file for github actions CI/CD.
*
* @package core
* @copyright 2020 onwards Eloy Lafuente (stronk7) {@link https://stronk7.com}
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
// This cannot be used out from a github actions workflow, so just exit.
getenv('GITHUB_WORKFLOW') || die; // phpcs:ignore moodle.Files.MoodleInternal.MoodleInternalGlobalState
unset($CFG);
global $CFG;
$CFG = new stdClass();
$CFG->dbtype = getenv('dbtype');
$CFG->dblibrary = 'native';
$CFG->dbhost = '127.0.0.1';
$CFG->dbname = 'test';
$CFG->dbuser = 'test';
$CFG->dbpass = 'test';
$CFG->prefix = 'm_';
$CFG->dboptions = ['dbcollation' => 'utf8mb4_bin'];
$host = 'localhost';
$CFG->wwwroot = "http://{$host}";
$CFG->dataroot = realpath(dirname(__DIR__)) . '/moodledata';
$CFG->admin = 'admin';
$CFG->directorypermissions = 0777;
// Debug options - possible to be controlled by flag in future.
$CFG->debug = (E_ALL); // DEBUG_DEVELOPER.
$CFG->debugdisplay = 1;
$CFG->debugstringids = 1; // Add strings=1 to url to get string ids.
$CFG->perfdebug = 15;
$CFG->debugpageinfo = 1;
$CFG->allowthemechangeonurl = 1;
$CFG->passwordpolicy = 0;
$CFG->cronclionly = 0;
$CFG->pathtophp = getenv('pathtophp');
$CFG->phpunit_dataroot = realpath(dirname(__DIR__)) . '/phpunitdata';
$CFG->phpunit_prefix = 't_';
$CFG->routerconfigured = true;
define('TEST_EXTERNAL_FILES_HTTP_URL', 'http://localhost:8080');
define('TEST_EXTERNAL_FILES_HTTPS_URL', 'http://localhost:8080');
define('TEST_SESSION_REDIS_HOST', 'localhost');
define('TEST_CACHESTORE_REDIS_TESTSERVERS', 'localhost');
// TODO: add others (solr, mongodb, memcached, ldap...).
// Too much for now: define('PHPUNIT_LONGTEST', true); // Only leaves a few tests out and they are run later by CI.
require_once(__DIR__ . '/lib/setup.php');
-143
View File
@@ -1,143 +0,0 @@
name: One by One Testing
# Run all the individual unit tests one by one, with
# fully independent PHPUnit executions. Useful to
# detect issues with some tests that are using stuff
# that has been made available by others, but is not
# available when running individually.
#
# Note that we aren't using PHPUnit's own isolation
# here but completely separated runs, one for each
# test.
#
# The workflow will fail reporting all the tests
# that have failed (and will pass if no failure is
# detected, of course).
#
# It's only executed via workflow dispatch (automated
# or manual), not by push/tag. And acceptd configuration
# of phpunit, specially useful to run it with PHPUnit's
# own isolation or any other option.
on:
workflow_dispatch:
inputs:
phpunit_extra_options:
description: Additional options to apply to PHPUnit
required: false
default: ''
env:
chunks: 7
jobs:
collect:
name: Collect individual unit tests
runs-on: ubuntu-latest
outputs:
matrix: ${{steps.individual-tests.outputs.matrix }}
steps:
- name: Checking out code
uses: actions/checkout@v4
- name: Looking for all individual tests
id: individual-tests
run: |
count=0 # Number of individual tests found.
while read -r testfile; do # For each test file.
while read -r testname; do # For each unit test in a file.
count=$((count + 1))
# Sent it to the correct chunk file.
chunk=$(((($count % $chunks)) + 1))
echo "$testname $testfile" >> ./chunk_$chunk.txt
done < <(grep "function test_" "${testfile}" | sed -r "s/^.*function (test_[a-zA-Z0-9_]+).*/\1/")
done < <(find . -name "*_test.php" -not -path "*/fixtures/*")
# Generate the matrix to run tests.
echo "matrix=$(ls -1 chunk_*.txt | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
echo "$count individual tests collected in $chunks files"
- name: Upload individual tests files
uses: actions/upload-artifact@v4
with:
name: individual_tests
path: chunk_*.txt
retention-days: 1
test:
name: Run tests
needs: collect
runs-on: ubuntu-latest
services:
exttests:
image: moodlehq/moodle-exttests
ports:
- 8080:80
redis:
image: redis
ports:
- 6379:6379
strategy:
fail-fast: false
matrix:
file: ${{ fromJson(needs.collect.outputs.matrix) }}
steps:
- name: Setting up DB pgsql
uses: m4nu56/postgresql-action@v1
with:
postgresql version: 16
postgresql db: test
postgresql user: test
postgresql password: test
- name: Setting up PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.4
ini-values: max_input_vars=5000
coverage: none
- name: Checking out code
uses: actions/checkout@v4
- name: Download individual test files
uses: actions/download-artifact@v4
with:
name: individual_tests # Make all the chunk files available for the next steps.
- name: Setting up PHPUnit
env:
dbtype: pgsql
run: |
echo "pathtophp=$(which php)" >> $GITHUB_ENV
cp .github/workflows/config-template.php config.php
mkdir ../moodledata
sudo locale-gen en_AU.UTF-8
php public/admin/tool/phpunit/cli/init.php --no-composer-self-update
- name: Run PHPUnit test (one by one)
env:
dbtype: pgsql
run: |
status=0
count=0
while read -r line; do # For each line in the chunk file
count=$((count + 1))
filter="${line% *}"
file="${line#* }"
# Run the individual unit test and report problems if needed to.
if ! php vendor/bin/phpunit \
--fail-on-empty-test-suite \
--fail-on-warning \
--fail-on-risky \
--filter "$filter" ${{ inputs.phpunit_extra_options }} \
"$file" >/dev/null 2>&1; then
if [ $status -eq 0 ]; then
echo "Problems found, list of PHPUnit commands failing:"
fi
echo "vendor/bin/phpunit --filter '${filter}' ${{ inputs.phpunit_extra_options }} $file"
status=$((status + 1))
fi
done < ${{ matrix.file }}
echo "Finished: $count individual tests executed, $status tests failed"
exit $status
-128
View File
@@ -1,128 +0,0 @@
name: Core
on:
push:
branches-ignore:
- main
- MOODLE_[0-9]+_STABLE
tags-ignore:
- v[0-9]+.[0-9]+.[0-9]+*
workflow_dispatch:
inputs:
phpunit_extra_options:
description: Additional options to apply to PHPUnit
required: false
default: ''
env:
php: 8.4
jobs:
Grunt:
runs-on: ubuntu-24.04
steps:
- name: Checking out code
uses: actions/checkout@v4
- name: Configuring node & npm
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Installing node stuff
run: npm install
- name: Running grunt
run: npx grunt
- name: Looking for uncommitted changes
# Add all files to the git index and then run diff --cached to see all changes.
# This ensures that we get the status of all files, including new files.
# We ignore npm-shrinkwrap.json to make the tasks immune to npm changes.
run: |
git add .
git reset -- npm-shrinkwrap.json
git diff --cached --exit-code
PHPUnit:
runs-on: ${{ matrix.os }}
services:
exttests:
image: moodlehq/moodle-exttests
ports:
- 8080:80
redis:
image: redis
ports:
- 6379:6379
postgres:
image: ${{ matrix.db == 'pgsql' && 'postgres:16' || '' }}
env:
POSTGRES_DB: test
POSTGRES_USER: test
POSTGRES_PASSWORD: test
ports:
- 5432:5432
strategy:
fail-fast: false
matrix:
include:
# MySQL builds always run with the lowest PHP supported version.
- os: ubuntu-24.04
php: 8.3
extensions:
db: mysqli
# PostgreSQL builds always run with the highest PHP supported version.
- os: ubuntu-24.04
php: 8.4
db: pgsql
steps:
- name: Run MySQL Server
if: ${{ matrix.db == 'mysqli' }}
run: |
docker run --rm \
-e MYSQL_DATABASE=test \
-e MYSQL_USER=test \
-e MYSQL_PASSWORD=test \
-e MYSQL_ROOT_PASSWORD=test \
-p 3306:3306 \
-d \
--tmpfs /var/lib/mysql:rw,noexec,nosuid,size=1024M \
mysql:8.4 \
--skip-log-bin \
--collation-server=utf8mb4_bin
- name: Configuring git vars
uses: rlespinasse/github-slug-action@v4
- name: Setting up PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ matrix.extensions }}
ini-values: max_input_vars=5000
coverage: none
- name: Checking out code from ${{ env.GITHUB_REF_SLUG }}
uses: actions/checkout@v4
- name: Setting up PHPUnit
env:
dbtype: ${{ matrix.db }}
run: |
echo "pathtophp=$(which php)" >> $GITHUB_ENV # Inject installed pathtophp to env. The template config needs it.
cp .github/workflows/config-template.php config.php
mkdir ../moodledata
sudo locale-gen en_AU.UTF-8
php public/admin/tool/phpunit/cli/init.php --no-composer-self-update
- name: Running PHPUnit tests
env:
dbtype: ${{ matrix.db }}
phpunit_options: ${{ secrets.phpunit_options }}
run: vendor/bin/phpunit $phpunit_options ${{ inputs.phpunit_extra_options }}
- name: Git status
run: git status
-23
View File
@@ -1,23 +0,0 @@
name: Web Installer Testing
on:
workflow_dispatch:
jobs:
InstallationTest:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
php: [8.3, 8.4]
steps:
- name: Construct repository URL
run: echo "REPOSITORY_URL=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}" >> $GITHUB_ENV
shell: bash
- uses: moodlehq/moodle-webinstaller-test@main
with:
repository: ${{ env.REPOSITORY_URL }}
branch: ${{ github.ref_name }}
php: ${{ matrix.php }}
-149
View File
@@ -1,149 +0,0 @@
name: Windows Testing
on:
workflow_dispatch:
inputs:
phpunit_extra_options:
description: Additional options to apply to PHPUnit
required: false
default: ''
env:
php: 8.4
jobs:
Grunt:
runs-on: windows-latest
steps:
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checking out code
uses: actions/checkout@v4
- name: Configuring node & npm
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Installing node stuff
run: npm ci
- name: Running grunt
run: npx grunt
- name: Looking for uncommitted changes
# Add all files to the git index and then run diff --cached to see all changes.
# This ensures that we get the status of all files, including new files.
# We ignore npm-shrinkwrap.json to make the tasks immune to npm changes.
run: |
git add .
git reset -- npm-shrinkwrap.json
git diff --cached --exit-code
PHPUnit:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
php: 8.4
# Ideally we should use mysql/mariadb, but they are 4x slower without tweaks and configuration
# so let's run only postgres (1.5h vs 6h) only, If some day we want to improve the mysql runs,
# this is the place to enable them.
# db: mysqli
db: pgsql
extensions: exif, fileinfo, gd, intl, pgsql, mysql, redis, soap, sodium, zip
- os: windows-latest
php: 8.3
db: pgsql
extensions: exif, fileinfo, gd, intl, pgsql, mysql, redis, soap, sodium, zip
steps:
- name: Setting up DB mysql
if: ${{ matrix.db == 'mysqli' }}
uses: shogo82148/actions-setup-mysql@v1
with:
mysql-version: 8.4
user: test
password: test
- name: Creating DB mysql
if: ${{ matrix.db == 'mysqli' }}
run: mysql --host 127.0.0.1 -utest -ptest -e 'CREATE DATABASE IF NOT EXISTS test COLLATE = utf8mb4_bin;';
- name: Setting up DB pgsql
if: ${{ matrix.db == 'pgsql' }}
run: |
# TODO: Remove these conf. modifications when php74 or php80 are lowest.
# Change to old md5 auth, because php73 does not support it.
# #password_encryption = scram-sha-256
(Get-Content "$env:PGDATA\postgresql.conf"). `
replace('#password_encryption = scram-sha-256', 'password_encryption = md5') | `
Set-Content "$env:PGDATA\postgresql.conf"
(Get-Content "$env:PGDATA\pg_hba.conf"). `
replace('scram-sha-256', 'md5') | `
Set-Content "$env:PGDATA\pg_hba.conf"
$pgService = Get-Service -Name postgresql*
Set-Service -InputObject $pgService -Status running -StartupType automatic
Start-Process -FilePath "$env:PGBIN\pg_isready" -Wait -PassThru
& $env:PGBIN\psql --command="CREATE USER test PASSWORD 'test'" --command="\du"
- name: Creating DB pgsql
if: ${{ matrix.db == 'pgsql' }}
run: |
& $env:PGBIN\createdb --owner=test test
$env:PGPASSWORD = 'test'
& $env:PGBIN\psql --username=test --host=localhost --list test
- name: Configuring git vars
uses: rlespinasse/github-slug-action@v4
- name: Setting up PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ matrix.extensions }}
ini-values: max_input_vars=5000
coverage: none
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checking out code from ${{ env.GITHUB_REF_SLUG }}
uses: actions/checkout@v4
# Needs to be done after php is available, git configured and Moodle checkout has happened.
- name: Setting up moodle-exttests service
run: |
git clone https://github.com/moodlehq/moodle-exttests.git
nssm install php-built-in C:\tools\php\php.exe -S localhost:8080 -t D:\a\moodle\moodle\moodle-exttests
nssm start php-built-in
- name: Setting up redis service
run: |
choco install redis --version 5.0.7 --no-progress
nssm install redis redis-server
nssm start redis
- name: Setting up PHPUnit
env:
dbtype: ${{ matrix.db }}
shell: bash
run: |
echo "pathtophp=$(which php)" >> $GITHUB_ENV # Inject installed pathtophp to env. The template config needs it.
cp .github/workflows/config-template.php config.php
mkdir ../moodledata
php public/admin/tool/phpunit/cli/init.php --no-composer-self-update
- name: Running PHPUnit tests
env:
dbtype: ${{ matrix.db }}
phpunit_options: ${{ secrets.phpunit_options }}
run: vendor/bin/phpunit $phpunit_options ${{ inputs.phpunit_extra_options }}
+7 -32
View File
@@ -9,26 +9,15 @@
#
# See gitignore(5) man page for more details
#
# Swap files (vim)
[._]*.s[a-v][a-z]
[._]*.sw[a-p]
[._]s[a-rt-v][a-z]
[._]ss[a-gi-z]
[._]sw[a-p]
# Temporary files including undo
*~
#
/config.php
/lib/editor/tinymce/extra/tools/temp/
*~
*.swp
/tags
/TAGS
/cscope.*
/.patches/
/.idea/
.phpstorm.*
!/.phpstorm.meta.php/
/.phpstorm.meta.php/*
!/.phpstorm.meta.php/di.php
/nbproject/
CVS
.DS_Store
@@ -36,28 +25,14 @@ CVS
/.project
/.buildpath
/.cache
.phpunit.result.cache
phpunit.xml
# Composer support. Do not ignore composer.json, or composer.lock. These should be shipped by us.
# Composer support - only composer.json is to be in git, the rest is installed in each checkout.
composer.phar
composer.lock
/vendor/
/behat.yml
*/yui/build/*/*-coverage.js
/public/lib/yuilib/*/build/*/*-coverage.js
/lib/yuilib/*/build/*/*-coverage.js
# lib/yuilib/version/module/module-coverage.js
/public/lib/yuilib/*/*/*-coverage.js
/lib/yuilib/*/*/*-coverage.js
atlassian-ide-plugin.xml
/node_modules/
/.vscode/
moodle-plugin-ci.phar
.eslintignore
.stylelintignore
/jsdoc
/public/admin/tool/componentlibrary/docs
/public/admin/tool/componentlibrary/hugo/site/data/my-index.json
.hugo_build.lock
phpcs.xml
jsconfig.json
UPGRADING-CURRENT.md
.phpunit.cache
tsconfig.aliases.json
-169
View File
@@ -1,169 +0,0 @@
// 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 is a babel plugin to add the Moodle module names to the AMD modules
* as part of the transpiling process.
*
* In addition it will also add a return statement for the default export if the
* module is using default exports. This is a highly specific Moodle thing because
* we're transpiling to AMD and none of the existing Babel 7 plugins work correctly.
*
* This will fix the issue where an ES6 module using "export default Foo" will be
* transpiled into an AMD module that returns {default: Foo}; Instead it will now
* just simply return Foo.
*
* Note: This means all other named exports in that module are ignored and won't be
* exported.
*
* @copyright 2018 Ryan Wyllie <ryan@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
"use strict";
/* eslint-env node */
module.exports = ({template, types}) => {
const fs = require('fs');
const path = require('path');
const cwd = process.cwd();
const ComponentList = require(path.join(process.cwd(), '.grunt', 'components.js'));
/**
* Search the list of components that match the given file name
* and return the Moodle component for that file, if found.
*
* Throw an exception if no matching component is found.
*
* @throws {Error}
* @param {string} searchFileName The file name to look for.
* @return {string} Moodle component
*/
function getModuleNameFromFileName(searchFileName) {
searchFileName = fs.realpathSync(searchFileName);
const relativeFileName = searchFileName.replace(`${cwd}${path.sep}`, '').replace(/\\/g, '/');
const [componentPath, file] = relativeFileName.split('/amd/src/');
const fileName = file.replace('.js', '');
// Check subsystems first which require an exact match.
const componentName = ComponentList.getComponentFromPath(componentPath);
if (componentName) {
return `${componentName}/${fileName}`;
}
// This matches the previous PHP behaviour that would throw an exception
// if it couldn't parse an AMD file.
throw new Error(`Unable to find module name for ${searchFileName} (${componentPath}::${file}}`);
}
/**
* This is heavily inspired by the babel-plugin-add-module-exports plugin.
* See: https://github.com/59naga/babel-plugin-add-module-exports
*
* This is used when we detect a module using "export default Foo;" to make
* sure the transpiled code just returns Foo directly rather than an object
* with the default property (i.e. {default: Foo}).
*
* Note: This means that we can't support modules that combine named exports
* with a default export.
*
* @param {String} path
* @param {String} exportObjectName
*/
function addModuleExportsDefaults(path, exportObjectName) {
const rootPath = path.findParent(path => {
return path.key === 'body' || !path.parentPath;
});
// HACK: `path.node.body.push` instead of path.pushContainer(due doesn't work in Plugin.post).
// This is hardcoded to work specifically with AMD.
rootPath.node.body.push(template(`return ${exportObjectName}.default`)());
}
return {
pre() {
this.seenDefine = false;
this.addedReturnForDefaultExport = false;
},
visitor: {
// Plugin ordering is only respected if we visit the "Program" node.
// See: https://babeljs.io/docs/en/plugins.html#plugin-preset-ordering
//
// We require this to run after the other AMD module transformation so
// let's visit the "Program" node.
Program: {
exit(path) {
path.traverse({
CallExpression(path) {
// If we find a "define" function call.
if (!this.seenDefine && path.get('callee').isIdentifier({name: 'define'})) {
// We only want to modify the first instance of define that we find.
this.seenDefine = true;
// Get the Moodle component for the file being processed.
var moduleName = getModuleNameFromFileName(this.file.opts.filename);
// The function signature of `define()` is:
// define = function (name, deps, callback) {...}
// Ensure that if the moduel supplied its own name that it is replaced.
if (path.node.arguments.length > 0) {
// Ensure that there is only one name.
if (path.node.arguments[0].type === 'StringLiteral') {
// eslint-disable-next-line
console.log(`Replacing module name '${path.node.arguments[0].extra.rawValue}' with ${moduleName}`);
path.node.arguments.shift();
}
}
// Add the module name as the first argument to the define function.
path.node.arguments.unshift(types.stringLiteral(moduleName));
// Add a space after the define function in the built file so that previous versions
// of Moodle will not try to add the module name to the file when it's being served
// by PHP. This forces the regex in PHP to not match for this file.
path.node.callee.name = 'define ';
}
// Check for any Object.defineProperty('exports', 'default') calls.
if (!this.addedReturnForDefaultExport && path.get('callee').matchesPattern('Object.defineProperty')) {
const [identifier, prop] = path.get('arguments');
const objectName = identifier.get('name').node;
const propertyName = prop.get('value').node;
if ((objectName === 'exports' || objectName === '_exports') && propertyName === 'default') {
addModuleExportsDefaults(path, objectName);
this.addedReturnForDefaultExport = true;
}
}
},
AssignmentExpression(path) {
// Check for an exports.default assignments.
if (
!this.addedReturnForDefaultExport &&
(
path.get('left').matchesPattern('exports.default') ||
path.get('left').matchesPattern('_exports.default')
)
) {
const objectName = path.get('left.object.name').node;
addModuleExportsDefaults(path, objectName);
this.addedReturnForDefaultExport = true;
}
}
}, this);
}
}
}
};
};
-455
View File
@@ -1,455 +0,0 @@
// 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/>.
/**
* Helper functions for working with Moodle component names, directories, and sources.
*
* @copyright 2019 Andrew Nicols <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
"use strict";
/* eslint-env node */
/** @var {Object} A list of subsystems in Moodle */
const componentData = {};
/**
* Load details of all moodle modules.
*
* @returns {object}
*/
const fetchComponentData = () => {
const fs = require('fs');
const path = require('path');
const glob = require('glob');
const gruntFilePath = process.cwd();
if (!Object.entries(componentData).length) {
componentData.subsystems = {};
componentData.pathList = [];
componentData.components = {};
componentData.standardComponents = {};
// Fetch the component definiitions from the distributed JSON file.
const components = JSON.parse(fs.readFileSync(`${gruntFilePath}/lib/components.json`));
const pluginData = JSON.parse(fs.readFileSync(`${gruntFilePath}/lib/plugins.json`));
componentData.pluginTypes = components.plugintypes
const standardPlugins = Object.entries(pluginData.standard).map(
([pluginType, pluginNames]) => {
return pluginNames.map(pluginName => `${pluginType}_${pluginName}`);
}
).reduce((acc, val) => acc.concat(val), []);
// Build the list of moodle subsystems.
componentData.subsystems['public/lib'] = 'core';
componentData.pathList.push(`${process.cwd()}/public/lib`);
for (const [component, thisPath] of Object.entries(components.subsystems)) {
if (thisPath) {
// Prefix "core_" to the front of the subsystems.
componentData.subsystems[thisPath] = `core_${component}`;
componentData.pathList.push(`${process.cwd()}/${thisPath}`);
}
}
// The list of components includes the list of subsystems.
componentData.components = Object.fromEntries(
Object.entries(componentData.subsystems)
.map(([path, name]) => ([path, name]))
);
const subpluginAdder = (subpluginType, subpluginTypePath) => {
glob.sync(`${subpluginTypePath}/*/version.php`).forEach(versionPath => {
const componentPath = fs.realpathSync(path.dirname(versionPath));
const componentName = path.basename(componentPath);
const frankenstyleName = `${subpluginType}_${componentName}`;
componentData.components[`${subpluginTypePath}/${componentName}`] = frankenstyleName;
componentData.pathList.push(componentPath);
});
};
// Go through each of the plugintypes.
Object.entries(components.plugintypes).forEach(([pluginType, pluginTypePath]) => {
// We don't allow any code in this place..?
glob.sync(`${pluginTypePath}/*/version.php`).forEach(versionPath => {
const componentPath = fs.realpathSync(path.dirname(versionPath));
const componentName = path.basename(componentPath);
const frankenstyleName = `${pluginType}_${componentName}`;
componentData.components[`${pluginTypePath}/${componentName}`] = frankenstyleName;
componentData.pathList.push(componentPath);
// Look for any subplugins.
const subPluginConfigurationFile = `${componentPath}/db/subplugins.json`;
if (fs.existsSync(subPluginConfigurationFile)) {
const subpluginList = JSON.parse(fs.readFileSync(fs.realpathSync(subPluginConfigurationFile)));
if (subpluginList.subplugintypes) {
Object.entries(subpluginList.subplugintypes).forEach(([subpluginType, subpluginTypePath]) => {
subpluginAdder(
subpluginType,
`${pluginTypePath}/${componentName}/${subpluginTypePath}`
);
});
} else if (subpluginList.plugintypes) {
Object.entries(subpluginList.plugintypes).forEach(([subpluginType, subpluginTypePath]) => {
subpluginAdder(subpluginType, `public/${subpluginTypePath}`);
});
}
}
});
});
// Create a list of the standard subsystem and plugins.
componentData.standardComponents = Object.fromEntries(
Object.entries(componentData.components).filter(([, name]) => {
if (name === 'core' || name.startsWith('core_')) {
return true;
}
return standardPlugins.indexOf(name) !== -1;
})
);
componentData.componentMapping = Object.fromEntries(
Object.entries(componentData.components).map(([path, name]) => [name, path])
);
}
return componentData;
};
/**
* Get the list of component paths.
*
* @param {string} relativeTo
* @returns {array}
*/
const getComponentPaths = (relativeTo = '') => fetchComponentData().pathList.map(componentPath => {
return componentPath.replace(relativeTo, '');
});
/**
* Get the list of paths to build AMD sources.
*
* @returns {Array}
*/
const getAmdSrcGlobList = () => {
const globList = [];
fetchComponentData().pathList.forEach(componentPath => {
globList.push(`${componentPath}/amd/src/*.js`);
globList.push(`${componentPath}/amd/src/**/*.js`);
});
return globList;
};
/**
* Get the list of paths to build YUI sources.
*
* @param {String} relativeTo
* @returns {Array}
*/
const getYuiSrcGlobList = relativeTo => {
const globList = [];
fetchComponentData().pathList.forEach(componentPath => {
const relativeComponentPath = componentPath.replace(relativeTo, '');
globList.push(`${relativeComponentPath}/yui/src/**/*.js`);
});
return globList;
};
/**
* Get the list of paths to thirdpartylibs.xml.
*
* @param {String} relativeTo
* @returns {Array}
*/
const getThirdPartyLibsList = relativeTo => {
const fs = require('fs');
const path = require('path');
const pathList = fetchComponentData().pathList
.map(componentPath => path.relative(relativeTo, componentPath) + '/thirdpartylibs.xml')
.map(componentPath => componentPath.replace(/\\/g, '/'))
.filter(path => fs.existsSync(path));
pathList.push('lib/thirdpartylibs.xml');
return pathList.sort();
};
/**
* Get the list of thirdparty library paths.
*
* @returns {array}
*/
const getThirdPartyPaths = () => {
const DOMParser = require('@xmldom/xmldom').DOMParser;
const fs = require('fs');
const path = require('path');
const xpath = require('xpath');
const thirdpartyfiles = getThirdPartyLibsList(fs.realpathSync('./'));
const libs = ['node_modules/', 'vendor/'];
const addLibToList = lib => {
if (!lib.match('\\*') && fs.statSync(lib).isDirectory()) {
// Ensure trailing slash on dirs.
lib = lib.replace(/\/?$/, '/');
}
// Look for duplicate paths before adding to array.
if (libs.indexOf(lib) === -1) {
libs.push(lib);
}
};
thirdpartyfiles.forEach(function(file) {
const dirname = path.dirname(file);
const xmlContent = fs.readFileSync(file, 'utf8');
const doc = new DOMParser().parseFromString(xmlContent);
const nodes = xpath.select("/libraries/library/location/text()", doc);
nodes.forEach(function(node) {
let lib = path.posix.join(dirname, node.toString());
addLibToList(lib);
});
});
return libs;
};
/**
* Find the name of the component matching the specified path.
*
* @param {String} path
* @returns {String|null} Name of matching component.
*/
const getComponentFromPath = path => {
const componentList = fetchComponentData().components;
if (componentList.hasOwnProperty(path)) {
return componentList[path];
}
return null;
};
/**
* Check whether the supplied path, relative to the Gruntfile.js, is in a known component.
*
* @param {String} checkPath The path to check. This can be with either Windows, or Linux directory separators.
* @returns {String|null}
*/
const getOwningComponentDirectory = checkPath => {
const path = require('path');
// Fetch all components into a reverse sorted array.
// This ensures that components which are within the directory of another component match first.
const pathList = Object.keys(fetchComponentData().components).sort().reverse();
for (const componentPath of pathList) {
// If the componentPath is the directory being checked, it will be empty.
// If the componentPath is a parent of the directory being checked, the relative directory will not start with ..
if (!path.relative(componentPath, checkPath).startsWith('..')) {
return componentPath;
}
}
return null;
};
/**
* Get the latest tag in a remote GitHub repository.
*
* @param {string} url The remote repository.
* @returns {Array}
*/
const getRepositoryTags = async(url) => {
const gtr = require('git-tags-remote');
try {
const tags = await gtr.get(url);
if (tags !== undefined) {
return tags;
}
} catch (error) {
return [];
}
return [];
};
/**
* Get the list of thirdparty libraries that could be upgraded.
*
* @returns {Array}
*/
const getThirdPartyLibsUpgradable = async() => {
const libraries = getThirdPartyLibsData().filter((library) => !!library.repository);
const upgradableLibraries = [];
const versionCompare = (a, b) => {
if (a === b) {
return 0;
}
const aParts = a.split('.');
const bParts = b.split('.');
for (let i = 0; i < Math.min(aParts.length, bParts.length); i++) {
const aPart = parseInt(aParts[i], 10);
const bPart = parseInt(bParts[i], 10);
if (aPart > bPart) {
// 1.1.0 > 1.0.9
return 1;
} else if (aPart < bPart) {
// 1.0.9 < 1.1.0
return -1;
} else {
// Same version.
continue;
}
}
if (aParts.length > bParts.length) {
// 1.0.1 > 1.0
return 1;
}
// 1.0 < 1.0.1
return -1;
};
for (let library of libraries) {
upgradableLibraries.push(
getRepositoryTags(library.repository).then((tagMap) => {
library.version = library.version.replace(/^v/, '');
const currentVersion = library.version.replace(/moodle-/, '');
const currentMajorVersion = library.version.split('.')[0];
const tags = [...tagMap]
.map((tagData) => tagData[0])
.filter((tag) => !tag.match(/(alpha|beta|rc)/))
.map((tag) => tag.replace(/^v/, ''))
.sort((a, b) => versionCompare(b, a));
if (!tags.length) {
library.warning = "Unable to find any comparable tags.";
return library;
}
library.latestVersion = tags[0];
tags.some((tag) => {
if (!tag) {
return false;
}
// See if the version part matches.
const majorVersion = tag.split('.')[0];
if (majorVersion === currentMajorVersion) {
library.latestSameMajorVersion = tag;
return true;
}
return false;
});
if (versionCompare(currentVersion, library.latestVersion) > 0) {
// Moodle somehow has a newer version than the latest version.
library.warning = `Newer version found: ${currentVersion} > ${library.latestVersion} for ${library.name}`;
return library;
}
if (library.version !== library.latestVersion) {
// Delete version and add it again at the end of the array. That way, current and new will stay closer.
delete library.version;
library.version = currentVersion;
return library;
}
return null;
})
);
}
return (await Promise.all(upgradableLibraries)).filter((library) => !!library);
};
/**
* Get the list of paths to build react sources.
*
* @param {string} relativeTo
* @returns {string[]}
*/
const getReactTsSrcGlobList = (relativeTo = '') => {
const globList = [];
fetchComponentData().pathList.forEach(componentPath => {
const relativeComponentPath = componentPath.replace(relativeTo, '');
globList.push(`${relativeComponentPath}/js/esm/src/**/*.ts`);
globList.push(`${relativeComponentPath}/js/esm/src/**/*.tsx`);
});
return globList.map(componentPath => componentPath.replace(/\\/g, '/'));
};
/**
* Get the list of thirdparty libraries.
*
* @returns {Array}
*/
const getThirdPartyLibsData = () => {
const DOMParser = require('@xmldom/xmldom').DOMParser;
const fs = require('fs');
const xpath = require('xpath');
const path = require('path');
const libraryList = [];
const libraryFields = [
'location',
'name',
'version',
'repository',
];
const thirdpartyfiles = getThirdPartyLibsList(fs.realpathSync('./'));
thirdpartyfiles.forEach(function(libraryPath) {
const xmlContent = fs.readFileSync(libraryPath, 'utf8');
const doc = new DOMParser().parseFromString(xmlContent);
const libraries = xpath.select("/libraries/library", doc);
for (const library of libraries) {
const libraryData = [];
for (const field of libraryFields) {
libraryData[field] = xpath.select(`${field}/text()`, library)?.toString();
}
libraryData.location = path.join(path.dirname(libraryPath), libraryData.location);
libraryList.push(libraryData);
}
});
return libraryList.sort((a, b) => a.location.localeCompare(b.location));
};
module.exports = {
fetchComponentData,
getAmdSrcGlobList,
getComponentFromPath,
getComponentPaths,
getOwningComponentDirectory,
getYuiSrcGlobList,
getThirdPartyLibsList,
getThirdPartyPaths,
getThirdPartyLibsUpgradable,
getReactTsSrcGlobList,
};
-19
View File
@@ -1,19 +0,0 @@
# Moodle JavaScript Documentation
```
.-..-.
_____ | || |
/____/-.---_ .---. .---. .-.| || | .---.
| | _ _ |/ _ \/ _ \/ _ || |/ __ \
* | | | | | || |_| || |_| || |_| || || |___/
|_| |_| |_|\_____/\_____/\_____||_|\_____)
Moodle - the world's open source learning platform
```
## About
This generated documentation includes API documentation for JavaScript written in the AMD and ES2015 module formats within Moodle.
## Related information
See [https://moodledev.io](https://moodledev.io) for other related Developer Documentation.
-131
View File
@@ -1,131 +0,0 @@
// 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/>.
/**
* Helper functions for working with Moodle component names, directories, and sources.
*
* @copyright 2019 Andrew Nicols <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
"use strict";
/* eslint-env node */
// Do not include any plugins as stanard.
const plugins = [];
plugins.push('plugins/markdown');
/**
* Get the source configuration.
*
* @return {Object}
*/
const getSource = () => {
const glob = require('glob');
const path = require('path');
const ComponentList = require(path.resolve('.grunt/components.js'));
const thirdPartyPaths = ComponentList.getThirdPartyPaths();
const source = {
include: [],
includePattern: ".+\\.js$",
};
let includeList = [];
ComponentList.getAmdSrcGlobList().forEach(async pattern => {
includeList.push(...glob.sync(pattern));
});
const cwdLength = process.cwd().length + 1;
includeList.forEach(path => {
if (source.include.indexOf(path) !== -1) {
// Ensure no duplicates.
return;
}
const relPath = path.substring(cwdLength);
if (thirdPartyPaths.indexOf(relPath) !== -1) {
return;
}
source.include.push(path);
});
source.include.push('.grunt/jsdoc/README.md');
return source;
};
const tags = {
// Allow the use of unknown tags.
// We have a lot of legacy uses of these.
allowUnknownTags: true,
// We make use of jsdoc and closure dictionaries as standard.
dictionaries: [
'jsdoc',
'closure',
],
};
// Template configuraiton.
const templates = {
cleverLinks: false,
monospaceLinks: false,
};
module.exports = {
opts: {
destination: "./public/jsdoc/",
template: "node_modules/docdash",
},
plugins,
recurseDepth: 10,
source: getSource(),
sourceType: 'module',
tags,
templates,
docdash: {
collapse: true,
search: true,
sort: true,
sectionOrder: [
"Namespaces",
"Modules",
"Events",
"Classes",
"Externals",
"Mixins",
"Tutorials",
"Interfaces"
],
"menu": {
"Developer Docs": {
href: "https://moodledev.io",
target: "_blank",
"class": "menu-item",
id: "devdocs"
},
"MDN Docs": {
href: "https://developer.mozilla.org/en-US/docs/Web/JavaScript",
target: "_blank",
"class": "menu-item",
id: "mdndocs",
},
},
typedefs: true,
},
};
-138
View File
@@ -1,138 +0,0 @@
// 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/>.
import * as Components from '../../components.js';
const componentData = Components.fetchComponentData();
/**
* The standard components shipped with core Moodle.
*
* @type {Object}
*/
export const standardComponents = componentData.standardComponents;
/**
* All components of the current Moodle instance.
*
* @type {Object}
*/
export const allComponents = componentData.components;
/**
* Get all components of the current Moodle instance.
*
* @returns {Array}
*/
export const getAllComponents = () => {
let components = new Map(Object.entries(componentData.pluginTypes).map(([value, path]) => ([path,{
path,
value,
name: `${value} (plugin type)`,
}])));
Object
.entries(componentData.components)
.filter(([path, value]) => Object.values(componentData.standardComponents).includes(value))
.forEach(([path, value]) => {
const entry = {
path,
value,
name: value,
};
if (Object.values(componentData.subsystems).includes(value)) {
if (components.has(path)) {
entry.name = `${value} (subsystem / plugintype)`;
} else {
entry.name = `${value} (subsystem)`;
}
}
components.set(path, entry);
});
return Array.from(components.values());
};
/**
* Whether the specified component is a standard component shipped with core Moodle.
*
* @param {string} componentName
* @returns {boolean}
*/
export const isStandardComponent = (componentName) => {
if (Object.values(componentData.standardComponents).includes(componentName)) {
return true;
}
if (Object.keys(componentData.pluginTypes).includes(componentName)) {
return true;
}
return false;
};
export const rewritePlugintypeAsSubsystem = (componentName) => {
if (Object.keys(componentData.pluginTypes).includes(componentName)) {
const pluginTypePath = componentData.pluginTypes[componentName];
if (Object.keys(componentData.subsystems).includes(pluginTypePath)) {
return true;
}
}
return false;
};
/**
* Whether the specified component is a community component.
*
* @param {string} componentName
* @returns {boolean}
*/
export const isCommunityComponent = (componentName) => {
if (isStandardComponent(componentName)) {
return false;
}
return Object.values(componentData.components).indexOf(componentName) !== -1;
};
/**
* Sort method for components.
*
* This method sorts components putting `core` first, followed by core subsystems, then everything else.
*
* @param {String} a
* @param {String} b
* @returns {Number}
*/
export const sortComponents = (a, b) => {
// Always put 'core' first.
if (a === 'core') {
return -1;
} else if (b === 'core') {
return 1;
}
// Put core subsystems next.
if (a.startsWith('core_') && !b.startsWith('core_')) {
return -1;
} else if (b.startsWith('core_') && !a.startsWith('core_')) {
return 1;
}
// Sort alphabetically for everything else.
return a.localeCompare(b);
};
-85
View File
@@ -1,85 +0,0 @@
#!/usr/bin/env node
// 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/>.
import inquirer from 'inquirer';
import chalk from 'chalk';
import { createNote } from './note.mjs';
import { getInitialValues, getIssueNumberFromBranchName } from './helpers.mjs';
import * as Prompts from './prompts.mjs';
import logger from './logger.mjs';
export default async (options) => {
// Processs the initial values.
const initialValues = getInitialValues(options);
// Fetch information.
const messages = [];
const { issueNumber } = await inquirer.prompt([
Prompts.getIssuePrompt(getIssueNumberFromBranchName()),
], initialValues);
let selection = {};
let notePath;
do {
selection = {};
selection = await inquirer.prompt([
Prompts.getComponentsPrompt(),
Prompts.getTypePrompt(),
Prompts.getMessagePromptInput(),
], initialValues);
if (selection.message === '') {
selection = Object.assign(
selection,
await inquirer.prompt([
Prompts.getMessagePromptEditor(),
]),
);
}
logger.info(`
Creating upgrade note with the following options:
- Issue: ${chalk.bold(issueNumber)}
- Component: ${chalk.bold(selection.components)}
- Type: ${chalk.bold(selection.type)}
- Message:
${chalk.bold(selection.message)}
`);
messages.push({
components: [selection.components],
type: selection.type,
message: selection.message,
});
// Save the note so far.
if (notePath) {
await createNote(issueNumber, messages, notePath);
logger.info(`Updated note at: ${chalk.underline(chalk.bold(notePath))}`);
} else {
notePath = await createNote(issueNumber, messages);
logger.info(`Note created at: ${chalk.underline(chalk.bold(notePath))}`);
}
selection = Object.assign(
selection,
await inquirer.prompt([
Prompts.getAddAnotherPrompt(),
], initialValues),
);
} while (selection.addAnother);
};
-357
View File
@@ -1,357 +0,0 @@
#!/usr/bin/env node
// 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/>.
import chalk from 'chalk';
import { getAllComponents } from './components.mjs';
import { getCombinedNotesByComponent, deleteAllNotes } from './note.mjs';
import { getNoteName } from './noteTypes.mjs';
import { writeFile, readFile, unlink } from 'fs/promises';
import { join as joinPath } from 'path';
import logger from './logger.mjs';
import { getCurrentVersion } from './helpers.mjs';
/**
* Helper to fetch the current notes from a file.
*
* @param {string} file
* @returns {Promise<string>}
*/
const getCurrentNotes = async (file) => {
try {
return await readFile(file, 'utf8');
} catch (error) {
return null;
}
}
/**
* Update the UPGRADING.md file.
*
* @param {string} upgradeNotes
* @param {Object} options
* @param {boolean} options.deleteNotes
* @returns {Promise<void>}
*/
const updateUpgradeNotes = async (upgradeNotes, options) => {
const fileName = 'UPGRADING.md';
// Write the notes to a file.
logger.info(`Writing notes to ${chalk.underline(chalk.bold(fileName))}`);
// Prepend to the existing file.
const existingContent = await getCurrentNotes(fileName);
if (existingContent) {
await writeFile(fileName, getUpdatedNotes(existingContent, upgradeNotes));
} else {
// This should not normally happen.
await writeFile(fileName, upgradeNotes);
}
if (options.deleteNotes) {
logger.warn(`>>> Deleting all notes <<<`)
// Delete the notes.
deleteAllNotes();
}
};
/**
* Create the current summary notes.
*
* @param {string} upgradeNotes
* @returns {Promise<void>}
*/
const createCurrentSummary = async (upgradeNotes) => {
const fileName = 'UPGRADING-CURRENT.md';
const notes = `# Moodle upgrade notes\n\n${upgradeNotes}`;
await writeFile(fileName, notes);
logger.info(`Running upgrade notes written to ${chalk.underline(chalk.bold(fileName))}`);
};
/**
* Get the indexes of the lines that contain the version headings.
*
* @param {array<string>} lines
* @returns {array<object>}
*/
const getVersionLineIndexes = (lines) => {
const h2Indexes = [];
lines.forEach((line, index) => {
const matches = line.match(/^##\s(?<version>.*)$/);
if (matches) {
h2Indexes.push({
index,
line,
version: matches.groups.version,
});
}
});
return h2Indexes;
};
/**
* Find the index of the Unreleased heading.
*
* @param {array<object>} versionHeadings
* @returns {number}
*/
const findUnreleasedHeadingIndex = (versionHeadings) => versionHeadings.findIndex((heading) => {
if (heading.version === 'Unreleased') {
// Used if version cannot be guessed.
return true;
}
if (heading.version.endsWith('+')) {
// Weekly release for a stable branch.
return true;
}
if (heading.version.match(/beta|rc\d/)) {
// Beta and RC rolls are treated as weeklies.
return true;
}
if (heading.version.endsWith('dev')) {
// Development version.
return true;
}
return false;
});
/**
* Get the before and after content, to facilitate replacing any existing Unreleased notes.
*
* @param {array<string>} lines
* @returns {Object} {beforeContent: string, afterContent: string}
*/
const getBeforeAndAfterContent = (lines) => {
const existingLines = lines.split('\n');
const versionHeadings = getVersionLineIndexes(existingLines);
if (versionHeadings.length > 0) {
const unreleasedHeadingIndex = findUnreleasedHeadingIndex(versionHeadings);
if (unreleasedHeadingIndex !== -1) {
const beforeContent = existingLines.slice(0, versionHeadings[unreleasedHeadingIndex].index).join('\n');
if (versionHeadings.length > unreleasedHeadingIndex + 1) {
const afterContent = existingLines.slice(versionHeadings[unreleasedHeadingIndex + 1].index).join('\n');
return {
beforeContent,
afterContent,
};
}
return {
beforeContent,
afterContent: '',
};
}
return {
beforeContent: existingLines.slice(0, versionHeadings[0].index).join('\n'),
afterContent: existingLines.slice(versionHeadings[0].index).join('\n'),
};
}
return {
beforeContent: existingLines.join('\n'),
afterContent: '',
}
};
/**
* Get the notes for the component.
*
* @param {string} types
* @param {Number} headingLevel
* @returns {string}
*/
const getNotesForComponent = (types, headingLevel) => {
let upgradeNotes = '';
Object.entries(types).forEach(([type, notes]) => {
upgradeNotes += '#'.repeat(headingLevel);
upgradeNotes += ` ${getNoteName(type)}\n\n`;
notes.forEach(({ message, issueNumber }) => {
// Split the message into lines, removing empty lines.
const messageLines = message
.split('\n')
// Remove empty lines between tables, and list entries, but not after lists.
.filter((line, index, lines) => {
if (line.trim().length === 0) {
// This line is empty.
// If it's the first line in the file, remove it.
if (index === 0) {
return false;
}
// This is the last line in the file, remove it.
if (index === lines.length - 1) {
return false;
}
// If the previous line relates to a table, remove this line.
if (lines[index - 1].match(/^\s*\|/)) {
return false;
}
// If the next line is also empty, do not remove this line.
if (lines[index + 1].trim().length === 0) {
return true;
}
// Do not remove the line if the previous line was a list item.
if (lines[index - 1].match(/^\s*[-*]\s/)) {
return true;
}
if (lines[index - 1].match(/^\s*\d+\.\s/)) {
return true;
}
// Preserve all other empty lines by default.
return true;
}
// Keep any line which has content.
return true;
});
const firstLine = messageLines.shift().trim();
upgradeNotes += `- ${firstLine}\n`;
messageLines
.forEach((line) => {
upgradeNotes += ` ${line}`.trimEnd() + `\n`;
});
upgradeNotes += `\n For more information see [${issueNumber}](https://tracker.moodle.org/browse/${issueNumber})\n`;
});
upgradeNotes += '\n';
});
return upgradeNotes;
};
/**
* Get the updated notes mixed with existing content.
*
* @param {string} existingContent
* @param {string} upgradeNotes
*/
const getUpdatedNotes = (existingContent, upgradeNotes) => {
const { beforeContent, afterContent } = getBeforeAndAfterContent(existingContent);
const newContent = `${beforeContent}\n${upgradeNotes}\n${afterContent}`
.split('\n')
.filter((line, index, lines) => {
if (line === '' && lines[index - 1] === '') {
// Remove multiple consecutive empty lines.
return false;
}
return true;
})
.join('\n');
return newContent;
};
/**
* Update the notes for each component.
*/
const updateComponentNotes = (
notes,
version,
notesFileName = 'UPGRADING.md',
removeEmpty = false,
) => {
return getAllComponents().map(async (component) => {
logger.verbose(`Updating notes for ${component.name} into ${component.path}`);
const fileName = joinPath(component.path, notesFileName);
const existingContent = await getCurrentNotes(fileName);
if (!existingContent) {
if (!notes[component.value]) {
// No existing notes, and no new notes to add.
return;
}
} else {
if (!notes[component.value]) {
// There is existing content, but nothing to add.
if (removeEmpty) {
logger.verbose(`Removing empty notes file ${fileName}`);
await unlink(fileName);
}
return;
}
}
const componentNotes = notes[component.value];
let upgradeNotes = `## ${version}\n\n`;
upgradeNotes += getNotesForComponent(componentNotes, 3);
if (existingContent) {
await writeFile(fileName, getUpdatedNotes(existingContent, upgradeNotes));
} else {
await writeFile(
fileName,
`# ${component.name} Upgrade notes\n\n${upgradeNotes}`,
);
}
});
}
/**
* Generate the upgrade notes for a new release.
*
* @param {string|undefined} version
* @param {Object} options
* @param {boolean} options.generateUpgradeNotes
* @param {boolean} options.deleteNotes
* @returns {Promise<void>}
*/
export default async (version, options = {}) => {
const notes = await getCombinedNotesByComponent();
if (Object.keys(notes).length === 0) {
logger.warn('No notes to generate');
return;
}
if (!version) {
version = await getCurrentVersion();
}
// Generate the upgrade notes for this release.
// We have
// - a title with the release name
// - the change types
// - which contain the components
// - which document each change
let upgradeNotes = `## ${version}\n\n`;
Object.entries(notes).forEach(([component, types]) => {
upgradeNotes += `### ${component}\n\n`;
upgradeNotes += getNotesForComponent(types, 4);
});
await Promise.all([
createCurrentSummary(upgradeNotes),
...updateComponentNotes(notes, version, 'UPGRADING-CURRENT.md', true),
]);
if (options.generateUpgradeNotes) {
await Promise.all(updateComponentNotes(notes, version));
await updateUpgradeNotes(upgradeNotes, options);
}
};
-244
View File
@@ -1,244 +0,0 @@
// 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/>.
import chalk from 'chalk';
import branchName from 'current-git-branch';
import { isStandardComponent, isCommunityComponent, rewritePlugintypeAsSubsystem } from './components.mjs';
import { isValidNoteName } from './noteTypes.mjs';
import logger from './logger.mjs';
import { readFile } from 'fs/promises';
/**
* Validate an issue number input
*
* @param {string} input
* @returns {string|boolean}
*/
export const validateIssueNumber = (input) => {
if (!input) {
return 'You must provide a tracker issue number';
}
if (input.match(/^[a-zA-Z]*-\d+$/)) {
return true;
}
if (input.match(/^\d+$/)) {
return true;
}
return 'The issue number was not recognised as a valid issue number';
};
/**
* Format an issue number input.
*
* @param {string} input
* @returns {string}
*/
export const formatIssueNumber = (input) => {
if (input.match(/^[a-zA-Z]*-\d+$/)) {
return input;
}
if (input.match(/^\d+$/)) {
return `MDL-${input}`;
}
return input;
};
/**
* Get the issue number, based off current git branch name
*
* @returns {string|null}
*/
export const getIssueNumberFromBranchName = () => {
const issueNumber = String(branchName()).match(/^[a-zA-Z]*-\d+/);
if (issueNumber) {
return formatIssueNumber(issueNumber[0]);
}
return null;
};
/**
* Validate a component.
*
* @param {string} input
* @returns {string|boolean}
*/
export const validateComponent = (input) => {
if (isStandardComponent(input)) {
return true;
}
if (isCommunityComponent(input)) {
return 'Currently only core plugins are supported.';
}
return 'The component was not recognised as a standard component';
};
export const formatComponent = (input) => {
if (rewritePlugintypeAsSubsystem(input)) {
return `core_${input}`;
}
return input;
}
/**
* Get the initial values from the options.
*
* @param {object} options
* @returns {object}
*/
export const getInitialValues = (options) => {
const initialValues = {};
const type = getInitialTypeValue(options);
if (type) {
initialValues.type = type;
}
const issueNumber = getInitialIssueValue(options);
if (issueNumber) {
initialValues.issueNumber = issueNumber;
}
const component = getInitialComponentValue(options);
if (component) {
initialValues.components = component;
}
const message = getInitialMessageValue(options);
if (message) {
initialValues.message = message
initialValues.addAnother = false;
}
return initialValues;
};
/**
* Get the initial type value.
*
* @param {Object} options
* @returns {string|undefined}
*/
const getInitialTypeValue = (options) => {
if (!options.type) {
return;
}
options.type = options.type.trim().toLowerCase();
if (isValidNoteName(options.type)) {
return options.type;
}
logger.warn(`Note type "${chalk.underline(chalk.red(options.type))}" is not valid.`);
};
/**
* Get the initial issue number value.
*
* @param {Object} options
* @returns {string|undefined}
*/
const getInitialIssueValue = (options) => {
if (!options.issue) {
return;
}
options.issue = options.issue.trim().toUpperCase();
const issueNumberValidated = validateIssueNumber(options.issue);
if (issueNumberValidated === true) {
const issueNumber = formatIssueNumber(options.issue);
if (issueNumber !== options.issue) {
logger.warn(
`Issue number "${chalk.underline(chalk.red(options.issue))}" was updated to ` +
`"${chalk.underline(chalk.green(issueNumber))}"`
);
}
return issueNumber;
} else {
logger.warn(`Issue number "${chalk.underline(chalk.red(options.issue))}" is not valid: ${issueNumberValidated}`);
}
};
/**
* Get the initial component value.
*
* @param {Object} options
* @returns {string|undefined}
*/
const getInitialComponentValue = (options) => {
if (!options.component) {
return;
}
options.component = options.component.trim().toLowerCase();
const componentValidated = validateComponent(options.component);
if (componentValidated === true) {
const component = formatComponent(options.component);
if (component !== options.component) {
logger.warn(
`Component "${chalk.underline(chalk.red(options.component))}" was updated to ` +
`"${chalk.underline(chalk.green(component))}"`
);
}
return component;
} else {
logger.warn(`Component "${chalk.underline(chalk.red(options.component))}" is not valid: ${componentValidated}`);
}
};
/**
* Get the initial message value.
*
* @param {Object} options
* @returns {string|undefined}
*/
const getInitialMessageValue = (options) => {
if (!options.message) {
return;
}
return options.message.trim();
};
/**
* Get the current version from the project /version.php file.
*
* @returns {Promise<string>}
*/
export const getCurrentVersion = async () => {
const versionRegex = new RegExp(/^ *\$release *= *['\"](?<release>[^ \+]+\+?) *\(Build:.*/m);
try {
const versionFile = await readFile('public/version.php', 'utf8');
const match = versionFile.match(versionRegex);
if (match) {
return match.groups.release;
}
} catch(error) {
logger.error('Unable to read the version file');
}
return "Unreleased";
}
-30
View File
@@ -1,30 +0,0 @@
#!/usr/bin/env node
// 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/>.
import winston from 'winston';
const logger = winston.createLogger({
level: 'info',
format: winston.format.combine(
winston.format.colorize(),
winston.format.simple()
),
transports: [
new winston.transports.Console(),
],
});
export default logger;
-194
View File
@@ -1,194 +0,0 @@
// 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/>.
import yaml from 'js-yaml';
import path from 'path';
import { writeFile, mkdir, readdir, readFile, unlink } from 'fs/promises';
import { isValidNoteName, sortNoteTypes } from './noteTypes.mjs';
import { sortComponents } from './components.mjs';
const unreleasedPath = path.resolve('.upgradenotes');
/**
* Get the filename for the note.
*
* @param {string} issueNumnber The issue number
* @returns {string}
*/
const getFilename = (issueNumber) => {
const dateTimeFormat = new Intl.DateTimeFormat(undefined, {
year: 'numeric',
month: '2-digit',
day: '2-digit',
hour: '2-digit',
minute: '2-digit',
second: '2-digit',
fractionalSecondDigits: 2,
timeZone: 'UTC',
});
const date = Object.fromEntries(
dateTimeFormat.formatToParts(new Date())
.filter((p) => p.type !== 'literal')
.map((p) => ([p.type, p.value]))
);
const dateString = [
date.year,
date.month,
date.day,
date.hour,
date.minute,
date.second,
date.fractionalSecond,
].join('');
return `${issueNumber}-${dateString}.yml`;
};
/**
* Create a new note.
*
* @param {string} issueNumber
* @param {[type: string]: {message: string}} messages
* @returns {string} The path to the note on disk
*/
export const createNote = async (
issueNumber,
messages,
notePath,
) => {
const note = {
issueNumber,
notes: {},
};
messages.forEach(({components, type, message}) => {
note.notes[components] = note.notes[components] || [];
note.notes[components].push({message, type});
});
if (!notePath) {
notePath = path.resolve(unreleasedPath, getFilename(issueNumber));
}
const noteContent = yaml.dump(note);
await mkdir(unreleasedPath, {recursive: true});
await writeFile(notePath, noteContent);
return notePath;
};
/**
* Get all unreleased notes.
*
* @returns {Promise<{issueNumber: string, components: string[], types: {[type: string]: {message: string}[]}}[]>
*/
export const getAllNotes = async () => {
const files = await readdir(unreleasedPath);
const notes = files
.filter((file) => file.endsWith('.yml'))
.map(async (file) => {
const filePath = path.resolve(unreleasedPath, file);
const fileContent = await readFile(filePath, 'utf8');
return {
...yaml.load(fileContent),
filePath,
};
});
return Promise.all(notes);
};
/**
* Get the list of notes, grouped by note type, then component.
*
* @returns {Promise<{[type: string]: {[components: string]: {message: string, issueNumber: string}[]}}>}
*/
export const getCombinedNotes = async () => {
const notes = await getAllNotes();
const combinedNotes = {};
notes.forEach((note) => {
Object.entries(note.notes).forEach(([components, data]) => {
data.forEach((entry) => {
if (!isValidNoteName(entry.type)) {
throw new Error(`Invalid note type: "${entry.type}" in file ${note.filePath}`);
}
combinedNotes[entry.type] = combinedNotes[entry.type] || {};
combinedNotes[entry.type][components] = combinedNotes[entry.type][components] || [];
combinedNotes[entry.type][components].push({message: entry.message, issueNumber: note.issueNumber});
});
});
});
return combinedNotes;
};
/**
* Get the list of notes, grouped by component, then by note type.
*
* @returns {Promise<{[component: string]: {[type: string]: {message: string, issueNumber: string}[]}}>}
*/
export const getCombinedNotesByComponent = async () => {
const notes = await getAllNotes();
const combinedNotes = {};
notes.forEach((note) => {
Object.entries(note.notes).forEach(([component, data]) => {
combinedNotes[component] = combinedNotes[component] || {};
data.forEach((entry) => {
if (!isValidNoteName(entry.type)) {
throw new Error(`Invalid note type: "${entry.type}" in file ${note.filePath}`);
}
combinedNotes[component][entry.type] = combinedNotes[component][entry.type] || [];
combinedNotes[component][entry.type].push({
component,
message: entry.message,
issueNumber: note.issueNumber,
type: entry.type,
});
});
});
});
// Sort notes by note type.
Object.entries(combinedNotes).forEach(([component, types]) => {
combinedNotes[component] = Object.fromEntries(
Object.entries(types).sort(([a], [b]) => sortNoteTypes(a, b))
);
});
// Sort components.
return Object.fromEntries(
Object.entries(combinedNotes).sort(([a], [b]) => sortComponents(a, b))
);
};
/**
* Delete all unreleased notes.
*
* @returns {Promise<void>}
*/
export const deleteAllNotes = async () => {
const files = await readdir(unreleasedPath);
return Promise.all(
files
.filter((item, index) => files.indexOf(item) === index)
.filter((file) => file.endsWith('.yml'))
.map((file) => unlink(`${unreleasedPath}/${file}`))
);
};
-80
View File
@@ -1,80 +0,0 @@
// 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/>.
/**
* The note types.
*
* Matches the suggested order in https://keepachangelog.com/en/1.1.0/.
* @type {Object<string, string>}
*/
const noteTypes = {
'improved': 'Added',
'changed': 'Changed',
'deprecated': 'Deprecated',
'removed': 'Removed',
'fixed': 'Fixed',
};
/**
* The preferred order of note types.
*
* @type {string[]}
*/
const preferredOrder = Object.keys(noteTypes);
/**
* Comparison method to sort note types.
*
* @param {String} a
* @param {String} b
* @returns {Number}
*/
export const sortNoteTypes = (a, b) => {
const aIndex = preferredOrder.indexOf(a);
const bIndex = preferredOrder.indexOf(b);
if (aIndex === -1) {
return 1;
}
if (bIndex === -1) {
return -1;
}
return aIndex - bIndex;
};
/**
* Get the note names.
*
* @returns {string[]}
*/
export const getNoteNames = () => Object.keys(noteTypes);
/**
* Get the human-readable note name.
*
* @param {string} type
* @returns {string}
*/
export const getNoteName = (type) => noteTypes[type];
/**
* Whether the note name is valid.
*
* @param {string} type
* @returns {boolean}
*/
export const isValidNoteName = (type) => noteTypes[type] !== undefined;
-153
View File
@@ -1,153 +0,0 @@
// 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/>.
import inquirer from 'inquirer';
import SearchList from 'inquirer-search-list';
import { getNoteNames } from './noteTypes.mjs';
import { getAllComponents } from './components.mjs';
import {
formatComponent,
formatIssueNumber,
validateComponent,
validateIssueNumber,
} from './helpers.mjs';
/**
* A Search List which accepts an initial value.
*/
class SearchListWithInitialValue extends SearchList {
constructor(options, ...args) {
super(options, ...args);
if (options.default) {
const pointer = this.filterList.findIndex((item) => {
return item.value === options.default;
});
if (pointer > -1) {
this.pointer = pointer;
}
}
}
}
inquirer.registerPrompt('search-list', SearchListWithInitialValue);
/**
* Get the issue type prompt.
*
* @param {string} defaultData The initially selected value
* @returns {Object}
*/
export const getTypePrompt = (defaultData) => ({
default: defaultData,
type: 'search-list',
message: 'Type of change',
name: 'type',
choices: getNoteNames(),
validate: (selection) => {
if (selection.length < 1) {
return 'You must select at least one type of change';
}
return true;
},
});
/**
* Get the component prompt.
*
* @param {string} [defaultValue='core'] The initally selected value.
* @returns
*/
export const getComponentsPrompt = (defaultValue) => {
if (!defaultValue ) {
defaultValue = 'core';
}
return {
choices: getAllComponents(),
default: defaultValue,
type: 'search-list',
message: 'Component',
name: 'components',
validate: validateComponent,
filter: formatComponent,
};
};
/**
* Get the issue number prompt as an inline input.
*
* @param {string} defaultData
* @returns {object}
*/
export const getIssuePrompt = (defaultData) => ({
default: defaultData,
type: 'input',
message: 'Tracker issue number',
name: 'issueNumber',
validate: validateIssueNumber,
filter: formatIssueNumber,
});
/**
* Get a message prompt.
*
* @param {string} defaultData
* @returns
*/
export const getMessagePromptEditor = (defaultData) => ({
default: defaultData,
type: process.stdin.isTTY ? 'editor' : 'input',
postfix: '.md',
message: 'Message',
name: 'message',
waitUserInput: false,
validate: (input) => {
if (!input) {
return 'You must provide a message';
}
return true;
},
// Remove any trailing whitespace.
filter: (input) => input.split('\n').map((line) => line.trimEnd()).join('\n'),
});
/**
* Get a message prompt.
*
* @param {string} defaultData
* @returns
*/
export const getMessagePromptInput = (defaultData) => ({
default: defaultData,
type: 'input',
message: 'Message (leave empty to use editor)',
name: 'message',
filter: (input) => input.trim(),
});
/**
* Get a prompt to ask the user if they wish to add another entry.
*
* @returns {Object}
*/
export const getAddAnotherPrompt = () => ({
type: 'confirm',
message: 'Do you want to add another note?',
default: false,
name: 'addAnother',
});
-58
View File
@@ -1,58 +0,0 @@
#!/usr/bin/env node
// 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/>.
import { getAllComponents } from './components.mjs';
import { getCombinedNotesByComponent } from './note.mjs';
import logger from './logger.mjs';
import { existsSync } from 'fs';
/**
* Generate links to component-specific upgrade notes for each component.
*
* @param {string|undefined} tag The git tag to link to
* @returns {Promise<void>}
*/
export default async (tag) => {
const notes = await getCombinedNotesByComponent();
if (Object.keys(notes).length === 0) {
logger.warn('No notes to generate');
return;
}
if (!tag) {
logger.error('No tag provided');
return;
}
// Generate the links for the components which have upgrade notes in this release.
let upgradeNotes = `### Component API updates\n<!--cspell: disable -->\n\n`;
const componentList = Object.fromEntries(
Object.values(getAllComponents()).map(({path, value}) => [value, path]),
);
Object.entries(notes)
.map(([component]) => ({
component,
componentPath: componentList[component],
}))
.filter(({ componentPath }) => existsSync(`./${componentPath}/UPGRADING.md`))
.forEach(({component, componentPath}) => {
upgradeNotes += `- [${component}](https://github.com/moodle/moodle/blob/${tag}/${componentPath}/UPGRADING.md)\n`;
});
console.log(upgradeNotes);
};
-142
View File
@@ -1,142 +0,0 @@
// 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/>.
/* jshint node: true, browser: false */
/* eslint-env node */
/**
* Component Library build tasks.
*
* @copyright 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
module.exports = grunt => {
/**
* Get a child path of the component library.
*
* @param {string} path
* @returns {string}
*/
const getCLPath = path => `public/admin/tool/componentlibrary/${path}`;
/**
* Get a spawn handler.
*
* This is a generic function to write the spawn output, and then to exit if required and mark the async task as
* complete.
*
* @param {Promise} done
* @returns {function}
*/
const getSpawnHandler = done => (error, result, code) => {
grunt.log.write(result);
if (error) {
grunt.log.error(result.stdout);
process.exit(code);
}
done();
};
/**
* Spawn a function against Node with the provided args.
*
* @param {array} args
* @returns {object}
*/
const spawnNodeCall = (args) => grunt.util.spawn({
cmd: 'node',
args,
}, getSpawnHandler(grunt.task.current.async()));
/**
* Build the docs using Hugo.
*
* @returns {Object} Reference to the spawned task
*/
const docsBuild = () => spawnNodeCall([
'node_modules/hugo-bin/cli.js',
'--config', getCLPath('config.yml'),
'--cleanDestinationDir',
]);
/**
* Build the docs index using the hugo-lunr-indexer.
*
* @returns {Object} Reference to the spawned task
*/
const indexBuild = () => spawnNodeCall([
'node_modules/hugo-lunr-indexer/bin/hli.js',
'-i', getCLPath('content/**'),
'-o', getCLPath('hugo/site/data/my-index.json'),
'-l', 'yaml',
'-d', '---',
]);
/**
* Build the hugo CSS.
*
* @returns {Object} Reference to the spawned task
*/
const cssBuild = () => spawnNodeCall([
'node_modules/sass/sass.js',
'--style', 'expanded',
'--source-map',
'--embed-sources',
'--precision', 6,
'--load-path', `${process.cwd()}/public`,
getCLPath('hugo/scss/docs.scss'),
getCLPath('hugo/dist/css/docs.css'),
]);
// Register the various component library tasks.
grunt.registerTask('componentlibrary:docsBuild', 'Build the component library', docsBuild);
grunt.registerTask('componentlibrary:cssBuild', 'Build the component library', cssBuild);
grunt.registerTask('componentlibrary:indexBuild', 'Build the component library', indexBuild);
grunt.registerTask('componentlibrary', 'Build the component library', [
'componentlibrary:docsBuild',
'componentlibrary:cssBuild',
'componentlibrary:indexBuild',
]);
grunt.config.merge({
watch: {
componentLibraryDocs: {
files: [
getCLPath('content/**/*.md'),
getCLPath('hugo'),
],
tasks: ['componentlibrary:docsBuild', 'componentlibrary:indexBuild'],
},
componentLibraryCSS: {
files: [
getCLPath('hugo/scss/**/*.scss'),
'hugo',
],
tasks: ['componentlibrary:cssBuild'],
},
},
});
// Add the 'componentlibrary' task as a startup task.
grunt.moodleEnv.startupTasks.push('componentlibrary');
return {
docsBuild,
cssBuild,
indexBuild,
};
};
-72
View File
@@ -1,72 +0,0 @@
// 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/>.
/* jshint node: true, browser: false */
/* eslint-env node */
/**
* @copyright 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
module.exports = grunt => {
const files = grunt.moodleEnv.files;
// Project configuration.
grunt.config.merge({
eslint: {
// Even though warnings dont stop the build we don't display warnings by default because
// at this moment we've got too many core warnings.
// To display warnings call: grunt eslint --show-lint-warnings
// To fail on warnings call: grunt eslint --max-lint-warnings=0
// Also --max-lint-warnings=-1 can be used to display warnings but not fail.
options: {
quiet: (!grunt.option('show-lint-warnings')) && (typeof grunt.option('max-lint-warnings') === 'undefined'),
maxWarnings: ((typeof grunt.option('max-lint-warnings') !== 'undefined') ? grunt.option('max-lint-warnings') : -1)
},
// Check AMD src files.
amd: {src: files ? files : grunt.moodleEnv.amdSrc},
// Check YUI module source files.
yui: {src: files ? files : grunt.moodleEnv.yuiSrc},
// Check React source files.
'react': {
options: {
fix: true,
},
src: files ? files : grunt.moodleEnv.reactSrc,
},
},
});
grunt.loadNpmTasks('grunt-eslint');
// On watch, we dynamically modify config to build only affected files. This
// method is slightly complicated to deal with multiple changed files at once (copied
// from the grunt-contrib-watch readme).
let changedFiles = Object.create(null);
const onChange = grunt.util._.debounce(function() {
const files = Object.keys(changedFiles);
grunt.config('eslint.amd.src', files);
grunt.config('eslint.yui.src', files);
changedFiles = Object.create(null);
}, 200);
grunt.event.on('watch', (action, filepath) => {
changedFiles[filepath] = action;
onChange();
});
};
-92
View File
@@ -1,92 +0,0 @@
// 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/>.
/* jshint node: true, browser: false */
/* eslint-env node */
/**
* @copyright 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
module.exports = grunt => {
/**
* Get the list of feature files to pass to the gherkin linter.
*
* @returns {Array}
*/
const getGherkinLintTargets = () => {
if (grunt.moodleEnv.files) {
// Specific files were requested. Only check these.
return grunt.moodleEnv.files;
}
if (grunt.moodleEnv.inComponent) {
return [`${grunt.moodleEnv.runDir}/tests/behat/*.feature`];
}
return ['**/tests/behat/*.feature'];
};
const handler = function() {
const done = this.async();
const options = grunt.config('gherkinlint.options');
// Grab the gherkin-lint linter and required scaffolding.
const linter = require('gherkin-lint/dist/linter.js');
const featureFinder = require('gherkin-lint/dist/feature-finder.js');
const configParser = require('gherkin-lint/dist/config-parser.js');
const formatter = require('gherkin-lint/dist/formatters/stylish.js');
// Run the linter.
return linter.lint(
featureFinder.getFeatureFiles(grunt.file.expand(options.files)),
configParser.getConfiguration(configParser.defaultConfigFileName)
)
.then(results => {
// Print the results out uncondtionally.
formatter.printResults(results);
return results;
})
.then(results => {
// Report on the results.
// The done function takes a bool whereby a falsey statement causes the task to fail.
return results.every(result => result.errors.length === 0);
})
.then(done); // eslint-disable-line promise/no-callback-in-promise
};
grunt.registerTask('gherkinlint', 'Run gherkinlint against the current directory', handler);
grunt.config.set('gherkinlint', {
options: {
files: getGherkinLintTargets(),
}
});
grunt.config.merge({
watch: {
gherkinlint: {
files: [grunt.moodleEnv.inComponent ? 'tests/behat/*.feature' : '**/tests/behat/*.feature'],
tasks: ['gherkinlint'],
},
},
});
// Add the 'gherkinlint' task as a startup task.
grunt.moodleEnv.startupTasks.push('gherkinlint');
return handler;
};
-139
View File
@@ -1,139 +0,0 @@
// 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/>.
/* jshint node: true, browser: false */
/* eslint-env node */
/**
* @copyright 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
module.exports = grunt => {
/**
* Generate the PHPCS configuration.
*
* @param {Object} thirdPartyPaths
*/
const phpcsIgnore = (thirdPartyPaths) => {
const {toXML} = require('jstoxml');
const config = {
_name: 'ruleset',
_attrs: {
name: "MoodleCore",
},
_content: [
{
rule: {
_attrs: {
ref: './phpcs.xml.dist',
},
},
},
],
};
thirdPartyPaths.forEach(library => {
config._content.push({
'exclude-pattern': library,
});
});
grunt.file.write('phpcs.xml', toXML(config, {
header: true,
indent: ' ',
}) + "\n");
};
/**
* Extracts ignore entries from a local ignore file.
*
* @param {string} componentPath the file path to the component, relative to the code base directory
* @param {string} ignoreFilePath the path to the ignore file
* @return {array} array of ignore paths to be included in the global ignore files
*/
const getEntriesFromLocalIgnoreFile = (componentPath, ignoreFilePath) => {
const ignorePaths = [];
if (grunt.file.exists(ignoreFilePath)) {
const ignoreFile = grunt.file.read(ignoreFilePath);
const entries = ignoreFile.split('\n');
entries.forEach(entry => {
entry = entry.trim();
if (entry.length > 0 && !entry.startsWith('#') && !entry.startsWith('!')) {
while (entry.startsWith('/')) {
entry = entry.substring(1);
}
ignorePaths.push(componentPath + '/' + entry);
}
});
}
return ignorePaths;
};
/**
* Generate ignore files (utilising thirdpartylibs.xml data)
*/
const handler = function() {
const path = require('path');
const ComponentList = require(path.join(process.cwd(), '.grunt', 'components.js'));
// An array of paths to third party directories.
const thirdPartyPaths = ComponentList.getThirdPartyPaths();
const localStylelintIgnorePaths = [];
const localEslintIgnorePaths = [];
ComponentList.getComponentPaths(process.cwd() + '/').forEach(componentPath => {
const localEslintIgnorePath = process.cwd() + '/' + componentPath + '/.eslintignore';
const localEslintIgnoreEntries = getEntriesFromLocalIgnoreFile(componentPath, localEslintIgnorePath);
if (localEslintIgnoreEntries.length > 0) {
localEslintIgnorePaths.push(...localEslintIgnoreEntries);
}
const localStylelintIgnorePath = process.cwd() + '/' + componentPath + '/.stylelintignore';
const localStylelintIgnoreEntries = getEntriesFromLocalIgnoreFile(componentPath, localStylelintIgnorePath);
if (localStylelintIgnoreEntries.length > 0) {
localStylelintIgnorePaths.push(...localStylelintIgnoreEntries);
}
});
// Generate .eslintignore.
const eslintIgnores = [
'# Generated by "grunt ignorefiles"',
// Do not ignore the .grunt directory.
'!/.grunt',
// Ignore all yui/src meta directories and build directories.
'*/**/yui/src/*/meta/',
'*/**/build/',
].concat(thirdPartyPaths).concat(localEslintIgnorePaths);
grunt.file.write('.eslintignore', eslintIgnores.join('\n') + '\n');
// Generate .stylelintignore.
const stylelintIgnores = [
'# Generated by "grunt ignorefiles"',
'**/yui/build/*',
'public/theme/boost/style/moodle.css',
'public/theme/classic/style/moodle.css',
'jsdoc/styles/*.css',
'public/admin/tool/componentlibrary/hugo/dist/css/docs.css',
].concat(thirdPartyPaths).concat(localStylelintIgnorePaths);
grunt.file.write('.stylelintignore', stylelintIgnores.join('\n') + '\n');
phpcsIgnore(thirdPartyPaths);
};
grunt.registerTask('ignorefiles', 'Generate ignore files for linters', handler);
return handler;
};
-218
View File
@@ -1,218 +0,0 @@
// 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/>.
/* jshint node: true, browser: false */
/* eslint-env node */
/**
* @copyright 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* Function to generate the destination for the minification task
* (e.g. build/file.min.js). This function will be passed to
* the rename property of files array when building dynamically:
* http://gruntjs.com/configuring-tasks#building-the-files-object-dynamically
*
* @param {String} destPath the current destination
* @param {String} srcPath the matched src path
* @return {String} The rewritten destination path.
*/
const babelRename = function(destPath, srcPath) {
destPath = srcPath.replace(`amd/src`, `amd/build`);
destPath = destPath.replace(/\.js$/, '.min.js');
return destPath;
};
module.exports = grunt => {
// Load the React build tasks.
require('./react')(grunt);
// Load the Ignorefiles tasks.
require('./ignorefiles')(grunt);
// Load the Shifter tasks.
require('./shifter')(grunt);
// Load ESLint.
require('./eslint')(grunt);
// Load jsconfig.
require('./jsconfig')(grunt);
// Load JSDoc.
require('./jsdoc')(grunt);
const path = require('path');
// Register JS tasks.
grunt.registerTask('yui', ['eslint:yui', 'shifter']);
grunt.registerTask('amd', ['ignorefiles', 'eslint:amd', 'rollup']);
grunt.registerTask('js', ['amd', 'yui', 'react']);
// Register NPM tasks.
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-rollup');
const babelTransform = require('@babel/core').transform;
const babel = (options = {}) => {
return {
name: 'babel',
transform: (code, id) => {
grunt.log.debug(`Transforming ${id}`);
options.filename = id;
const transformed = babelTransform(code, options);
return {
code: transformed.code,
map: transformed.map
};
}
};
};
// Note: We have to use a rate limit plugin here because rollup runs all tasks asynchronously and in parallel.
// When we kick off a full run, if we kick off a rollup of every file this will fork-bomb the machine.
// To work around this we use a concurrent Promise queue based on the number of available processors.
const rateLimit = () => {
const queue = [];
let queueRunner;
const startQueue = () => {
if (queueRunner) {
return;
}
queueRunner = setTimeout(() => {
const limit = Math.max(1, require('os').cpus().length / 2);
grunt.log.debug(`Starting rollup with queue size of ${limit}`);
runQueue(limit);
}, 100);
};
// The queue runner will run the next `size` items in the queue.
const runQueue = (size = 1) => {
queue.splice(0, size).forEach(resolve => {
grunt.log.debug(`Item resolved. Kicking off next one.`);
resolve();
});
};
return {
name: 'ratelimit',
// The options hook is run in parallel.
// We can return an unresolved Promise which is queued for later resolution.
options: async(options) => {
return new Promise(resolve => {
queue.push(resolve);
startQueue();
return options;
});
},
// When an item in the queue completes, start the next item in the queue.
generateBundle: (options, bundle) => {
grunt.log.debug(`Finished output phase for ${Object.keys(bundle).join(', ')}`);
runQueue();
},
};
};
const terser = require('rollup-plugin-terser').terser;
grunt.config.merge({
rollup: {
options: {
format: 'esm',
dir: 'output',
sourcemap: true,
treeshake: false,
context: 'window',
plugins: [
rateLimit(),
babel({
sourceMaps: true,
comments: false,
compact: false,
plugins: [
'transform-es2015-modules-amd-lazy',
'system-import-transformer',
// This plugin modifies the Babel transpiling for "export default"
// so that if it's used then only the exported value is returned
// by the generated AMD module.
//
// It also adds the Moodle plugin name to the AMD module definition
// so that it can be imported as expected in other modules.
path.resolve('.grunt/babel-plugin-add-module-to-define.js')
],
presets: [
['@babel/preset-env', {
modules: false,
useBuiltIns: false
}]
]
}),
terser({
// Do not mangle variables.
// Makes debugging easier.
mangle: false,
}),
],
},
dist: {
files: [{
expand: true,
src: grunt.moodleEnv.files ? grunt.moodleEnv.files : grunt.moodleEnv.amdSrc,
rename: babelRename
}],
},
},
});
grunt.config.merge({
watch: {
amd: {
files: grunt.moodleEnv.inComponent
? ['amd/src/*.js', 'amd/src/**/*.js']
: ['**/amd/src/**/*.js'],
tasks: ['amd']
},
},
});
// Add the 'js' task as a startup task.
grunt.moodleEnv.startupTasks.push('js');
// On watch, we dynamically modify config to build only affected files. This
// method is slightly complicated to deal with multiple changed files at once (copied
// from the grunt-contrib-watch readme).
let changedFiles = Object.create(null);
const onChange = grunt.util._.debounce(function() {
const files = Object.keys(changedFiles);
grunt.config('rollup.dist.files', [{expand: true, src: files, rename: babelRename}]);
changedFiles = Object.create(null);
}, 200);
grunt.event.on('watch', function(action, filepath) {
changedFiles[filepath] = action;
onChange();
});
return {
babelRename,
};
};
-83
View File
@@ -1,83 +0,0 @@
// 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/>.
/* jshint node: true, browser: false */
/* eslint-env node */
// @ts-nocheck
/**
* @copyright 2022 Andrew Lyons <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
const configuration = {
compilerOptions: {
baseUrl: ".",
paths: {
},
target: "es2015",
allowSyntheticDefaultImports: false,
},
exclude: [
"node_modules",
],
include: [],
};
/**
* Generate jsconfig.json with AMD module path aliases for all components.
*
* @param {object} grunt The Grunt instance.
*/
const generateJsconfig = (grunt) => {
const jsconfigData = Object.assign({}, configuration);
const path = require('path');
const {fetchComponentData} = require(path.join(process.cwd(), '.grunt', 'components.js'));
const componentData = fetchComponentData().components;
for (const [thisPath, component] of Object.entries(componentData)) {
jsconfigData.compilerOptions.paths[`${component}/*`] = [`${thisPath}/amd/src/*`];
jsconfigData.include.push(`${thisPath}/amd/src/**/*`);
}
grunt.file.write('jsconfig.json', JSON.stringify(jsconfigData, null, " ") + "\n");
grunt.log.write('✓ Generating jsconfig.json\n');
};
/**
* Generate tsconfig.aliases.json with TypeScript path aliases for all ESM components.
*
* @returns {Promise<void>}
*/
const generateTsAliases = async() => {
const {generateAliases} = await import('../../.esbuild/generate-aliases.mjs');
generateAliases();
};
module.exports = (grunt) => {
const handler = async function() {
const done = this.async();
try {
generateJsconfig(grunt);
await generateTsAliases();
done();
} catch (err) {
grunt.log.error(err.message);
done(false);
}
};
grunt.registerTask('jsconfig', 'Generate a jsconfig configuration compatible with the LSP', handler);
};
-52
View File
@@ -1,52 +0,0 @@
// 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/>.
/* jshint node: true, browser: false */
/* eslint-env node */
/**
* @copyright 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
module.exports = (grunt) => {
const path = require('path');
grunt.registerTask('jsdoc', 'Generate JavaScript documentation using jsdoc', function() {
const done = this.async();
const configuration = path.resolve('.grunt/jsdoc/jsdoc.conf.js');
grunt.util.spawn({
cmd: 'jsdoc',
args: [
'--configure',
configuration,
]
}, function(error, result, code) {
if (result.stdout) {
grunt.log.write(result.stdout);
}
if (result.stderr) {
grunt.log.error(result.stderr);
}
if (error) {
grunt.fail.fatal(`JSDoc failed with error code ${code}`);
} else {
grunt.log.write('JSDoc completed successfully'.green);
}
done();
});
});
};
-111
View File
@@ -1,111 +0,0 @@
// 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/>.
/* jshint node: true, browser: false */
/* eslint-env node */
// @ts-nocheck
/**
* Grunt tasks for building React components.
*
* @copyright Meirza <meirza.arson@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
module.exports = grunt => {
/**
* Register react task — build or watch React components.
*
* Modes:
* grunt react — production build
* grunt react:dev — development build (sourcemaps, no minification)
* grunt react:watch — esbuild native watch (dev mode, incremental context)
*
* Note: react:watch uses esbuild's own context.watch() and is intentionally
* separate from grunt-contrib-watch. This keeps esbuild's incremental build
* graph alive between rebuilds rather than restarting from scratch on each change.
*/
grunt.registerTask('react', 'Build all React components', function(mode) {
const done = this.async();
const isWatch = mode === 'watch';
const isDev = isWatch || mode === 'dev';
if (isWatch) {
const path = require('path');
const {spawn} = require('child_process');
// Run ESLint on the rebuilt source files in check-only mode (no --fix)
// to avoid writing changes that would re-trigger esbuild.
const eslintBin = path.join(grunt.moodleEnv.gruntFilePath, 'node_modules', '.bin', 'eslint');
const onRebuild = (srcFiles) => {
if (srcFiles.length === 0) {
return;
}
const absSrcFiles = srcFiles.map(f => path.join(grunt.moodleEnv.gruntFilePath, f));
spawn(eslintBin, absSrcFiles, {stdio: 'inherit'})
.on('error', err => grunt.log.error(`ESLint: ${err.message}`));
};
(async() => {
try {
const {watchComponents} = await import('../../.esbuild/plugin/plugincomponents.mjs');
const { generateAliases } = await import('../../.esbuild/generate-aliases.mjs');
const { buildPluginComponents } = await import('../../.esbuild/plugin/plugincomponents.mjs');
generateAliases();
await buildPluginComponents(isDev);
const ctx = await watchComponents(true, onRebuild);
if (!ctx) {
grunt.log.warn('No React source files found. Nothing to watch.');
done();
return;
}
grunt.log.ok('esbuild is watching for React changes. Press Ctrl+C to stop.');
// Keep the process alive until the user interrupts. done() is intentionally
// not called here — grunt's async mechanism holds the process open.
process.on('SIGINT', async() => {
await ctx.dispose();
done();
});
} catch (err) {
grunt.log.error(err.message);
done(false);
}
})();
return;
}
grunt.log.writeln(`Building React components in ${isDev ? 'DEVELOPMENT' : 'PRODUCTION'} mode...`);
(async() => {
try {
const {generateAliases} = await import('../../.esbuild/generate-aliases.mjs');
const {buildPluginComponents} = await import('../../.esbuild/plugin/plugincomponents.mjs');
generateAliases();
await buildPluginComponents(isDev);
done();
} catch (err) {
grunt.log.error(err.message);
done(false);
}
})();
});
};
-43
View File
@@ -1,43 +0,0 @@
// 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/>.
/* jshint node: true, browser: false */
/* eslint-env node */
/**
* @copyright 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
module.exports = grunt => {
grunt.loadNpmTasks('grunt-sass');
grunt.config.merge({
sass: {
dist: {
files: {
"public/theme/boost/style/moodle.css": "public/theme/boost/scss/preset/default.scss",
"public/theme/classic/style/moodle.css": "public/theme/classic/scss/classicgrunt.scss"
}
},
options: {
implementation: require('sass'),
includePaths: [
"public/theme/boost/scss/",
"public/theme/classic/scss/",
]
}
},
});
};
-155
View File
@@ -1,155 +0,0 @@
// 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/>.
/* jshint node: true, browser: false */
/* eslint-env node */
/**
* @copyright 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/* eslint-env node */
module.exports = grunt => {
/**
* Shifter task. Is configured with a path to a specific file or a directory,
* in the case of a specific file it will work out the right module to be built.
*
* Note that this task runs the invidiaul shifter jobs async (becase it spawns
* so be careful to to call done().
*/
const handler = function() {
const done = this.async();
const options = grunt.config('shifter.options');
const async = require('async');
const path = require('path');
// Run the shifter processes one at a time to avoid confusing output.
async.eachSeries(options.paths, function(src, filedone) {
var args = [];
args.push(path.normalize(process.cwd() + '/node_modules/shifter/bin/shifter'));
// Always ignore the node_modules directory.
args.push('--excludes', 'node_modules');
// Determine the most appropriate options to run with based upon the current location.
if (grunt.file.isMatch('**/yui/**/*.js', src)) {
// When passed a JS file, build our containing module (this happen with
// watch).
grunt.log.debug('Shifter passed a specific JS file');
src = path.dirname(path.dirname(src));
options.recursive = false;
} else if (grunt.file.isMatch('**/yui/src', src)) {
// When in a src directory --walk all modules.
grunt.log.debug('In a src directory');
args.push('--walk');
options.recursive = false;
} else if (grunt.file.isMatch('**/yui/src/*', src)) {
// When in module, only build our module.
grunt.log.debug('In a module directory');
options.recursive = false;
} else if (grunt.file.isMatch('**/yui/src/*/js', src)) {
// When in module src, only build our module.
grunt.log.debug('In a source directory');
src = path.dirname(src);
options.recursive = false;
}
if (grunt.option('watch')) {
grunt.fail.fatal('The --watch option has been removed, please use `grunt watch` instead');
}
// Add the stderr option if appropriate
if (grunt.option('verbose')) {
args.push('--lint-stderr');
}
if (grunt.option('no-color')) {
args.push('--color=false');
}
var execShifter = function() {
grunt.log.ok("Running shifter on " + src);
grunt.util.spawn({
cmd: "node",
args: args,
opts: {cwd: src, stdio: 'inherit', env: process.env}
}, function(error, result, code) {
if (code) {
grunt.fail.fatal('Shifter failed with code: ' + code);
} else {
grunt.log.ok('Shifter build complete.');
filedone();
}
});
};
// Actually run shifter.
if (!options.recursive) {
execShifter();
} else {
// Check that there are yui modules otherwise shifter ends with exit code 1.
if (grunt.file.expand({cwd: src}, '**/yui/src/**/*.js').length > 0) {
args.push('--recursive');
execShifter();
} else {
grunt.log.ok('No YUI modules to build.');
filedone();
}
}
}, done);
};
// Register the shifter task.
grunt.registerTask('shifter', 'Run Shifter against the current directory', handler);
// Configure it.
grunt.config.set('shifter', {
options: {
recursive: true,
// Shifter takes a relative path.
paths: grunt.moodleEnv.files ? grunt.moodleEnv.files : [grunt.moodleEnv.runDir]
}
});
grunt.config.merge({
watch: {
yui: {
files: grunt.moodleEnv.inComponent
? ['yui/src/*.json', 'yui/src/**/*.js']
: ['**/yui/src/**/*.js'],
tasks: ['yui']
},
},
});
// On watch, we dynamically modify config to build only affected files. This
// method is slightly complicated to deal with multiple changed files at once (copied
// from the grunt-contrib-watch readme).
let changedFiles = Object.create(null);
const onChange = grunt.util._.debounce(function() {
const files = Object.keys(changedFiles);
grunt.config('shifter.options.paths', files);
changedFiles = Object.create(null);
}, 200);
grunt.event.on('watch', (action, filepath) => {
changedFiles[filepath] = action;
onChange();
});
return handler;
};
-49
View File
@@ -1,49 +0,0 @@
// 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/>.
/* jshint node: true, browser: false */
/* eslint-env node */
/**
* @copyright 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
module.exports = grunt => {
/**
* Generate ignore files (utilising thirdpartylibs.xml data)
*/
const handler = function() {
const path = require('path');
// Are we in a YUI directory?
if (path.basename(path.resolve(grunt.moodleEnv.cwd, '../../')) == 'yui') {
grunt.task.run('yui');
// Are we in an AMD directory?
} else if (grunt.moodleEnv.inAMD) {
grunt.task.run('amd');
// Are we in an ESM source directory?
} else if (grunt.moodleEnv.inEsm) {
grunt.task.run('react');
} else {
// Run all of the requested startup tasks.
grunt.moodleEnv.startupTasks.forEach(taskName => grunt.task.run(taskName));
}
};
// Register the startup task.
grunt.registerTask('startup', 'Run the correct tasks for the current directory', handler);
return handler;
};
-35
View File
@@ -1,35 +0,0 @@
// 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/>.
/* jshint node: true, browser: false */
/* eslint-env node */
/**
* @copyright 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
module.exports = grunt => {
// Load the ignorefiles tasks.
require('./ignorefiles')(grunt);
// Load the Style Lint tasks.
require('./stylelint')(grunt);
// Load the SASS tasks.
require('./sass')(grunt);
// Add the 'css' task as a startup task.
grunt.moodleEnv.startupTasks.push('css');
};
-187
View File
@@ -1,187 +0,0 @@
// 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/>.
/* jshint node: true, browser: false */
/* eslint-env node */
/**
* @copyright 2021 Andrew Nicols
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
module.exports = grunt => {
const getCssConfigForFiles = files => {
return {
stylelint: {
css: {
// Use a fully-qualified path.
src: files,
options: {
quietDeprecationWarnings: true,
configOverrides: {
rules: {
// These rules have to be disabled in .stylelintrc for scss compat.
"at-rule-no-unknown": true,
}
}
}
},
},
};
};
const getScssConfigForFiles = files => {
return {
stylelint: {
scss: {
options: {
quietDeprecationWarnings: true,
customSyntax: 'postcss-scss',
},
src: files,
},
},
};
};
/**
* Register any stylelint tasks.
*
* @param {Object} grunt
* @param {Array} files
* @param {String} fullRunDir
*/
const registerStyleLintTasks = () => {
const glob = require('glob');
// The stylelinters do not handle the case where a configuration was provided but no files were included.
// Keep track of whether any files were found.
let hasCss = false;
let hasScss = false;
// The stylelint processors do not take a path argument. They always check all provided values.
// As a result we must check through each glob and determine if any files match the current directory.
const scssFiles = [];
const cssFiles = [];
const requestedFiles = grunt.moodleEnv.files;
if (requestedFiles) {
// Grunt was called with a files argument.
// Check whether each of the requested files matches either the CSS or SCSS source file list.
requestedFiles.forEach(changedFilePath => {
let matchesGlob;
// Check whether this watched path matches any watched SCSS file.
matchesGlob = grunt.moodleEnv.scssSrc.some(watchedPathGlob => {
return glob.sync(watchedPathGlob).indexOf(changedFilePath) !== -1;
});
if (matchesGlob) {
scssFiles.push(changedFilePath);
hasScss = true;
}
// Check whether this watched path matches any watched CSS file.
matchesGlob = grunt.moodleEnv.cssSrc.some(watchedPathGlob => {
return glob.sync(watchedPathGlob).indexOf(changedFilePath) !== -1;
});
if (matchesGlob) {
cssFiles.push(changedFilePath);
hasCss = true;
}
});
} else {
// Grunt was called without a list of files.
// The start directory (runDir) may be a child dir of the project.
// Check each scssSrc file to see if it's in the start directory.
// This means that we can lint just mod/*/styles.css if started in the mod directory.
grunt.moodleEnv.scssSrc.forEach(path => {
if (path.startsWith(grunt.moodleEnv.runDir)) {
scssFiles.push(path);
hasScss = true;
}
});
grunt.moodleEnv.cssSrc.forEach(path => {
if (path.startsWith(grunt.moodleEnv.runDir)) {
cssFiles.push(path);
hasCss = true;
}
});
}
// Register the tasks.
const scssTasks = ['sass'];
if (hasScss) {
grunt.config.merge(getScssConfigForFiles(scssFiles));
scssTasks.unshift('stylelint:scss');
}
scssTasks.unshift('ignorefiles');
const cssTasks = ['ignorefiles'];
if (hasCss) {
grunt.config.merge(getCssConfigForFiles(cssFiles));
cssTasks.push('stylelint:css');
}
// The tasks must be registered, even if empty to ensure a consistent command list.
// They jsut won't run anything.
grunt.registerTask('scss', scssTasks);
grunt.registerTask('rawcss', cssTasks);
};
// Register CSS tasks.
grunt.loadNpmTasks('grunt-stylelint');
// Register the style lint tasks.
registerStyleLintTasks();
grunt.registerTask('css', ['scss', 'rawcss']);
const getCoreThemeMatches = () => {
const scssMatch = 'scss/**/*.scss';
if (grunt.moodleEnv.inTheme) {
return [scssMatch];
}
if (grunt.moodleEnv.runDir.startsWith('theme')) {
return [`*/${scssMatch}`];
}
return [`theme/*/${scssMatch}`];
};
// Add the watch configuration for rawcss, and scss.
grunt.config.merge({
watch: {
rawcss: {
files: [
'**/*.css',
],
excludes: [
'**/moodle.css',
'**/editor.css',
'jsdoc/styles/*.css',
],
tasks: ['rawcss']
},
scss: {
files: getCoreThemeMatches(),
tasks: ['scss']
},
},
});
};
-42
View File
@@ -1,42 +0,0 @@
// 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/>.
/* jshint node: true, browser: false */
/* eslint-env node */
/**
* @copyright 2023 Sara Arjona <sara@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
module.exports = grunt => {
/**
* Generate upgradable third-party libraries (utilising thirdpartylibs.xml data)
*/
grunt.registerTask('upgradablelibs', 'Generate upgradable third-party libraries', async function() {
const done = this.async();
const path = require('path');
const ComponentList = require(path.join(process.cwd(), '.grunt', 'components.js'));
// An array of third party libraries that have a newer version in their repositories.
const thirdPartyLibs = await ComponentList.getThirdPartyLibsUpgradable({progress: true});
for (let library of thirdPartyLibs) {
grunt.log.ok(JSON.stringify(Object.assign({}, library), null, 4));
}
done();
});
};
-276
View File
@@ -1,276 +0,0 @@
/**
* This is a wrapper task to handle the grunt watch command. It attempts to use
* Watchman to monitor for file changes, if it's installed, because it's much faster.
*
* If Watchman isn't installed then it falls back to the grunt-contrib-watch file
* watcher for backwards compatibility.
*/
/* eslint-env node */
module.exports = grunt => {
/**
* This is a wrapper task to handle the grunt watch command. It attempts to use
* Watchman to monitor for file changes, if it's installed, because it's much faster.
*
* If Watchman isn't installed then it falls back to the grunt-contrib-watch file
* watcher for backwards compatibility.
*/
const watchHandler = function() {
const async = require('async');
const watchTaskDone = this.async();
let watchInitialised = false;
let watchTaskQueue = {};
let processingQueue = false;
const watchman = require('fb-watchman');
const watchmanClient = new watchman.Client();
// Grab the tasks and files that have been queued up and execute them.
var processWatchTaskQueue = function() {
if (!Object.keys(watchTaskQueue).length || processingQueue) {
// If there is nothing in the queue or we're already processing then wait.
return;
}
processingQueue = true;
// Grab all tasks currently in the queue.
var queueToProcess = watchTaskQueue;
// Reset the queue.
watchTaskQueue = {};
async.forEachSeries(
Object.keys(queueToProcess),
function(task, next) {
var files = queueToProcess[task];
var filesOption = '--files=' + files.join(',');
grunt.log.ok('Running task ' + task + ' for files ' + filesOption);
// Spawn the task in a child process so that it doesn't kill this one
// if it failed.
var args = [task, filesOption];
if (grunt.option('force')) {
args.push('--force');
}
grunt.util.spawn(
{
// Spawn with the grunt bin.
grunt: true,
// Run from current working dir and inherit stdio from process.
opts: {
cwd: grunt.moodleEnv.fullRunDir,
stdio: 'inherit'
},
args: args
},
function(err, res, code) {
if (code !== 0) {
// The grunt task failed.
grunt.log.error(err);
}
// Move on to the next task.
next();
}
);
},
function() {
// No longer processing.
processingQueue = false;
// Once all of the tasks are done then recurse just in case more tasks
// were queued while we were processing.
processWatchTaskQueue();
}
);
};
const originalWatchConfig = grunt.config.get(['watch']);
const watchConfig = Object.keys(originalWatchConfig).reduce(function(carry, key) {
if (key == 'options') {
return carry;
}
const value = originalWatchConfig[key];
const taskNames = value.tasks;
const files = value.files;
let excludes = [];
if (value.excludes) {
excludes = value.excludes;
}
taskNames.forEach(function(taskName) {
carry[taskName] = {
files,
excludes,
};
});
return carry;
}, {});
watchmanClient.on('error', function(error) {
// We have to add an error handler here and parse the error string because the
// example way from the docs to check if Watchman is installed doesn't actually work!!
// See: https://github.com/facebook/watchman/issues/509
if (error.message.match('Watchman was not found')) {
// If watchman isn't installed then we should fallback to the other watch task.
grunt.log.ok('It is recommended that you install Watchman for better performance using the "watch" command.');
// Fallback to the old grunt-contrib-watch task.
grunt.renameTask('watch-grunt', 'watch');
grunt.task.run(['watch']);
// This task is finished.
watchTaskDone(0);
} else {
grunt.log.error(error);
// Fatal error.
watchTaskDone(1);
}
});
watchmanClient.on('subscription', function(resp) {
if (resp.subscription !== 'grunt-watch') {
return;
}
resp.files.forEach(function(file) {
grunt.log.ok('File changed: ' + file.name);
var fullPath = grunt.moodleEnv.fullRunDir + '/' + file.name;
Object.keys(watchConfig).forEach(function(task) {
const fileGlobs = watchConfig[task].files;
var match = fileGlobs.some(function(fileGlob) {
return grunt.file.isMatch(`**/${fileGlob}`, fullPath);
});
if (match) {
// If we are watching a subdirectory then the file.name will be relative
// to that directory. However the grunt tasks expect the file paths to be
// relative to the Gruntfile.js location so let's normalise them before
// adding them to the queue.
var relativePath = fullPath.replace(grunt.moodleEnv.gruntFilePath + '/', '');
if (task in watchTaskQueue) {
if (!watchTaskQueue[task].includes(relativePath)) {
watchTaskQueue[task] = watchTaskQueue[task].concat(relativePath);
}
} else {
watchTaskQueue[task] = [relativePath];
}
}
});
});
processWatchTaskQueue();
});
process.on('SIGINT', function() {
// Let the user know that they may need to manually stop the Watchman daemon if they
// no longer want it running.
if (watchInitialised) {
grunt.log.ok('The Watchman daemon may still be running and may need to be stopped manually.');
}
process.exit();
});
// Initiate the watch on the current directory.
watchmanClient.command(['watch-project', grunt.moodleEnv.fullRunDir], function(watchError, watchResponse) {
if (watchError) {
grunt.log.error('Error initiating watch:', watchError);
watchTaskDone(1);
return;
}
if ('warning' in watchResponse) {
grunt.log.error('warning: ', watchResponse.warning);
}
var watch = watchResponse.watch;
var relativePath = watchResponse.relative_path;
watchInitialised = true;
watchmanClient.command(['clock', watch], function(clockError, clockResponse) {
if (clockError) {
grunt.log.error('Failed to query clock:', clockError);
watchTaskDone(1);
return;
}
// Generate the expression query used by watchman.
// Documentation is limited, but see https://facebook.github.io/watchman/docs/expr/allof.html for examples.
// We generate an expression to match any value in the files list of all of our tasks, but excluding
// all value in the excludes list of that task.
//
// [anyof, [
// [allof, [
// [anyof, [
// ['match', validPath, 'wholename'],
// ['match', validPath, 'wholename'],
// ],
// [not,
// [anyof, [
// ['match', invalidPath, 'wholename'],
// ['match', invalidPath, 'wholename'],
// ],
// ],
// ],
var matchWholeName = fileGlob => ['match', fileGlob, 'wholename'];
var matches = Object.keys(watchConfig).map(function(task) {
const matchAll = [];
matchAll.push(['anyof'].concat(watchConfig[task].files.map(matchWholeName)));
if (watchConfig[task].excludes.length) {
matchAll.push(['not', ['anyof'].concat(watchConfig[task].excludes.map(matchWholeName))]);
}
return ['allof'].concat(matchAll);
});
matches = ['anyof'].concat(matches);
var sub = {
expression: matches,
// Which fields we're interested in.
fields: ["name", "size", "type"],
// Add our time constraint.
since: clockResponse.clock
};
if (relativePath) {
/* eslint-disable camelcase */
sub.relative_root = relativePath;
}
watchmanClient.command(['subscribe', watch, 'grunt-watch', sub], function(subscribeError) {
if (subscribeError) {
// Probably an error in the subscription criteria.
grunt.log.error('failed to subscribe: ', subscribeError);
watchTaskDone(1);
return;
}
grunt.log.ok('Listening for changes to files in ' + grunt.moodleEnv.fullRunDir);
});
});
});
};
// Rename the grunt-contrib-watch "watch" task because we're going to wrap it.
grunt.renameTask('watch', 'watch-grunt');
// Register the new watch handler.
grunt.registerTask('watch', 'Run tasks on file changes', watchHandler);
grunt.config.merge({
watch: {
options: {
nospawn: true // We need not to spawn so config can be changed dynamically.
},
},
});
return watchHandler;
};
-111
View File
@@ -1,111 +0,0 @@
#!/usr/bin/env node
// 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/>.
import { Argument, Option, program } from 'commander';
import chalk from 'chalk';
import { getNoteNames } from './notes/src/noteTypes.mjs';
import createAction from './notes/src/create.mjs';
import generateAction from './notes/src/generate.mjs';
import generateReleaseNotesLinks from './notes/src/releasenotes.mjs';
import logger from './notes/src/logger.mjs';
console.log(`
${chalk.bold(chalk.underline(chalk.green('Moodle Upgrade Notes Generator')))}
This tool is used to generate the upgrade notes for changes you make in Moodle.
Please remember that the intended audience of these changes is
${chalk.italic('plugin developers')} who need to know how to update their plugins
for a new Moodle version.
Upgrade notes should not be used to document changes for site administrators, or
for internal API changes which are not expected to be used outside of the
relevant component.
`)
program.configureHelp({
helpWidth: 100,
});
program.on('option:verbose', () => {
logger.level = 'verbose';
});
program.addOption(
new Option(
'-v, --verbose',
'Output more information during the generation process',
)
.default(false)
);
// Define the command line options.
program
.command('create')
.summary('Generate a new upgrade note')
.addOption(
new Option('-t, --type <type>', `The type of change to document. Valid types are: ${getNoteNames().join(', ')}`)
)
.addOption(new Option('-i, --issue <issue>', 'The tracker issue number'))
.addOption(new Option('-c, --component <component>', 'The component to write a note for'))
.addOption(new Option(
'-m, --message <message>',
'The message to use for the upgrade note',
))
.action((options) => createAction(options));
program
.command('summary')
.summary('Generate a local copy of the upgrade notes summary')
.addArgument(
new Argument('[version]', 'The Moodle version to create the summary notes for')
)
.action((version) => generateAction(version));
program
.command('releasenotes')
.summary('Generate a list of upgrade notes for individual components in markdown format for the release notes')
.addArgument(
new Argument('[tag]', 'The Moodle tag')
)
.action((tag) => generateReleaseNotesLinks(tag));
program
.command('release')
.summary('Generate the markdown copies of the upgrade notes for a Moodle release')
.addArgument(
new Argument('[version]', 'The Moodle version to create the release notes for')
)
.addOption(
new Option(
'--generate-upgrade-notes',
'Generate the UPGRADING.md notes for the release. ' +
'Note: This option is intended for use by the release manager when generating the upgrade notes.',
)
.default(true)
)
.addOption(
new Option(
'-d, --delete-notes',
'Delete the notes after generating the UPGRADING.md notes for the release. ' +
'Note: This option is intended for use by the release manager when generating the upgrade notes.' +
'This option has no effect unless --generate-upgrade-notes is also set.'
)
.default(false)
)
.action((version, options) => generateAction(version, options));
program.parse();
-2
View File
@@ -1,2 +0,0 @@
**/amd/**
/*.js
+22 -32
View File
@@ -1,58 +1,48 @@
// NOTE: We use eslint now. This file is used only by shifter. We keep the configuration
// here because shifter uses jshint after modules have been concating. Eslint can't
// currently do this.
{
"asi": false,
"bitwise": true,
"boss": false,
"browser": true,
"yui": true,
"bitwise": true,
"curly": true,
"eqeqeq": true,
"forin": false,
"immed": true,
"newcap": true,
"noarg": true,
"noempty": true,
"nomen": false,
"onevar": false,
"plusplus": false,
"regexp": false,
"strict": false,
"trailing": true,
"unused": true,
"white": false,
"asi": false,
"boss": false,
"debug": false,
"eqeqeq": false,
"eqnull": false,
"es5": false,
"esnext": false,
"evil": false,
"expr": false,
"forin": false,
"funcscope": false,
"globalstrict": false,
"immed": true,
"indent": 4,
"iterator": false,
"lastsemic": false,
"latedef": true,
"laxbreak": true,
"laxcomma": false,
"loopfunc": false,
"maxerr": 500,
"maxlen": 132,
"multistr": false,
"newcap": true,
"noarg": true,
"noempty": true,
"nomen": false,
"onecase": false,
"onevar": false,
"passfail": false,
"plusplus": false,
"predef": [
"M",
"define",
"require"
],
"proto": false,
"regexdash": false,
"regexp": false,
"scripturl": false,
"shadow": false,
"smarttabs": false,
"strict": false,
"sub": false,
"supernew": false,
"trailing": true,
"undef": true,
"unused": true,
"white": false,
"yui": true
"maxerr": 500,
"maxlen": 180,
"passfail": false,
"latedef": true
}
-1
View File
@@ -1 +0,0 @@
lts/jod
-40
View File
@@ -1,40 +0,0 @@
<?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/>.
/**
* Helper file for PhpStorm, and other IDEs, to provide better code completion.
*
* @package core
* @copyright 2024 Andrew Lyons <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace PHPSTORM_META;
// Assume that anything returned by \core\di::get('...') is an instance of the first argument.
override(\core\di::get(0), map([
'' => '@',
]));
// Assume that anything returned by \Psr\Container\ContainerInterface::get('...') is an instance of the first argument.
override(\Psr\Container\ContainerInterface::get(0), map([
'' => '@',
]));
// Assume that anything returned by \DI\Container::get('...') is an instance of the first argument.
override(\DI\Container::get(0), map([
'' => '@',
]));
-107
View File
@@ -1,107 +0,0 @@
{
"customSyntax": "postcss-scss",
"plugins": [
"stylelint-csstree-validator"
],
"rules": {
"csstree/validator": {
"syntaxExtensions": [
"sass"
]
},
"at-rule-empty-line-before": [ "always",
{"except": [ "blockless-after-blockless"], ignore: ["after-comment", "inside-block"]}
],
"at-rule-name-case": "lower",
"at-rule-name-space-after": "always-single-line",
"at-rule-no-unknown": null, # Enabled for non-scss in grunt.
"at-rule-semicolon-newline-after": "always",
"at-rule-semicolon-space-before": "never",
"block-closing-brace-newline-after": "always",
"block-closing-brace-newline-before": "always",
"block-closing-brace-space-before": "always-single-line",
"block-no-empty": true,
"block-opening-brace-newline-after": "always",
"block-opening-brace-space-after": "always-single-line",
"block-opening-brace-space-before": "always",
"color-hex-case": ["lower", { "severity": "warning" }],
"color-hex-length": ["short", { "severity": "warning" }],
"color-no-invalid-hex": true,
"declaration-bang-space-after": "never",
"declaration-bang-space-before": "always",
"declaration-block-no-duplicate-properties": true,
"declaration-block-no-shorthand-property-overrides": true,
"declaration-block-semicolon-newline-after": "always-multi-line",
"declaration-block-semicolon-space-after": "always-single-line",
"declaration-block-semicolon-space-before": "never",
"declaration-block-single-line-max-declarations": 1,
"declaration-block-trailing-semicolon": "always",
"declaration-colon-newline-after": "always-multi-line",
"declaration-colon-space-after": "always-single-line",
"declaration-colon-space-before": "never",
"declaration-no-important": true,
"font-family-no-duplicate-names": true,
"function-calc-no-unspaced-operator": true,
"function-comma-newline-after": "always-multi-line",
"function-comma-space-after": "always-single-line",
"function-comma-space-before": "never",
"function-linear-gradient-no-nonstandard-direction": true,
"function-max-empty-lines": 0,
"function-name-case": "lower",
"function-parentheses-newline-inside": "always-multi-line",
"function-parentheses-space-inside": "never-single-line",
"function-url-scheme-disallowed-list": ["data"],
"function-whitespace-after": "always",
"indentation": 4,
"keyframe-declaration-no-important": true,
"length-zero-no-unit": [true, { "severity": "warning" }],
"max-empty-lines": 2,
"max-line-length": [132, { "severity": "warning" }],
"media-feature-colon-space-after": "always",
"media-feature-colon-space-before": "never",
"media-feature-parentheses-space-inside": "never",
"media-feature-range-operator-space-after": "always",
"media-feature-range-operator-space-before": "always",
"media-query-list-comma-newline-after": "always-multi-line",
"media-query-list-comma-space-after": "always-single-line",
"media-query-list-comma-space-before": "never",
"no-empty-source": true,
"no-eol-whitespace": true,
"no-extra-semicolons": [true, { "severity": "warning" }],
"no-invalid-double-slash-comments": true,
"no-unknown-animations": true,
"property-case": "lower",
"property-no-unknown": true,
"selector-attribute-brackets-space-inside": "never",
"selector-attribute-operator-space-after": "never",
"selector-attribute-operator-space-before": "never",
"selector-combinator-space-after": "always",
"selector-combinator-space-before": "always",
"selector-list-comma-newline-after": "always",
"selector-list-comma-space-before": "never",
"selector-max-empty-lines": 0,
"selector-pseudo-class-case": "lower",
"selector-pseudo-class-no-unknown": true,
"selector-pseudo-class-parentheses-space-inside": "never",
"selector-pseudo-element-case": "lower",
"selector-pseudo-element-no-unknown": true,
"selector-type-case": "lower",
"selector-type-no-unknown": true,
"string-no-newline": true,
"time-min-milliseconds": 100,
"unit-disallowed-list": ["pt"],
"unit-case": "lower",
"unit-no-unknown": true,
"value-keyword-case": ["lower", {"ignoreKeywords": ["/(@|$)/"]}],
"value-list-comma-newline-after": "always-multi-line",
"value-list-comma-space-after": "always-single-line",
"value-list-comma-space-before": "never",
},
"overrides": [
{
"files": ["**/yui/**/*.css"],
"rules": {
}
}
]
}
@@ -1,7 +0,0 @@
issueNumber: MDL-51152
notes:
enrol_manual:
- message: >-
The unused parameter 'roleid' has been removed from the external
function `unenrol_users()`
type: removed
@@ -1,22 +0,0 @@
issueNumber: MDL-71368
notes:
core:
- message: >
The `arg_separator.output` has been changed from a default of `amp;` to
a default of `&` in line with PHP defaults.
If you were previously relying on the legacy default when using
`http_build_query()` then you should _actively_ specify the value as the
third
parameter, for example:
```
http_build_query($formdata, '', '&amp;');
```
type: changed
@@ -1,8 +0,0 @@
issueNumber: MDL-73602
notes:
core:
- message: >-
Removed `qtype_random` from core.
`core\component::is_valid_plugin_name` has an additional check to ensure no-one can create a new plugin called qtype_random,
as this would conflict with the support for restoring old backups.
type: removed
@@ -1,8 +0,0 @@
issueNumber: MDL-75067
notes:
tool_behat:
- message: >-
The `behat_session_trait::ensure_element_[does_not_]exists(...)` methods
now accept optional `$container` parameter to define the parent node to
look within
type: improved
@@ -1,5 +0,0 @@
issueNumber: MDL-77894
notes:
core:
- message: Appending an exclamation mark to template names ignores theme overrides
type: improved
@@ -1,10 +0,0 @@
issueNumber: MDL-78325
notes:
core_grades:
- message: >-
In Moodle 4.2, the legacy Gradebook base widget from 4.1 has been removed and
replaced with a simpler class-based system due to a breaking change and
excessive complexity in the old pattern. The files `core/grades/basewidget.js` and
templates in `grade/templates/searchwidget/` have been deleted,
with minimal expected third-party impact.
type: removed
@@ -1,13 +0,0 @@
issueNumber: MDL-79182
notes:
core:
- message: >
The following AMD modules have been removed following the final
deprecation process. It is no longer possible or necessary to manually
register modal types. See MDL-78324 for further details.
- `core/modal_registry`
- `core/modal_factory`
type: removed
@@ -1,7 +0,0 @@
issueNumber: MDL-79574
notes:
core:
- message: >-
The `\core\persistent::get_records(...)` class method now returns
instances keyed by record ID
type: changed
@@ -1,13 +0,0 @@
issueNumber: MDL-81514
notes:
core_group:
- message: >
`groups_print_activity_menu()` and `groups_get_activity_group()` now
include an additional `$participationonly` parameter, which is true by
default. This can be set false when we want the user to be able to
select a non-participation group within an activity, for example if a
teacher wants to filter assignment submissions by non-participation
groups. It should never be used when the menu is displayed to students,
as this may allow them to participate using non-participation groups.
Non-participation groups are labeled as such.
type: improved
@@ -1,8 +0,0 @@
issueNumber: MDL-81608
notes:
mod_quiz:
- message: >-
The language strings `addpagebreak` and `removepagebreak` have been
deprecated and should no longer be used. These have been replaced by
the `addpagebreakafter` and `removepagebreakafter` language strings.
type: deprecated
@@ -1,12 +0,0 @@
issueNumber: MDL-81961
notes:
core_question:
- message: |
core_question:
- message: |
Final deprecation of `moodle-question-chooser` YUI module.
type: removed
- message: |
Final deprecation of `core_question/qbank_chooser` template.
type: removed
type: removed
-13
View File
@@ -1,13 +0,0 @@
issueNumber: MDL-81962
notes:
core:
- message: The `moodle-core-notification-confirm` YUI module has been removed after an extensive deprecation period. Please use the AMD `core/modal` module as a replacement.
type: removed
- message: |
The following feaetures of the `moodle-core-notification` YUI module have been removed after an extensive deprecation process.:
- method: `keyDelegation`
- property: `lightbox`
There is no direct replacement for these features, but they were not widely used and their removal should not cause significant issues. If you were using these features, you will need to implement your own solutions for key delegation and lightbox functionality.
type: removed
@@ -1,7 +0,0 @@
issueNumber: MDL-82284
notes:
core:
- message: >-
Legacy constructors have been removed. These relate to PHP 4 and
earlier.
type: removed
@@ -1,15 +0,0 @@
issueNumber: MDL-83902
notes:
core_badges:
- message: >-
The following classes and functions are now also available in the following new
locations. They will continue to work in their old locations:
| Old classname/function | New classname/function |
| --- | --- |
| `\badge_award_selector_base` | `\core_badges\award_selector_base` |
| `\badge_potential_users_selector` | `\core_badges\potential_award_selector` |
| `\badge_existing_users_selector` | `\core_badges\existing_award_selector` |
| `process_manual_award()` | `\core_badges\award_manager::process_manual_award()` |
| `process_manual_revoke()` | `\core_badges\award_manager::process_manual_revoke()` |
type: improved
@@ -1,7 +0,0 @@
issueNumber: MDL-84082
notes:
core_reportbuilder:
- message: >-
The text filter "Contains" and "Not contains" operators now support `*`
and `?` wildcard characters for better text content filtering
type: improved
@@ -1,30 +0,0 @@
issueNumber: MDL-84960
notes:
core:
- message: >-
Several core web services now include a new initials field in user data
structures. This change is backward-compatible and only adds an optional
field; no existing fields or field semantics have been changed.
Client applications should ensure they can handle the additional initials
field in web service responses, but clients that ignore unknown fields can
continue working without changes. The affected web services are:
- core_enrol_get_enrolled_users
- core_enrol_get_enrolled_users_with_capability
- core_enrol_get_potential_users
- core_enrol_search_users
- core_user_get_users_by_field
- core_user_get_users
- core_user_get_course_user_profiles
- core_grades_get_enrolled_users_for_selector
- core_grades_get_gradable_users
- gradereport_grader_get_users_in_report
- core_message_get_contact_requests
- core_message_get_conversation_members
- core_message_message_search_users
- core_message_get_user_contacts
- core_message_get_member_info
- core_message_get_conversation_messages
- mod_assign_list_participants
- mod_assign_get_participant
- mod_forum_get_forum_discussions
type: improved
@@ -1,9 +0,0 @@
issueNumber: MDL-85233
notes:
core_filters:
- message: >-
MimeTeX support has been removed from both `filter_tex` and
`filter_algebra`. These filters now depend on LaTeX tools (`latex`,
`dvips`, and `convert`/`dvisvgm`), and as a result, the `pathmimetex`
setting has been removed.
type: removed
@@ -1,8 +0,0 @@
issueNumber: MDL-85322
notes:
block_html:
- message: >-
Treat Dashboard (pagetype 'my-index') as trusted in web services so
get_content_for_external preserves embedded HTML (e.g. iframes) on user
Dashboard.
type: changed
@@ -1,8 +0,0 @@
issueNumber: MDL-85336
notes:
core:
- message: >-
Redis connection timeout settings for cachestores and sessions have been
split into connection timeout and read timeout to allow for finer
control. These settings now also accept floats.
type: improved
@@ -1,9 +0,0 @@
issueNumber: MDL-85405
notes:
core_course:
- message: >-
The external function `core_course_get_course_contents` now includes the
`candisplay` property for each returned module. If this is false, the
module should not be displayed on the course page (for example, for
question banks).
type: improved
@@ -1,5 +0,0 @@
issueNumber: MDL-85621
notes:
core_badges:
- message: The create_issued_badge generator now returns the issued badge object.
type: changed
@@ -1,11 +0,0 @@
issueNumber: MDL-85621
notes:
core_badges:
- message: >-
The class core_badges_assertion has been deprecated and replaced by
\core_badges\achievement_credential.
The method badges_get_default_issuer() has also been deprecated because
it is no longer needed.
The file badges/endorsement.php has been removed because it stopped being used
when MDL-84323 was integrated.
type: deprecated
@@ -1,17 +0,0 @@
issueNumber: MDL-85975
notes:
core:
- message: >
`restore_qtype_plugin::unset_excluded_fields` now returns the modified
questiondata structure,
in order to support structures that contain arrays.
If your qtype plugin overrides
`restore_qtype_plugin::remove_excluded_question_data` without
calling the parent method, you may need to modify your overridden method
to use the returned
value.
type: fixed
@@ -1,8 +0,0 @@
issueNumber: MDL-86332
notes:
core_completion:
- message: >-
The `completion_info::clear_criteria` method takes an optional
`$removetypecriteria` to determine whether to remove course type
criteria from other courses that refer to the current course
type: changed
@@ -1,26 +0,0 @@
issueNumber: MDL-86493
notes:
mod_quiz:
- message: >-
The quiz overrides cache implementation has been replaced with a faster alternative with a different API.
This should be a transparent change but any direct references will still need to be updated.
type: deprecated
- message: >
`mod_quiz_cm_info_dynamic()` now uses the new `quiz_overrides` cache via `override_manager`, performing a single cache fetch per quiz/user.
This significantly reduces cache calls on course pages with many quizzes and groups.
The new `mod_quiz:quiz_overrides` cache is keyed by `quizid_userid` using datasource `\mod_quiz\cache\quiz_overrides_cache`.
This cache returns all applicable overrides for a user in a quiz (the user override, if any, plus all group overrides for groups they belong to in the quiz's course).
New class `\mod_quiz\local\quiz_overrides_cache_manager` to interact with the cache:
- `get_overrides(int $quizid, int $userid): array`
- `purge_for_user(int $quizid, int $userid): void`
- `purge_for_users(int $quizid, array $userids): void`
- `purge_for_group(int $quizid, int $groupid): void`
- `purge_for_group_members(int $groupid, array $userids): void`
Hook callbacks in `db/hooks.php` to keep the cache in sync with group
membership changes:
- `\core_group\hook\after_group_membership_added`
- `\core_group\hook\after_group_membership_removed`
type: improved
@@ -1,12 +0,0 @@
issueNumber: MDL-86524
notes:
core_question:
- message: >-
During restore of a question_set_reference, mapping of IDs in the
filtercondition is now delegated to qbank plugins.
If your qbank plugin defines a filter condition that uses database
IDs, add an override of `restore_filtercondition()` to the `condition`
class, which checks the condition's data and replaces the IDs with
mapped values if required. See
`qbank_managecategories\category_condition` for an example.
type: improved
@@ -1,7 +0,0 @@
issueNumber: MDL-86607
notes:
mod_feedback:
- message: >-
The method `feedback_init_feedback_session()` has been deprecated, along
with all other direct access to `$SESSION` from the module
type: deprecated
@@ -1,7 +0,0 @@
issueNumber: MDL-86660
notes:
core_courseformat:
- message: >-
The `$cm` attribute in `activityoverviewbase` has been updated to public
visibility, allowing direct access to the course module instance
type: changed
@@ -1,8 +0,0 @@
issueNumber: MDL-86660
notes:
core_courseformat:
- message: >-
A new `available` attribute has been added to `activityname_exporter`
class. It allows the external API to return the activity's availability
status relative to the current user.
type: changed
@@ -1,9 +0,0 @@
issueNumber: MDL-86660
notes:
core_courseformat:
- message: >-
Two new public static methods have been added to the `overviewtable`
class:
- `is_cm_displayable`: Determines if a course module should be listed in the overview table.
- `is_cm_available`: Checks if a course module is accessible to the user (and should therefore be rendered as a link).
type: changed
@@ -1,19 +0,0 @@
issueNumber: MDL-86678
notes:
core_reportbuilder:
- message: >-
The base entity class now implements a default `initialise` method, that
will automatically call each of the following methods to load entity
report data:
* `get_available_columns()`
* `get_available_filters()`
* `get_available_conditions()`
This change allows for a lot of boilerplate to be removed from report
entity classes
type: improved
@@ -1,12 +0,0 @@
issueNumber: MDL-86699
notes:
core_reportbuilder:
- message: >-
There are two new entities intended for reports specific to course
module data, in order to provide a baseline in terms of module reporting
and API usage:
*
`core_course\reportbuilder\local\entities\{course_module,course_module_base}`
type: improved
@@ -1,7 +0,0 @@
issueNumber: MDL-86699
notes:
mod_forum:
- message: >-
The forum report entity `->get_context_joins()` method is deprecated,
replaced with `->get_course_modules_joins(...)`
type: deprecated
@@ -1,17 +0,0 @@
issueNumber: MDL-86798
notes:
core_question:
- message: >
In order to prevent re-use of question version numbers after a version
is deleted, the `nextversion` column was added to
`question_bank_entries`. This serves as a counter incremented each time
a version is created.
Do not query this field directly. Instead use
`core_question\versions::get_next_version()` to read the value, which
will initialise it based on the existing versions if it is not set yet.
By default, it will increment the version number automatically, unless
you pass `increment: false`. Because of this, it is advisable to call
it inside a transaction, that is only committed after the version number
is used in a `question_versions` record.
type: fixed
@@ -1,7 +0,0 @@
issueNumber: MDL-86798
notes:
core_question:
- message: >-
`get_next_version()` from questionlib.php is now deprecated. Use
`\core_question\versions::get_next_version()` instead.
type: deprecated
@@ -1,5 +0,0 @@
issueNumber: MDL-86832
notes:
core_block:
- message: Removed block_activity_modules from Moodle 5.2.
type: removed
@@ -1,10 +0,0 @@
issueNumber: MDL-86839
notes:
core:
- message: >
"grunt watch" now accepts a force flag. Run "grunt watch -f" or "grunt
watch --force" to prevent grunt from cancelling builds when errors
occur. This is especially useful during development, because js build
files will be built even if, for example, jslint errors are still
present in the files.
type: improved
@@ -1,8 +0,0 @@
issueNumber: MDL-86846
notes:
core:
- message: >-
The `core/drag_handle` template has been modified to use a native HTML
button for a more accessible experience and a consistent look with other
buttons on the page.
type: changed
@@ -1,7 +0,0 @@
issueNumber: MDL-86854
notes:
core_courseformat:
- message: >-
Add core_courseformat\cmactions::move_before that will allow to move a coursemodule to a position before another coursemodule.
Add core_courseformat\cmactions::move_end_section that will allow to move a coursemodule the end of a section.
type: improved
@@ -1,8 +0,0 @@
issueNumber: MDL-86854
notes:
core_course:
- message: >-
Deprecates moveto_module (core_course) in favor of
cmactions::move_before or cmactions::move_end_section
(core_courseformat\local\cmactions).
type: deprecated
@@ -1,11 +0,0 @@
issueNumber: MDL-86855
notes:
qbank_columnsortorder:
- message: >-
The Behat selector `column move handle` for the `qbank_columnsortorder` plugin has been removed.
When interacting with the column's move handle, please use the move handle's accessible name and type.
For example:
- `And I drag "Move Created by" "button" and I drop it in "Move T" "button"`
type: removed
@@ -1,9 +0,0 @@
issueNumber: MDL-86856
notes:
core_course:
- message: >-
The following methods have been deprecated and should no longer be used:
- `course_delete_module`
- `course_module_flag_for_async_deletion`
Please consider using the equivalent methods, delete and delete_async, in `core_courseformat\local\cmactions` instead.
type: deprecated
@@ -1,5 +0,0 @@
issueNumber: MDL-86856
notes:
core_courseformat:
- message: Add delete method to the core_courseformat\cmactions
type: improved
@@ -1,7 +0,0 @@
issueNumber: MDL-86857
notes:
core_courseformat:
- message: >-
Add set_groupmode method to the core_courseformat\cmactions (course
format actions)
type: improved
@@ -1,7 +0,0 @@
issueNumber: MDL-86857
notes:
core_course:
- message: >-
Deprecates set_coursemodule_groupmode in favor of
core_courseformat\cmactions::set_groupmode
type: deprecated
@@ -1,7 +0,0 @@
issueNumber: MDL-86858
notes:
core_courseformat:
- message: >-
Create a new core_courseformat\cmactions::duplicate aiming to replace
the course/lib.php version
type: improved

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