Compare commits

...

1018 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7) de572fbf03 Moodle release 3.1.3 2016-11-12 20:21:36 +01:00
AMOS bot 40a96de9cd Automatically generated installer lang files 2016-11-12 00:29:04 +08:00
Dan Poltawski 0c65936086 weekly release 3.1.2+ 2016-11-11 12:05:53 +00:00
Andrew Nicols a05308d366 Merge branch 'MDL-55121-31' of git://github.com/lameze/moodle into MOODLE_31_STABLE 2016-11-11 15:13:25 +08:00
Andrew Nicols 8303ecdf44 Merge branch 'MDL-55994_31' of https://github.com/bostelm/moodle into MOODLE_31_STABLE 2016-11-11 13:59:46 +08:00
Andrew Nicols c467b6b705 Merge branch 'MDL-56417_31' of https://github.com/dmonllao/moodle into MOODLE_31_STABLE 2016-11-11 12:00:03 +08:00
Andrew Nicols 60daca3928 Merge branch 'MDL-52216_31_STABLE' of https://github.com/eugeneventer/moodle-fixes into MOODLE_31_STABLE 2016-11-11 11:21:42 +08:00
Simey Lameze 5ed79a453a MDL-55121 environment: check for unsuported php version 7.1 2016-11-11 10:04:20 +08:00
Eloy Lafuente (stronk7) 5c93ce2433 MDL-56363 mod_assign: rebuild js 2016-11-11 00:44:21 +01:00
Adrian Greeve a18b518496 MDL-56363 mod_assign: Restrictions added for tutors.
If the grader does not have the accessallgroups capability
or is not a member of the group then no participants are
shown.
2016-11-11 00:31:04 +01:00
Eugene Venter 2395ad0dbc MDL-52216 mod_lesson: prevent invalid view modes 2016-11-11 09:29:14 +13:00
Dan Poltawski 96f92a0279 Merge branch 'MDL-56623_31-messages-to-adressed-to-until' of git://github.com/lucaboesch/moodle into MOODLE_31_STABLE 2016-11-10 15:04:35 +00:00
Dan Poltawski 20bae1ef3b Merge branch 'MDL-55249_m31v1' of https://github.com/sbourget/moodle into MOODLE_31_STABLE 2016-11-10 15:01:41 +00:00
Dan Poltawski dde3017dfd Merge branch 'MDL-56720-31' of git://github.com/junpataleta/moodle into MOODLE_31_STABLE 2016-11-10 15:00:24 +00:00
Dan Poltawski a287200f18 MDL-55777 version: bump 2016-11-10 13:47:53 +00:00
Dan Poltawski 201a89c4b7 Merge branch 'MDL-55777-31' of git://github.com/ankitagarwal/moodle into MOODLE_31_STABLE 2016-11-10 13:46:45 +00:00
Eloy Lafuente (stronk7) d7631af5d8 Merge branch 'MDL-53481-31-uniqsqlparam' of git://github.com/mudrd8mz/moodle into MOODLE_31_STABLE 2016-11-10 13:15:46 +01:00
David Mudrák 598a02dade MDL-53481 availability: Fix unit test to not execute the huge query
Some DBs have troubles to execute such a huge query as generated in this
test. We do not actually need to execute it. All we need is to make sure
that the parameter placeholders are enumerated correctly. So it is what
this new test does.
2016-11-10 09:55:19 +01:00
Nicholas Hoobin 044f6d7f46 MDL-56417 session: Respect the return value of ignore_timeout_hook. 2016-11-10 14:25:44 +08:00
Ankit Agarwal 26f3554922 MDL-55777 installation: Check libcurl version on install 2016-11-10 10:20:18 +05:30
Juan Leyva f5c6a29803 MDL-56268 webservice: Format backtrace to avoid display private data 2016-11-10 11:54:25 +08:00
Simey Lameze a5ecc22147 MDL-51347 core_notes: check view notes capability by course context 2016-11-10 11:54:25 +08:00
Tim Hunt 2a229e74a3 MDL-53744 question file access: fix access checks 2016-11-10 11:54:25 +08:00
Juan Leyva c3bb491c25 MDL-56065 user: Fix update_users Web Service
Users won’t be updated if:
- They are admins and the user updating is not
- They are the guest user
- They are mnet users
- They are deleted users
2016-11-10 11:54:24 +08:00
Andrew Nicols 179a26ff76 Merge branch 'MDL-54646-31' of git://github.com/junpataleta/moodle into MOODLE_31_STABLE 2016-11-10 11:49:59 +08:00
David Monllao b6a4f42d9c Merge branch 'MDL-56753-31' of git://github.com/lameze/moodle into MOODLE_31_STABLE 2016-11-10 11:39:04 +08:00
Andrew Nicols 751132ba58 Merge branch 'MDL-55883_m31v1' of https://github.com/sbourget/moodle into MOODLE_31_STABLE 2016-11-10 11:13:08 +08:00
Simey Lameze 07949dafdd MDL-56753 mod_assign: behat tests for groups and grouping counting 2016-11-10 11:11:20 +08:00
Simey Lameze 6c29f655d2 MDL-56753 mod_assign: fix groups and submitted counting on grading summary
This also fixes a coding error that was displayed when a group was not part of
assignment grouping.
2016-11-10 11:11:19 +08:00
Tomasz Muras c429d0abec MDL-54646 tags: Hide manage tags in menu if tags disabled. 2016-11-10 11:09:21 +08:00
Andrew Nicols 1717bd7cd4 Merge branch 'wip-mdl-56840-m31' of https://github.com/rajeshtaneja/moodle into MOODLE_31_STABLE 2016-11-10 09:45:49 +08:00
Andrew Nicols b81f565740 Merge branch 'MDL-56755-m31' of https://github.com/micaherne/moodle into MOODLE_31_STABLE 2016-11-09 15:43:02 +08:00
Andrew Nicols 5ff3938e19 Merge branch 'MDL-56726-31-cfgadmin' of git://github.com/mudrd8mz/moodle into MOODLE_31_STABLE 2016-11-09 14:52:10 +08:00
Rajesh Taneja 60a67bd6ee MDL-56840 behat: Wait till pdf conversion progress is finished 2016-11-09 14:50:53 +08:00
David Monllao a6af6fb6ef Merge branch 'MDL-56133-m31' of https://github.com/NeillM/moodle into MOODLE_31_STABLE 2016-11-09 14:24:13 +08:00
David Monllao bf937a647f Merge branch 'mdl-54852-31_STABLE' of https://github.com/Dagefoerde/moodle into MOODLE_31_STABLE 2016-11-09 13:07:44 +08:00
David Monllao 7cc5b700c8 Merge branch 'MDL-53481-31-uniqsqlparam' of git://github.com/mudrd8mz/moodle into MOODLE_31_STABLE 2016-11-09 12:50:07 +08:00
David Mudrák e22a93a603 MDL-53481 availability: Fix uniqueness of SQL named param placeholders
Static variables do not behave the way you might expect when accessing
them through the classes inheritance. When accessing a method via self::
or static:: operators, even though the method is inherited, its variable
scope is not. So the method unique_sql_parameter() was using the scope
of the child class and each child class had its own sequence of usp1,
usp2, usp3, ... placeholders. This led to "Incorrect number of query
parameters" error when multiuple condition classes were contributing to
a single SQL query.

All credit should go to Adam Olley who debugged and described the
essence of the problem in the tracker.
2016-11-08 14:24:02 +01:00
Neill Magill e2b4b56eee MDL-56133 tool_langimport: Changes should be visible after import
Before this change if a language pack was updated by the
\tool_langimport\task\update_langpacks_task scheduled task, changes
would not be available to users until an admin manually cleared the
strings cache.

This change causes the cache to purged when a language pack it update,
this will cause it to rebuild so users will start seeing updates
automatically.
2016-11-08 10:54:52 +00:00
Dan Poltawski 67b81de806 weekly release 3.1.2+ 2016-11-08 10:16:41 +00:00
Dan Poltawski 6e0495afef Merge branch 'install_31_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_31_STABLE 2016-11-08 10:16:40 +00:00
Michael Aherne 4eab05dfc5 MDL-56755 assign: Improve documentation of assign::get_grade_item() 2016-11-08 09:00:24 +00:00
Andrew Nicols 70d32d0516 Merge branch 'wip-MDL-56120-31' of git://github.com/abgreeve/moodle into MOODLE_31_STABLE 2016-11-08 10:34:40 +08:00
David Monllao 334b25e0c6 Merge branch 'MDL-53718_31' of git://github.com/aolley/moodle into MOODLE_31_STABLE 2016-11-08 09:59:51 +08:00
Adrian Greeve 197554d49a MDL-56120 calendar: Unit tests for getting events.
Added a unit test for checking that calendar_get_events
will only return events for activated activities.
2016-11-08 08:32:09 +08:00
Adrian Greeve 0582765407 MDL-56120 calendar: Fix disabled modules showing events.
calendar_get_events now check s for disabled activities
and only shows events for active modules.
2016-11-08 08:30:57 +08:00
Eloy Lafuente (stronk7) 4e7dde97fc Merge branch 'MDL-56765-31' of git://github.com/jleyva/moodle into MOODLE_31_STABLE 2016-11-08 01:27:49 +01:00
Eloy Lafuente (stronk7) 49e291c7a6 Merge branch 'MDL-54916-31' of https://github.com/mr-russ/moodle into MOODLE_31_STABLE 2016-11-07 16:20:09 +01:00
Jan Dageförde 131ec75f8a MDL-54852 assignment: Suppress "leave page" warning after save
If the user navigates away from the grading page immediately
after saving the grading form, the browser warning can be
safely omitted, as there are no unsaved changes. This is achieved
by calling `reset_form_dirty_state()` of the core_formchangechecker
YUI module, which is responsible for the warning.
2016-11-07 10:29:47 +01:00
David Monllao ff6af70f81 Merge branch 'mdl31_MDL-54575' of git://github.com/danmarsden/moodle into MOODLE_31_STABLE 2016-11-07 13:58:26 +08:00
Adam Olley 9e4b6232d4 MDL-53718 badges: Dont display course badges when disabled 2016-11-07 15:58:08 +10:30
David Monllao 498163486c Merge branch 'MDL-56129-31' of git://github.com/andrewnicols/moodle into MOODLE_31_STABLE 2016-11-07 11:16:13 +08:00
David Monllao fc8be7dfab Merge branch 'MDL-56731_31_STABLE' of https://github.com/tonynlin/moodle into MOODLE_31_STABLE 2016-11-07 10:44:45 +08:00
Jonathon Fowler 00f53031f6 MDL-56129 core: Change HTTP error code for iOS 10 video playback
This patch changes the effective response code from a 407 to a 403 when
erroring on iOS 10 and when a HTTP_X_PLAYBACK_SESSION_ID HTTP header is
found.

This causes the iOS Media framework to send the cookie with the request
which subsequently succeeds.
2016-11-07 10:01:26 +08:00
David Monllao 23853266d7 Merge branch 'MDL-55203-31' of https://github.com/mr-russ/moodle into MOODLE_31_STABLE 2016-11-07 09:49:44 +08:00
Russell Smith 12b5512f2d MDL-55203 forms: Use correct admin folder name.
When the admin folder if renamed, the system must replace that when
adding the competencies form elements to the QuickForm Library.
2016-11-07 11:44:05 +11:00
Jan Dageförde ce50f55c1f MDL-54852 assignment: Suppress "leave page" warning after save
If the user navigates away from the grading page immediately
after saving the grading form, the browser warning can be
safely omitted, as there are no unsaved changes. This is achieved
by calling `reset_form_dirty_state()` of the core_formchangechecker
YUI module, which is responsible for the warning.
2016-11-06 21:58:18 +01:00
Henning Bostelmann d558b6629b MDL-55994 blog: Resolve warning messages in RSS feed generation 2016-11-06 17:40:13 +00:00
AMOS bot 1968cc587c Automatically generated installer lang files 2016-11-07 00:04:50 +08:00
Juan Leyva 001bd88aee MDL-56765 webservice: After a new session is started unset old preferences 2016-11-04 19:16:06 +00:00
Dan Poltawski 10d1ea1ae2 Merge branch 'wip-MDL-54986-31' of https://github.com/Beedell/moodle into MOODLE_31_STABLE 2016-11-04 14:31:00 +00:00
Dan Poltawski 59469bcc0b Merge branch 'MDL-56668-m31' of https://github.com/micaherne/moodle into MOODLE_31_STABLE 2016-11-04 14:23:10 +00:00
Dan Poltawski 1f15bdfeb4 Merge branch 'MDL-53945_31' of git://github.com/aolley/moodle into MOODLE_31_STABLE 2016-11-04 14:07:25 +00:00
Tony Lin 6faa78c935 MDL-56731 groups: Fixes breadcrumb when returning to groups/index.php 2016-11-04 13:26:23 +00:00
Dan Poltawski c1971a2fdf weekly release 3.1.2+ 2016-11-04 11:17:59 +00:00
Dan Poltawski fcf6e01377 MDL-56673 tool_templatelibrary: fix externallib backwards compat
The function now matches the VALUE_DEFAULT option of the service.
2016-11-04 11:45:21 +01:00
Jun Pataleta e31e111cdf MDL-46903 mod_scorm: Apply alias to compare text column 2016-11-04 14:24:02 +08:00
Andrew Nicols 71482ec7e2 Merge branch 'MDL-56673-31-fix1' of http://github.com/damyon/moodle into MOODLE_31_STABLE 2016-11-04 14:08:59 +08:00
Damyon Wiese 53ee4f0635 MDL-56673 tool_templatelibrary: Don't show templates from other themes 2016-11-04 14:04:37 +08:00
David Monllao 1ffe600b32 Merge branch 'MDL-56748-31' of git://github.com/andrewnicols/moodle into MOODLE_31_STABLE 2016-11-04 13:45:40 +08:00
Andrew Nicols 67747af0d3 MDL-56748 cache: Removes cache definition instances in purge_store
Previously a purge_store was only purging caches but it was leaving a
reference to the store instance for the cache definition.

As a result, the cache was never cleared away correctly and, in cases
where the cache store makes a TCP connection to a backend system, the
number of open sockets was increasing for each store instance.

After a complete purge, as found in the unit test reset, the cache
definitions should be both purged and removed.

This change should also lead to a drop in memory consumption for unit
tests as there will no longer be references to unused definition stores.
2016-11-04 13:44:39 +08:00
David Monllao 8bc7de537c Merge branch 'mdl31_MDL-46903' of https://github.com/danmarsden/moodle into MOODLE_31_STABLE 2016-11-04 08:24:53 +08:00
Adam Olley d6e1f28ef4 MDL-53945 mnet: Use moodle_url to provide string with url
Using moodle_url where possible is preferable to hardcoding uri's as
moodle_url is able to take care of alot of the formatting for us.

In this instance, it handles the $CFG->admin url path for us.
2016-11-04 09:12:00 +10:30
Michael Aherne 9263132f8d MDL-56668 competencies: Correct namespacing of coding_exception 2016-11-03 14:06:21 +00:00
David Mudrák 9257b81e26 MDL-56726 admin: Fix hard-coded path to the admin directory 2016-11-03 10:17:23 +01:00
David Monllao f87e7aa6ee Merge branch 'MDL-56481-31' of git://github.com/junpataleta/moodle into MOODLE_31_STABLE 2016-11-03 14:52:25 +08:00
Tim Lock fedb3cf539 MDL-56481 tool_lpmigrate: Fix notice when cancelling framework migration 2016-11-03 14:17:22 +08:00
Jun Pataleta 91809b1fef MDL-56720 tool_lp: Do not push empty values to IDs array 2016-11-03 14:10:21 +08:00
Adam Olley c8b70b6ec2 MDL-53945 mnet: replace hardcoded admin dir with cfg
Several places in admin/mnet pull in required files using a hardcoded
admin dir string, as this is configurable it needs to use $CFG->admin
instead.

Places where the url is passed through moodle_url don't need to be
updated as that already automatically translates the urls for us.
2016-11-03 11:12:11 +10:30
John Beedell e251d9fe45 MDL-54986 Quiz: Disable add button for quiz with attempts 2016-11-02 17:25:54 +00:00
Andrew Nicols 5f7d070080 Merge branch 'MDL-56634-31' of git://github.com/ankitagarwal/moodle into MOODLE_31_STABLE 2016-11-02 14:05:11 +08:00
David Monllao 72aca897d4 Merge branch 'MDL-56323-31' of git://github.com/l-campbell/moodle into MOODLE_31_STABLE 2016-11-02 13:12:18 +08:00
David Monllao cdacdf7f41 Merge branch 'wip-MDL-55930-31' of https://github.com/Beedell/moodle into MOODLE_31_STABLE 2016-11-02 12:50:04 +08:00
Ankit Agarwal c97015c0c6 MDL-56634 webservices: clean api desc 2016-11-02 10:05:16 +05:30
David Monllao a35dea73e7 Merge branch 'MDL-43796_31_blindmarking' of https://github.com/SWiT/moodle into MOODLE_31_STABLE 2016-11-02 12:29:04 +08:00
Andrew Nicols b46e384dd3 Merge branch 'MDL-56673-31' of git://github.com/danpoltawski/moodle into MOODLE_31_STABLE 2016-11-02 12:15:53 +08:00
Stephen Bourget 93c2d2c971 MDL-55883 mod_lesson: Missing include in lesson_update_events 2016-11-01 21:21:03 -04:00
Stephen Bourget 149a5b1e05 MDL-55249 mod_feedback: Associate status with current activity
The status screen in mod_feedback simply checks to see if there are any
attempts in progress to return the user status.  This check should be
limited to only include instances of the current feedback activity not
any feedback activity on the site.
2016-11-01 21:15:41 -04:00
Dan Poltawski 7fa03088be Merge branch 'MDL-54112-31' of https://github.com/hcpss-banderson/moodle into MOODLE_31_STABLE 2016-11-01 21:31:04 +00:00
Dan Poltawski e343b2438b Merge branch 'mdl31_MDL-47500' of git://github.com/danmarsden/moodle into MOODLE_31_STABLE 2016-11-01 21:29:32 +00:00
Dan Poltawski d62bde657b Merge branch 'mdl55456-moodle31' of https://github.com/tlock/moodle into MOODLE_31_STABLE 2016-11-01 21:27:50 +00:00
Eloy Lafuente (stronk7) a8c64d6267 weekly release 3.1.2+ 2016-11-01 19:48:11 +01:00
John Beedell 26d38b03cd MDL-55930 Quiz: "Next page button" showing in sequential mode 2016-11-01 11:25:05 +00:00
Dan Poltawski 82974222af MDL-56673 templatelibrary: return false when core template doesn't exist 2016-11-01 10:19:17 +00:00
Dan Marsden 40c10bebe7 MDL-54575 scorm: fix typo in data_preprocessing function
thanks to Mike Finch for the patch/report.
2016-11-01 12:14:05 +13:00
Dan Marsden 086bc8870a MDL-46903 scorm: Fix db error in objectives report for oracle.
also improve 2004 report handling to help with testing.
2016-11-01 12:06:08 +13:00
Eloy Lafuente (stronk7) 421a78a564 Merge branch 'wip-MDL-56615-31' of git://github.com/marinaglancy/moodle into MOODLE_31_STABLE 2016-10-31 20:26:12 +01:00
Dan Poltawski a20a0a48f0 Merge branch 'MDL-56542-31-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_31_STABLE 2016-10-31 15:14:02 +00:00
Andrew Nicols e5dc9a44ba Merge branch 'MDL-56282-31' of git://github.com/damyon/moodle into MOODLE_31_STABLE 2016-10-31 12:27:20 +08:00
Frédéric Massart 51256b8ab5 MDL-56282 enrol_meta: Fix error when editing existing instances
We had a few problems here.

1/ The auto complete element was displaying the picker though the
   field was frozen.
2/ Checking for existing enrolment including the courses chosen was
   not checking if the courses found were in the instance we edit.
3/ Upon creation we support multiple courses but when editing we
   should not expect more than the course in the instance being edited.
2016-10-31 12:16:15 +08:00
Marina Glancy 04872de103 MDL-56615 portfolio_googledocs: add basic unittests 2016-10-31 10:58:26 +08:00
Marina Glancy f0fab142a7 MDL-56615 portfolio: fix php 7.0.9 warning 2016-10-31 10:58:25 +08:00
Luca Bösch d0ebb9f35f MDL-56623 messages: To (addressed) and to (until) different
In some languages "to" having the meaning of "until" and "to" having the meaning of "addressed to" are different.
This should be taken care of by having two different translation terms.

AMOS BEGIN
  CPY [to,core],[addressedto,core]
AMOS END
2016-10-28 07:20:32 +02:00
Brian Barnes 9b16dd4632 MDL-47500 scorm: improved height calculation 2016-10-28 13:42:10 +13:00
Brendan Anderson e50b26fa7c MDL-54112 mod_assign: Add scale null grade filter 2016-10-27 10:33:47 -04:00
Dan Poltawski f4f89d4728 weekly release 3.1.2+ 2016-10-27 12:19:37 +01:00
Dan Poltawski b659e9d05c Merge branch 'install_31_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_31_STABLE 2016-10-27 12:19:36 +01:00
Dan Poltawski 17f1295e23 Revert "Merge branch 'MDL-56129-31' of git://github.com/andrewnicols/moodle into MOODLE_31_STABLE"
This reverts commit 1483afc59b, reversing
changes made to 9edd48f894.
2016-10-27 10:00:05 +01:00
Eloy Lafuente (stronk7) bf639be2ef Merge branch 'MDL-56448-31' of git://github.com/danpoltawski/moodle into MOODLE_31_STABLE 2016-10-26 17:06:21 +02:00
Dan Poltawski f093a38342 MDL-56448 mustache: fix json errors in example context 2016-10-26 12:37:40 +01:00
Eloy Lafuente (stronk7) c341f6ddaf Merge branch 'MDL-56354-31' of https://github.com/mr-russ/moodle into MOODLE_31_STABLE 2016-10-26 02:15:43 +02:00
Russell Smith 9eb3fb41c3 MDL-56354 unittests: Put debug messages in the failure notice. 2016-10-26 09:24:37 +11:00
Dan Poltawski 73a3ebcecf Merge branch 'MDL-56288_31-messages-time-extra-space' of https://github.com/lucaboesch/moodle into MOODLE_31_STABLE 2016-10-25 20:57:36 +01:00
Dan Poltawski 2c08b71880 Merge branch 'MDL-56136_31' of git://github.com/timhunt/moodle into MOODLE_31_STABLE 2016-10-25 20:44:37 +01:00
Eloy Lafuente (stronk7) aba9531852 Merge branch 'MDL-56250-31-formvalidation' of https://github.com/roperto/moodle into MOODLE_31_STABLE 2016-10-25 20:30:16 +02:00
Helen Foster 9f809b1818 MDL-56542 lang: Merge English strings from the en_fix language pack 2016-10-25 20:26:36 +02:00
Eloy Lafuente (stronk7) 4b108d2ccb Merge branch 'MOODLE_31_STABLE' of https://github.com/yuriy-os/moodle into MOODLE_31_STABLE 2016-10-25 20:00:16 +02:00
Dan Poltawski bd519a6e80 Merge branch 'MDL-55143-31' of https://github.com/mr-russ/moodle into MOODLE_31_STABLE 2016-10-25 18:38:41 +01:00
AMOS bot cb3e164f68 Automatically generated installer lang files 2016-10-26 00:04:40 +08:00
David Monllao ff370663c6 Merge branch 'wip-mdl-56347-m31' of https://github.com/rajeshtaneja/moodle into MOODLE_31_STABLE 2016-10-25 15:20:18 +08:00
Dan Poltawski 540cdcaca1 Merge branch 'MDL-55902-31' of git://github.com/junpataleta/moodle into MOODLE_31_STABLE 2016-10-25 06:38:13 +01:00
Russell Smith 533addff9c MDL-54916 filestorage: Only write empty zip on change.
In some cases we may inspect an empty zip file. If we do open
an empty zip file, check that it changed before we attempt to write
it to disk.  It may be the case that we were reading the file from
a location that we don't have write access to.
2016-10-25 14:12:51 +11:00
Russell Smith a14e796549 MDL-56347 caching: Better class variables for notices. 2016-10-25 09:52:04 +08:00
Rajesh Taneja ca08b73300 MDL-56347 phpunit: Set class for alternative cache store
If alternative cache store is sued, then set the class
and warn user about this.
2016-10-25 09:51:27 +08:00
lazydaisy ad070273a5 MDL-48350 theme_bootstrapbase: restyle action icons in docked blocks 2016-10-24 21:38:07 +02:00
Dan Poltawski 05292ca201 Merge branch 'wip-MDL-56439-31' of git://github.com/marinaglancy/moodle into MOODLE_31_STABLE 2016-10-24 14:33:55 +01:00
Lee Campbell 3508f1b8e2 MDL-56323 core_user: User profile field default value not on signup page
The default value of a configured text input user profile field is not rendering on signup page
2016-10-24 09:33:42 +01:00
David Monllao 6c91de2362 Merge branch 'mdl56466-moodle31' of https://github.com/tlock/moodle into MOODLE_31_STABLE 2016-10-24 15:24:08 +08:00
David Monllao 1483afc59b Merge branch 'MDL-56129-31' of git://github.com/andrewnicols/moodle into MOODLE_31_STABLE 2016-10-24 12:01:00 +08:00
Andrew Nicols 9c74040c3b MDL-56129 core: Set a timeout on the session cookie
This is primarily because iOS has changed something under the hood which
means that only session cookies which have an expiry are passed around the
OS.

In order to make media playable outside of the browser (e.g. a video), we
must set a session cookie timeout.

Since the session timeout is configurable, this patch sets the cookie
timeout to the session timeout plus a period of one week.

This ensures that videos continue to work, and that the expired session
message is shown on the login page, but without requiring excessively long
session times.
2016-10-24 11:47:51 +08:00
Luke Carrier 7e3e81c330 MDL-55902 my: Add additional information to dashboard reset events
* Add $private and $pagetype information to the 'other' parameter of
the dashboard(s) reset events.
2016-10-24 11:04:12 +08:00
Frédéric Massart 9edd48f894 MDL-56341 mustache: JS engines handles strings wrapped in quote
Prior to the patch the strings wrapped as the following one
where not found and replaced when rendering the template via Javascript

{{#quote}}{{#str}}string,component{{/str}}{{/quote}}
2016-10-24 10:10:07 +08:00
Yuriy Osychenko 24ec5de709 MDL-53098 lib: Mark form as submitted in confirmation dialog.
If the quiz attempt use popup window with Javascript security it will
show to the user misleading message that he is going to lose entered
data.
To avoid this we should mark form as submitted to turn off browser`s
pop-up window when user confirms finishing attempt.
Also we need to check if core_formchangechecker is present on a page.
2016-10-24 00:44:00 +03:00
AMOS bot 22e7edad43 Merge branch 'MOODLE_31_STABLE' into install_31_STABLE 2016-10-22 00:04:59 +08:00
Daniel Thee Roperto 9bac677826 MDL-56250 forms library: Changed form to validate once per object.
If two instances of moodleforms are validated in the same run, most
likely a phpunit test run, it would store the first validation result.
Now it stores the validation result per instance, not for all instances.
2016-10-21 10:41:23 +11:00
AMOS bot cfae450c61 Automatically generated installer lang files 2016-10-21 00:04:54 +08:00
Eloy Lafuente (stronk7) 2afadc066b weekly release 3.1.2+ 2016-10-20 17:52:48 +02:00
Eloy Lafuente (stronk7) 870fcca1e0 Merge branch 'install_31_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_31_STABLE 2016-10-20 17:52:45 +02:00
Andrew Nicols fbe2c4f979 Merge branch 'MDL-56328_31-fix-rtl' of git://github.com/dmonllao/moodle into MOODLE_31_STABLE 2016-10-19 13:30:04 +08:00
David Monllao 70e4268d66 MDL-56328 theme: Remove RTL styles
They should only be applied while editing mode is on
2016-10-19 12:34:25 +08:00
Eloy Lafuente (stronk7) acacf89d1a Merge branch 'MDL-29774-31-by-sam-wilson' of git://github.com/junpataleta/moodle into MOODLE_31_STABLE 2016-10-18 17:34:46 +02:00
Andrew Nicols a518a7bc8c MDL-55858 mod_forum: Remove subscription links when not relevant
When a forum is force-subscribed or subscription is disabled, do not
include the subscription link in forum posts.
2016-10-18 17:01:03 +02:00
Dan Poltawski 7008ee479d Merge branch 'MDL-56131-31' of git://github.com/andrewnicols/moodle into MOODLE_31_STABLE 2016-10-18 13:44:38 +01:00
Dan Poltawski a0f41c8b2d Merge branch 'MDL-56062-31' of https://github.com/lucisgit/moodle into MOODLE_31_STABLE 2016-10-18 12:06:58 +01:00
Eloy Lafuente (stronk7) a8d92101dc Merge branch 'MDL-56275-31' of git://github.com/danpoltawski/moodle into MOODLE_31_STABLE 2016-10-18 12:13:07 +02:00
Dan Poltawski fa40bd7e08 MDL-56275 blog: do not display the 'choose a link' button
When registereing an external blog the choose a link button is
misleading, we don't have any repos which restrict to RSS feeds, so the
majority of results you get from the repo picker will be wrong.
2016-10-18 11:09:00 +01:00
David Monllao 7071e0949c Merge branch 'MDL-56328-M31' of git://github.com/lazydaisy/moodle into MOODLE_31_STABLE 2016-10-18 16:06:54 +08:00
Eloy Lafuente (stronk7) 096ea34f43 Merge branch 'MDL-56345-31' of https://github.com/lucisgit/moodle into MOODLE_31_STABLE 2016-10-18 09:38:41 +02:00
Tim Lock 5e80e0bce9 MDL-55456 course: set context for category ajax requests 2016-10-18 12:49:47 +10:30
Tim Lock fe9831dd7d MDL-56466 assign: fix database error with team submissions
This fixes the error when viewing the Grading summary with Blind Marking and Team submission is enabled:

ERROR: Incorrect number of query parameters. Expected 32, got 31.
2016-10-18 12:09:16 +10:30
Sam Wilson 3aff88f24c MDL-29774 core_user: Update group-membership summaries on AJAX calls 2016-10-18 09:37:32 +08:00
Eloy Lafuente (stronk7) eb8323829c Merge branch 'wip-mdl-56369-m31' of https://github.com/rajeshtaneja/moodle into MOODLE_31_STABLE 2016-10-18 01:33:11 +02:00
Eloy Lafuente (stronk7) b2a3cd6f90 Merge branch 'wip-mdl-56348-m31' of https://github.com/rajeshtaneja/moodle into MOODLE_31_STABLE 2016-10-18 01:10:32 +02:00
Russell Smith 0a97a2e574 MDL-55143 unittests: Check the db rather than cache for version hash. 2016-10-18 09:53:24 +11:00
Eloy Lafuente (stronk7) e1b22d2ee0 Merge branch 'MDL-56368-M31' of git://github.com/lazydaisy/moodle into MOODLE_31_STABLE 2016-10-18 00:38:53 +02:00
Eloy Lafuente (stronk7) 2e22fc8a24 Merge branch 'MDL-56022_m31v3' of https://github.com/sbourget/moodle into MOODLE_31_STABLE 2016-10-18 00:07:30 +02:00
Stephen Bourget 8fbdc47ab8 MDL-56022 Assign: Make folders structure in the downloaded zip optional
Special thanks to Matt McDermott for the contributing the Javascript
code to fix this issue.
2016-10-17 16:26:12 -04:00
Eloy Lafuente (stronk7) 66add1538d Merge branch 'MDL-56300_31' of git://github.com/reskit/moodle into MOODLE_31_STABLE 2016-10-17 18:51:17 +02:00
Dan Poltawski b5179a16d4 Merge branch 'MDL-56208-31' of git://github.com/andrewnicols/moodle into MOODLE_31_STABLE 2016-10-17 12:52:28 +01:00
Dan Poltawski 94410cf875 Merge branch 'MDL-55630-31' of https://github.com/StudiUM/moodle into MOODLE_31_STABLE 2016-10-17 10:25:01 +01:00
Michael Aherne 6e4ad85606 MDL-56131 choice: Set maximum lifetime for lock 2016-10-17 13:51:08 +08:00
Andrew Nicols 403cc20e1e MDL-56208 mod_forum: Move Display period below Group 2016-10-17 11:47:13 +08:00
= 20afbd1e0d MDL-56288 messages: Extra space in front of message time
If the line break in the HTML code is at a different location
the extra space doesn't appear any more.
2016-10-16 22:51:14 +02:00
AMOS bot e210b6be12 Automatically generated installer lang files 2016-10-17 00:06:49 +08:00
Matthew Switlik 33b8704892 MDL-43796 assign: Reset revealidentities on restore
Set revealidentities to 0 when restoring with blindmarking and no user data
2016-10-14 14:11:05 -04:00
AMOS bot 476d9208d4 Automatically generated installer lang files 2016-10-15 00:04:48 +08:00
lazydaisy 12dba02ab0 MDL-56368 theme_bootstrapbase: Settings for Restrict Access not inline. 2016-10-14 15:51:25 +01:00
lazydaisy 657f59bb7d MDL-56328 theme_bootstrapbase: reduce activity indent when not editing 2016-10-14 15:30:34 +01:00
Jean-Philippe Gaudreau 70363d7394 MDL-55630 mod_assign: Exclude users courses from user details
Exclude users' enrolled courses for performance reason.
A new 'includeenrolments' parameter was added
to mod_assign::list_particpants.
2016-10-14 09:28:29 -04:00
Marc Català 4bb8469038 MDL-56300 mod_assign: Filtering students throws a javascript error 2016-10-14 09:27:30 +02:00
acorbier 6bed8d49b6 MDL-56369 behat: Updated comment for i_look_for_exceptions
After upgrade to Behat 3.x, i_look_for_exception is called from
Moodle\BehatExtension\EventDispatcher\Tester\ChainedStepTester
2016-10-14 13:25:16 +08:00
Marina Glancy 3b08a859f8 MDL-56439 course: added missing require 2016-10-14 08:21:21 +08:00
Eloy Lafuente (stronk7) 0b70ff8a16 weekly release 3.1.2+ 2016-10-13 20:02:38 +02:00
Eloy Lafuente (stronk7) d709527dc4 Merge branch 'install_31_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_31_STABLE 2016-10-13 20:02:34 +02:00
Eloy Lafuente (stronk7) 2f3978dac5 Merge branch 'MDL-56319-m31' of https://github.com/micaherne/moodle into MOODLE_31_STABLE 2016-10-13 19:41:37 +02:00
Tony Butler 73792e3ff2 MDL-56345 assignfeedback_editpdf: Use correct strings for tool alt text 2016-10-13 10:07:57 +01:00
Tony Butler 76e4c52a2f MDL-56062 mod_assign: Use $gradeitem->get_decimals() for grade display 2016-10-12 20:47:01 +01:00
AMOS bot c867851817 Automatically generated installer lang files 2016-10-12 00:04:59 +08:00
Paul Holden df0a2112d2 MDL-55345 user: correct userid when linking to iplookup from profile 2016-10-11 17:06:45 +02:00
Eloy Lafuente (stronk7) e798553ab0 Merge branch 'MDL-55954_31' of git://github.com/dmonllao/moodle into MOODLE_31_STABLE 2016-10-11 12:46:47 +02:00
David Monllao dbc83491f7 Merge branch 'MOODLE_31_MDL-51401' of https://github.com/janeklb/moodle into MOODLE_31_STABLE 2016-10-11 17:59:19 +08:00
David Monllao d2eb91d7df Merge branch 'MDL-52051-31' of git://github.com/andrewnicols/moodle into MOODLE_31_STABLE 2016-10-11 17:11:41 +08:00
Dan Poltawski 323e12f7a6 Merge branch 'MDL-36611-31' of git://github.com/junpataleta/moodle into MOODLE_31_STABLE 2016-10-11 08:53:30 +01:00
Rajesh Taneja 39ffd19e25 MDL-56348 cache: Removed second parameter
There is no second parameter in the api
and identifier should be set by set_identifiers
2016-10-11 12:51:23 +08:00
Andrew Nicols 7609261d84 MDL-52051 repository_dropbox: Add the V2 API 2016-10-11 11:45:55 +08:00
Kirill Astashov e9c915c050 MDL-36611 outcome: Set page context when editing outcome 2016-10-11 10:02:12 +08:00
Eloy Lafuente (stronk7) f029c8fd93 Merge branch 'MDL-56220-m31' of https://github.com/micaherne/moodle into MOODLE_31_STABLE 2016-10-11 01:18:35 +02:00
Eloy Lafuente (stronk7) 84f5f4706f Merge branch 'MDL-56261-31-taglist' of git://github.com/mudrd8mz/moodle into MOODLE_31_STABLE 2016-10-11 00:32:58 +02:00
Eloy Lafuente (stronk7) b81712cd5d Merge branch 'MDL-56316-31' of git://github.com/andrewnicols/moodle into MOODLE_31_STABLE 2016-10-10 18:14:06 +02:00
Eloy Lafuente (stronk7) 1a6ba31a95 Merge branch 'MDL-51633_M31' of git://github.com/lazydaisy/moodle into MOODLE_31_STABLE 2016-10-10 17:37:57 +02:00
Simey Lameze 52306fe019 MDL-56050 core: set missing context to maintenance mode 2016-10-10 23:15:21 +08:00
Dan Poltawski 7d1b63df6e Merge branch 'MDL-56052-31' of git://github.com/damyon/moodle into MOODLE_31_STABLE 2016-10-10 14:19:06 +01:00
Andrew Nicols 8069695b30 MDL-52051 repository_dropbox: Move v1 API aside 2016-10-10 20:32:03 +08:00
Andrew Nicols 19098c49d9 MDL-52051 oauth: expires_in is optional 2016-10-10 20:32:03 +08:00
Dan Poltawski bffe12cd9f Merge branch 'MDL-51584-31' of https://github.com/mr-russ/moodle into MOODLE_31_STABLE 2016-10-10 13:27:08 +01:00
Dan Poltawski 2b05e813d6 Merge branch 'MDL-55597-31' of git://github.com/FMCorz/moodle into MOODLE_31_STABLE 2016-10-10 11:33:14 +01:00
Dan Poltawski 2f3ffd55c5 Merge branch 'MDL-56285-31' of git://github.com/StudiUM/moodle into MOODLE_31_STABLE 2016-10-10 11:14:24 +01:00
Michael Aherne 7e47b00c34 MDL-56319 blocks: Observe empty default blocks setting 2016-10-10 09:52:47 +01:00
Janek Lasocki-Biczysko 616effd0d4 MDL-51401 enrol: ensures correct order of roles in UI components
Role sort order was not available in the UI (in JavaScript) due to
the use of PHP assoc arrays and JSON encoding/decoding. This patch
addresses this by sending the roles in a json array, rather than
json object.
2016-10-10 07:52:08 +01:00
Russell Smith bf907918c9 MDL-51584 gradebook: use direct $CFG access for freeze.
get_config() is called a lot of times on freeze and is expensive,
using $CFG is much lower overhead.
2016-10-10 15:42:55 +11:00
AMOS bot 6794c1f117 Automatically generated installer lang files 2016-10-09 00:06:23 +08:00
lazydaisy 5a36fc8bd2 MDL-51633 theme_bootstrapbase: Restyled ADD BLOCK to remove max-width. 2016-10-07 18:56:19 +01:00
AMOS bot 26a8cc00a8 Automatically generated installer lang files 2016-10-08 00:04:50 +08:00
Frédéric Massart 490afb5182 MDL-55597 tool_templatelibrary: Re-inforce logic to skip theme templates 2016-10-07 10:45:44 +02:00
Andrew Nicols 88e3401109 MDL-56316 tests: Ensure consistent assertion count 2016-10-07 14:46:16 +08:00
Eloy Lafuente (stronk7) 0c332af374 weekly release 3.1.2+ 2016-10-06 22:31:41 +02:00
Dan Poltawski 7d984d3e6d MDL-56303 quiz: lack of quiz filtering
Also, correctly feed completiongradeitemnumber with grade item numbers
and not with grade item ids.
2016-10-06 22:22:38 +02:00
Issam Taboubi fd135d1611 MDL-56285 competency: fix move competencies capabilities
In learning plan templates, cannot move competencies
around even if capability templatemanage is given
to the role because of bad context check
2016-10-06 11:30:14 -04:00
Eloy Lafuente (stronk7) 3e75aab436 weekly release 3.1.2+ 2016-10-06 11:51:45 +02:00
Eloy Lafuente (stronk7) 18019dd5a5 Merge branch 'install_31_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_31_STABLE 2016-10-06 11:51:41 +02:00
Cameron Ball e1b37e8638 MDL-54802 mod_quiz: Improve validation when editing a quiz uusing require passing grade
When editing a quiz that is using the require passing grade completion method,
the grade to pass cannot be zero. Since the completion method is locked we
cannot recommend that the completion method is changed (as we do when the quiz
is being created). Instead we have to inform the user that the grade to pass
must not be zero.
2016-10-05 19:30:06 +08:00
Dan Poltawski 0f871cff57 Merge branch 'MDL-54802-31-fix' of git://github.com/cameron1729/moodle into MOODLE_31_STABLE 2016-10-05 10:33:45 +01:00
Cameron Ball 5749d00b25 MDL-54802 mod_quiz: Move grade to pass error to require passing grade element
When using a passing grade of zero, with the required passing grade
option, an error was displayed on the "grade to pass" element.
This was confusing as the error message is referring to the
"Require passing grade" element. This patch moves the message to
the "Require passing grade" element.

Additionaly this patch fixes a small typo in a comment.
2016-10-05 17:17:49 +08:00
Rajesh Taneja e4f5b42015 MDL-56210 behat: Pending and complete js is added by js_init_code 2016-10-05 15:46:10 +08:00
David Monllao 139dda66cc Merge branch 'MDL-45969-31' of git://github.com/damyon/moodle into MOODLE_31_STABLE 2016-10-05 09:43:05 +08:00
Eloy Lafuente (stronk7) 35e1ae4464 Merge branch 'MDL-56231-31-flexible_table-construct-phpdoc' of https://github.com/roperto/moodle into MOODLE_31_STABLE 2016-10-05 01:49:05 +02:00
AMOS bot fbdc6adbdd Automatically generated installer lang files 2016-10-05 00:05:59 +08:00
Dan Poltawski a129767a8a Merge branch 'MDL-55861_31_STABLE' of https://github.com/dj4452/moodle into MOODLE_31_STABLE 2016-10-04 15:44:22 +01:00
Eloy Lafuente (stronk7) cc82a7e864 Merge branch 'MDL-56069_31' of git://github.com/timhunt/moodle into MOODLE_31_STABLE 2016-10-04 16:42:09 +02:00
Michael Aherne d0f145c0d5 MDL-56220 cache: Call static method correctly 2016-10-04 15:00:09 +01:00
David Mudrák 714ddc74c3 MDL-56261 tags: Do not follow the empty anchor link on more/less toggle
Some browsers tend to follow the empty <a href="#"> link and scroll to
the top of the page.
2016-10-04 15:20:33 +02:00
Eloy Lafuente (stronk7) 8f26a5e064 MDL-55910 my: various fixes
- bump version
- point to correct 3.1.3 version in @since
- add missing phpunit-dist.xml suite
- fix context in tests
2016-10-04 12:58:10 +02:00
Eloy Lafuente (stronk7) 2f008b75a7 Merge branch 'MDL-55910-31' of https://github.com/LukeCarrier/moodle into MOODLE_31_STABLE 2016-10-04 12:36:54 +02:00
Andrew Nicols 5bb831e317 Merge branch 'MDL-55886-31' of git://github.com/danpoltawski/moodle into MOODLE_31_STABLE 2016-10-04 11:21:39 +08:00
Andrew Nicols 8796156112 Merge branch 'MDL-56198_31' of git://github.com/timhunt/moodle into MOODLE_31_STABLE 2016-10-04 09:05:26 +08:00
David Monllao 2027e7a8ea MDL-55954 search_solr: Check connection before anything else
- Silents the system call when no correct data provided
- Converts long exception messages to standard server
  error + debugging message with the exception
2016-10-04 09:01:15 +08:00
AMOS bot 593ac7fa80 Automatically generated installer lang files 2016-10-04 00:04:31 +08:00
Dan Poltawski 4a8bc70154 Merge branch 'MDL-56181-31-czechia' of git://github.com/mudrd8mz/moodle into MOODLE_31_STABLE 2016-10-03 16:43:54 +01:00
Dan Poltawski db68a1e688 Merge branch 'MDL-52317-m31' of https://github.com/NeillM/moodle into MOODLE_31_STABLE 2016-10-03 16:09:33 +01:00
Dan Poltawski c213250ca7 MDL-54802 quiz: fix bad whitespace 2016-10-03 14:47:04 +01:00
Dan Poltawski 75e4ff3874 Merge branch 'MDL-54802-31' of git://github.com/lameze/moodle into MOODLE_31_STABLE 2016-10-03 14:47:00 +01:00
Andrew Nicols 75092504a1 Merge branch 'MDL-55421-31' of git://github.com/danpoltawski/moodle into MOODLE_31_STABLE 2016-10-03 19:48:28 +08:00
Dan Poltawski 573979aa1e Merge branch 'wip-MDL-55911-31' of https://github.com/Beedell/moodle into MOODLE_31_STABLE 2016-10-03 10:25:18 +01:00
David Monllao 13caba9006 Merge branch 'wip-mdl-56210-m31' of https://github.com/rajeshtaneja/moodle into MOODLE_31_STABLE 2016-10-03 13:53:44 +08:00
Daniel Thee Roperto 3ac97c70d7 MDL-56231 library: Fixed PhpDoc for flexible_table constructor.
The flexible_table::__construct($uniqueid) accepts a string, not an int
as previously noted in the PhpDoc.
2016-10-03 16:06:32 +11:00
David Monllao 72a08226d6 Merge branch 'MDL-55222-31' of git://github.com/jleyva/moodle into MOODLE_31_STABLE 2016-10-03 13:02:28 +08:00
David Monllao d65b8227c9 Merge branch 'wip-MDL-55990-31' of git://github.com/marinaglancy/moodle into MOODLE_31_STABLE 2016-10-03 13:00:20 +08:00
David Monllao 62164d315f Merge branch 'MDL-55964_31' of https://github.com/StudiUM/moodle into MOODLE_31_STABLE 2016-10-03 12:40:46 +08:00
Tim Hunt d7a5bef2d6 MDL-56069 quiz: nav buttons don't scroll to the right question
When there is more than one question on a page, say questions 2, 3 & 4.
Then when you click the navigation button for Q4, then it should load
the next page scrolled down so that Q4 is visible. That was not working.
2016-09-30 15:05:31 +01:00
Tim Hunt e7d8a6079b MDL-56198 assignment: improve grading info responsiveness 2016-09-30 15:02:13 +01:00
John Beedell 04c6fd9498 MDL-55911 Quiz: Accessibility, Label blanks in DD questions 2016-09-30 09:49:25 +01:00
Neill Magill b9143c7883 MDL-52317 Atto: Large resized images may display scroll bars
When an image was added via Atto and it was set to resize automatically
if the alignment was set to Top, Middle or Bottom when it was made
smaller then a vertical scroll bar would be displayed.

This was caused by the interaction of the margin settings on the image
and the 100% width set via the img-responsive css class. The width of
an element only includes the content area and not any borders, padding
or margins.

This change stops atto hardcoding the styles for image alignment into
the images style tag, it instead adds a class that defines the alignment
the image should have.

This change has the benefit that themers will now be able to adjust
how atto image alignments work if they wish.

Images added before this patch will continue to have the issue
until they are edited by the plugin, at which time their legacy style
will be removed and the new alignment method will be added.

Thanks to Andrew Nicols who provided a refactor for the Alignment
and style detection code.
2016-09-30 08:50:38 +01:00
Damyon Wiese 0d5d8ee56a MDL-45969 editpdf: The logic for showing a previous attempt is wrong
It originally was only ever going to show static pdfs for older versions,
but this doesn't make sense in the UI for 3.1.
2016-09-30 13:15:59 +08:00
Rajesh Taneja c72e9871f1 MDL-56210 behat: Ensure behat waits for dependancy manager 2016-09-30 10:33:00 +08:00
Dan Poltawski 1695f89400 MDL-55886 block_rss_client: fix oracle compatibility 2016-09-29 16:59:35 +01:00
Deepa Jayaprakash 7e90c19710 MDL-55861 course: Click drag&drop icon, incorrect activities shown 2016-09-29 16:48:54 +01:00
Dan Poltawski 33d6ef3266 MDL-55421 travis: check npm/grunt on multiple npm versions
This is a backport of the patch from MDL-55048

Check npm install and grunt execution on the higest and lowest node
versions. Included some minor tweaks along the way:

* Move the grunt execution into scripts part of the configuration (that way
  the grunt output is not collapsed and is easily visible in build output).

* Restructure the install section to be task based (thanks to Eloy for
  the suggestion) and as such, don't run composer install on the grunt
  task (speed up the build slightly).

* Switch around the grunt job to a matrix include so that every
  variation of grunt job doesn't need to be excluded.
  ( https://docs.travis-ci.com/user/customizing-the-build/#Explicity-Including-Jobs )
2016-09-29 16:42:54 +01:00
Dan Poltawski 1c4e222256 MDL-55421 js: add some global ignores to js files
This is to prevent linting to be extremely noisy about rollup related
problems.

Should not affect built files.
2016-09-29 16:42:54 +01:00
Dan Poltawski 4b70cdd356 MDL-55421 eslint: add config/package defintion
Partial backport of MDL-52127 to allow people to use eslint linting
in earlier branches than master.

This is an earlier version of eslint than in master beacuse of
node requirements being higer.
2016-09-29 16:42:54 +01:00
Eloy Lafuente (stronk7) cf2376cf00 MDL-56127 forms: multiple select dependencies fixed
This is a fix for a regressions introduced by MDL-54778. It
seems that escaped all our tests because there isn't any case
of such a dependency in core, but Daniele Cordella was facing
it within his surveypro module.
2016-09-29 16:52:59 +02:00
Dan Poltawski 049d20856c weekly release 3.1.2+ 2016-09-29 12:43:04 +01:00
Dan Poltawski 6e70e57a48 Merge branch 'install_31_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_31_STABLE 2016-09-29 12:43:02 +01:00
David Mudrák f0ffb7824d MDL-56181 lang: Fix CI and CZ country short names to match ISO 3166 2016-09-29 11:52:40 +02:00
Eloy Lafuente (stronk7) dca5737751 Merge branch 'MDL-55804_31' of git://github.com/dmonllao/moodle into MOODLE_31_STABLE 2016-09-29 01:14:41 +02:00
Eloy Lafuente (stronk7) 8eda39addc Merge branch 'MDL-56019-31' of git://github.com/dpalou/moodle into MOODLE_31_STABLE 2016-09-28 20:08:41 +02:00
Serge Gauthier bcf82800d1 MDL-55964 report_competency: Missing blocks in Competency breakdown
Fix also the breadcrumb
2016-09-28 13:27:50 -04:00
Dan Poltawski 1bfe4ed7a3 Merge branch 'MDL-56038-m31' of https://github.com/sammarshallou/moodle into MOODLE_31_STABLE 2016-09-28 14:36:49 +01:00
Eloy Lafuente (stronk7) 8c63e039d1 MDL-46946 user: Document user_not_fully_set_up() changes 2016-09-28 02:21:32 +02:00
Eloy Lafuente (stronk7) b9078cfe84 Merge branch 'MDL-46946-31-reqcusfield' of git://github.com/mudrd8mz/moodle into MOODLE_31_STABLE 2016-09-28 02:19:46 +02:00
Rajesh Taneja 4b14b223c2 MDL-55957 behat: Set some text before selecting in Atto 2016-09-28 01:42:17 +02:00
Pau Ferrer Ocaña 15e9f2138f MDL-55951 output: Add errorcode to fatal_error when available 2016-09-28 00:10:04 +02:00
Tim Hunt 493f5d4851 MDL-56136 restore: better error handling copying file at start 2016-09-27 18:10:07 +01:00
AMOS bot d88b9544ff Automatically generated installer lang files 2016-09-28 00:04:44 +08:00
Dan Poltawski f808dbbafb Merge branch 'MDL-56040-31' of https://github.com/StudiUM/moodle into MOODLE_31_STABLE 2016-09-27 14:57:31 +01:00
Dan Poltawski 18b723fac1 Merge branch 'MDL-55987-31-grademem' of git://github.com/mudrd8mz/moodle into MOODLE_31_STABLE 2016-09-27 11:23:49 +01:00
Dan Poltawski 965b398dd7 Merge branch 'MDL-54793-31' of git://github.com/cameron1729/moodle into MOODLE_31_STABLE 2016-09-27 11:13:36 +01:00
Dan Poltawski 1557906329 Merge branch 'MDL-55957-31-workshopfiles' of git://github.com/mudrd8mz/moodle into MOODLE_31_STABLE 2016-09-27 10:37:27 +01:00
Dan Poltawski caf5410257 Merge branch 'MDL-55760-31' of https://github.com/StudiUM/moodle into MOODLE_31_STABLE 2016-09-27 10:18:50 +01:00
David Monllao f7707b7196 MDL-55804 tool_uploadcourse: strftime only to user input
Default value already comes as a timestamp.
2016-09-27 08:12:08 +08:00
David Monllao 8b27687b5f MDL-55804 forms: Return exported data through _prepareValue 2016-09-27 08:12:08 +08:00
Dan Poltawski e5b39bdac5 Merge branch 'MDL-55472-assign-extend-ignored-validation-MOODLE_31_STABLE' of https://github.com/ilya-catalyst/moodle into MOODLE_31_STABLE 2016-09-26 15:32:26 +01:00
Dan Poltawski e1ce291e1a Merge branch 'wip-MDL-55519-31' of git://github.com/abgreeve/moodle into MOODLE_31_STABLE 2016-09-26 15:23:15 +01:00
Juan Leyva 23460f7fdb MDL-55222 webservice: Apply external_format_string in course names 2016-09-26 12:42:20 +01:00
Ilya Tregubov ff45fa7435 MDL-55472 assign: Show userlist on extension form error page 2016-09-25 11:32:13 +10:00
AMOS bot ecff89d617 Automatically generated installer lang files 2016-09-24 00:04:36 +08:00
Issam Taboubi 7ace09de5f MDL-55760 tool_lp: Wrong rating display when more than one scale set 2016-09-23 11:03:58 -04:00
Jean-Philippe Gaudreau 1706cd5f1b MDL-56040 behat: Fixing missing "|" in tables 2016-09-23 09:19:33 -04:00
Eloy Lafuente (stronk7) 6aec209125 weekly release 3.1.2+ 2016-09-23 10:01:48 +02:00
Eloy Lafuente (stronk7) 8262bff81f Merge branch 'install_31_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_31_STABLE 2016-09-23 10:01:44 +02:00
AMOS bot 9f351dce88 Automatically generated installer lang files 2016-09-23 00:04:45 +08:00
Simey Lameze 10d480aefc MDL-54802 mod_quiz: Add validation to require passing grade greater than 0
This commit adds a form validation to prevent the creation of quizzes
using zero or null grade to pass when using require passing grade.
2016-09-22 08:54:51 +08:00
David Mudrák d82859b2c1 MDL-46946 user: Make missing required custom fields trigger profile edit
If there is a required custom field that the user can fill by editing
their profile, and that field is missing, the user should be considered
as not fully set up. Instead, we want to redirect them to edit their
profile first.

There are some exceptions when we want to fall back to the previous
behaviour and check just the name and email fields. These exceptional
cases include checking remote user data in incoming MNet request (no
user id, no custom fields supported) and calls to require_login() with
redirecting disabled (typically ajax filepicker requests on profile
editing page itself).

Additional plugins that call the function user_not_fully_set_up()
themselves, should perform the strict check in most/typical cases. So
the strict mode is enabled by default even if it changes the behaviour
slightly. In improbable case of additional plugins relying on the
previous behaviour of the function, they can use the $strict parameter
and keep performing the lax check. However, I am sure the correct fix in
that case will likely be to stop abusing this function.

Note that custom fields are not currently transferred during the MNet
roaming. So having custom fields configured as required on MNet service
provider site (where users can't edit their profiles) is expected to
display an error (as the site is considered as misconfigured).
2016-09-21 18:02:51 +02:00
Damyon Wiese 30c5f7d5e2 MDL-56052 block_settings: race condition
YUI events module must be loaded before global events can be used.
2016-09-21 12:22:16 +08:00
sam marshall 6b1e6b6beb MDL-56038 Web services: json_last_error_msg not in PHP 5.4 2016-09-20 14:55:02 +01:00
Marina Glancy d99f038262 MDL-55990 tags: remove unnecessary index creation 2016-09-20 09:31:03 +08:00
Adrian Greeve ca985c82b2 MDL-55519 activities: mform element shows correct maxgrade.
In certain circumstances the max grade value would revert
back to the default max grade value.
2016-09-20 09:29:58 +08:00
Andrew Nicols 6d26c2f7f6 Merge branch 'MDL-55876-31' of git://github.com/lameze/moodle into MOODLE_31_STABLE 2016-09-20 09:11:10 +08:00
Simey Lameze 5ecce533f5 MDL-55876 core_course: prevent changes on front page course 2016-09-20 08:49:27 +08:00
Andrew Nicols be686d6c54 Merge branch 'MDL-55586-31' of https://github.com/StudiUM/moodle into MOODLE_31_STABLE 2016-09-20 08:19:30 +08:00
Ruslan Kabalin ac8ad1ae81 MDL-55776 enrol: Optimise enrolled users listing.
Here we optimise SQL queries for enrolled users list. Expensive subquery is
replaced with faster LEFT JOIN and the whole groups filtering component is
aded on demand.
2016-09-19 23:47:37 +02:00
Ruslan Kabalin 40e34b842b MDL-55776 enrol: Add unit tests for enrolment manager. 2016-09-19 23:47:27 +02:00
Issam Taboubi d82add23e6 MDL-55586 report_competency: Translation strings in competencies 2016-09-19 12:05:08 -04:00
Issam Taboubi 31ddf0fc3e MDL-55586 blocks_lp: Translation strings in competencies 2016-09-19 12:04:45 -04:00
AMOS bot 893391150b Automatically generated installer lang files 2016-09-20 00:04:39 +08:00
Dan Poltawski 0bfcf570e1 Merge branch 'wip-mdl-55117-m31' of https://github.com/rajeshtaneja/moodle into MOODLE_31_STABLE 2016-09-19 11:39:42 +01:00
Dan Poltawski 613c9aa5c8 Merge branch 'm31_MDL-55820' of git://github.com/danmarsden/moodle into MOODLE_31_STABLE 2016-09-19 11:32:21 +01:00
Dan Poltawski f1cfb0d949 Merge branch 'MDL-55944_31' of https://github.com/mr-russ/moodle into MOODLE_31_STABLE 2016-09-19 11:28:40 +01:00
Eloy Lafuente (stronk7) 9095c382ff MDL-29332 versions: Force bump because patch ones were matching upstream 2016-09-19 12:01:20 +02:00
Eloy Lafuente (stronk7) 7e278251ee Merge branch 'wip-MDL-29332-31' of git://github.com/marinaglancy/moodle into MOODLE_31_STABLE 2016-09-19 11:59:01 +02:00
Dani Palou 95356cd73c MDL-56019 ws: Use itemid null when getting modules intro 2016-09-19 11:45:15 +02:00
David Monllao 23f9e0c40b Merge branch 'MDL-42041-31' of git://github.com/andrewnicols/moodle into MOODLE_31_STABLE 2016-09-19 15:09:29 +08:00
David Monllao e81330e2d4 Merge branch 'MDL-55602-m31' of https://github.com/mrmark/moodle into MOODLE_31_STABLE 2016-09-19 12:50:38 +08:00
Andrew Nicols 6f53b717ab Merge branch 'MDL-55932-31' of https://github.com/eberhardt/moodle into MOODLE_31_STABLE 2016-09-19 08:33:37 +08:00
AMOS bot 7c55c645c5 Automatically generated installer lang files 2016-09-17 00:04:48 +08:00
Russell Smith 6f38fa71a6 MDL-55602 session: Add redis handler with locking.
Backport of MDL-54606
2016-09-16 08:13:35 -07:00
David Mudrák d67c4d7856 MDL-55987 gradebook: Claim extra memory when updating final grades
As we experienced in a bigger moodle.org course (7500 users, 70 grade
items), the standard memory limit 256M may not be enough here. We were
not able to find any obvious memory leak in the processing. Requiring
extra memory helped in this particular case and it seems reasonable to
have it in the core.
2016-09-16 12:45:15 +02:00
AMOS bot 24e64853b0 Automatically generated installer lang files 2016-09-16 00:04:58 +08:00
Jan Eberhardt dac212419d MDL-55932 block_rss_client: Namespace fixes 2016-09-15 13:23:32 +00:00
Dan Poltawski c648d44c9b weekly release 3.1.2+ 2016-09-15 11:15:06 +01:00
Dan Poltawski 304588c980 Merge branch 'install_31_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_31_STABLE 2016-09-15 11:15:05 +01:00
David Monllao efba8389e9 Merge branch 'MDL-55945-31' of https://github.com/snake/moodle into MOODLE_31_STABLE 2016-09-15 12:38:53 +08:00
Jake Dallimore 9c3cd30d97 MDL-55945 login: fix https support for forgot_password.php 2016-09-15 09:21:22 +08:00
AMOS bot 1809cb1adb Automatically generated installer lang files 2016-09-15 00:12:14 +08:00
David Mudrák 516350b791 MDL-55957 workshop: Add behat tests for embedded images
This tests basic functionality of the images embedded into the
instructions and conclusion fields.
2016-09-14 14:32:52 +02:00
David Mudrák d5aa0d54ae MDL-55957 workshop: Fix the embedded files serving
There was a bug with serving the files from the areas instructauthors,
instructreviewers and conclusion. These three areas should not use the
itemid in the plugininfo URLs. But they did use 0 as the itemid which
broke the file previews when browsing via server files repository.

The first part of the patch fixes all relevant calls to
file_rewrite_pluginfile_urls() so that null is now properly used instead
of zero.

The second part of the fix is that we no longer delete the first $args
element in the workshop_pluginfile() function - the itemid is not
supposed to appear there now.

The last part of the patch is that instead of repeating the same code
block copy&pasted for each file area in workshop_pluginfile(), we now
have a single block covering them all.
2016-09-14 12:40:26 +02:00
Rajesh Taneja 32935e9bf6 MDL-55117 behat: Re-initialise to ensure modified config is not used
As behat cli process is 1 run for features
Any modification in  will be reflected
in later runs on cli. In this case
- disabling enablebadges in block_badges.feature
- reflected while running cron in award_badges.feature
2016-09-14 10:46:55 +08:00
Russell Smith e4439947ac MDL-55944 testing: Reduce sleep usage.
Remove sleep() and replace with waiting for a second to roll over,
this results in a simpler call the guarantee time() has moved forward
2016-09-14 09:50:32 +10:00
Marina Glancy 9135f6347e MDL-55864 general: fix PHP7.1 strict warnings 2016-09-13 15:24:34 +01:00
Marina Glancy c9ce7bfb20 MDL-29332 question: calculated variables may differ in case only 2016-09-13 10:18:34 +08:00
Eloy Lafuente (stronk7) 0a7c6b8a57 Merge branch 'wip-MDL-55505-31' of git://github.com/abgreeve/moodle into MOODLE_31_STABLE 2016-09-12 19:26:30 +02:00
Eloy Lafuente (stronk7) 5a44db7646 Merge branch 'wip-MDL-55654-31' of git://github.com/marinaglancy/moodle into MOODLE_31_STABLE 2016-09-12 19:15:55 +02:00
Eloy Lafuente (stronk7) bbe5329a3b Merge branch 'MDL-55632-31' of git://github.com/andrewnicols/moodle into MOODLE_31_STABLE 2016-09-12 19:12:19 +02:00
Eloy Lafuente (stronk7) 1a3c879c0d Merge branch 'MDL-55874-31' of git://github.com/danpoltawski/moodle into MOODLE_31_STABLE 2016-09-12 18:32:31 +02:00
AMOS bot dbb2268e46 Automatically generated installer lang files 2016-09-13 00:04:45 +08:00
Eloy Lafuente (stronk7) 2b4d17de5b Merge branch 'MDL-55725-31' of git://github.com/merrill-oakland/moodle into MOODLE_31_STABLE 2016-09-12 17:55:11 +02:00
Eloy Lafuente (stronk7) a75d91bee3 Merge branch 'MDL-55755_31' of git://github.com/dmonllao/moodle into MOODLE_31_STABLE 2016-09-12 17:35:08 +02:00
Dan Poltawski 0baf402c71 Merge branch 'wip-mdl-55353-m31' of https://github.com/rajeshtaneja/moodle into MOODLE_31_STABLE 2016-09-12 11:49:37 +01:00
Dan Poltawski 0a7742edef Merge branch 'wip-MDL-55862-31' of git://github.com/abgreeve/moodle into MOODLE_31_STABLE 2016-09-12 11:11:27 +01:00
Dan Poltawski d274298126 Merge branch 'wip-mdl-55610-m31' of https://github.com/rajeshtaneja/moodle into MOODLE_31_STABLE 2016-09-12 10:18:18 +01:00
David Monllao cf80222fb1 Merge branch 'MDL-55626-M31' of git://github.com/lazydaisy/moodle into MOODLE_31_STABLE 2016-09-12 12:38:27 +08:00
David Monllao 36d5449df9 Merge branch 'MDL-55873-31' of git://github.com/lameze/moodle into MOODLE_31_STABLE 2016-09-12 12:00:15 +08:00
Simey Lameze 58a0535a04 MDL-55873 login: change back username fields to use PARAM_RAW 2016-09-12 11:50:15 +08:00
David Monllao e2c8d6b17f Merge branch 'MDL-53893-31' of git://github.com/lameze/moodle into MOODLE_31_STABLE 2016-09-12 10:29:33 +08:00
Eloy Lafuente (stronk7) f851201f58 Moodle release 3.1.2 2016-09-10 22:50:25 +02:00
lazydaisy fd029f3aae MDL-55626 theme_clean: Fixed clean theme missing desktop-first-column 2016-09-10 01:22:49 +01:00
Stephen Bourget e8924af84a MDL-55910 events: backport MDL-45753 dashboard events 2016-09-09 10:35:22 +01:00
Marina Glancy 30399fadb0 MDL-55654 user: apply format_string to field names 2016-09-09 14:32:32 +08:00
Rajesh Taneja a22a2b148d MDL-55353 behat: Ensure teacher edit activity at different time
Recent activity is showing activities which were
updated since user last logged in and first modification
done on the activity. So ensure update happens at different
time than activity created.
2016-09-09 10:16:34 +08:00
Simey Lameze 8adf00753c MDL-53893 core_badges: Behat for all selected roles award badges 2016-09-09 08:43:45 +08:00
Simey Lameze f7d2474907 MDL-53893 core_badges: Add strictness to manual badge criteria 2016-09-09 08:43:45 +08:00
David Monllao ab2a2d629f MDL-55755 search: Correct event link 2016-09-09 07:57:54 +08:00
Adrian Greeve 0489c3c878 MDL-55505 mod_assign: Editing previous attempt works correctly.
Editing a previous attempt keeps the current feedback and grades
as it should and does not override them.
2016-09-08 20:32:25 +08:00
Adrian Greeve ab95f66c2e MDL-55862 mod_data: Use proper name function for display.
The old method for displaying the name of a field was being
used. This meant that it was not possible to show a plugin's
name in view.php

Thanks to David Herney Bernal for providing a solution.
2016-09-08 20:28:52 +08:00
Dan Poltawski 8857a38fcf MDL-55874 report_particiption: fix invalid html
When messaging disabled.
2016-09-08 08:04:48 +01:00
David Monllao 2ab80152e2 weekly release 3.1.1+ 2016-09-08 13:56:42 +08:00
David Monllao 9bb75e570d Merge branch 'install_31_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_31_STABLE 2016-09-08 13:56:40 +08:00
Eric Merrill 937ddb9e5a MDL-55725 search: Index proper time modified with indexed files 2016-09-07 17:34:23 -04:00
Adrian Greeve e7e9d06bf3 MDL-41174 mod_workshop: Added workshop_refresh_events
This function was missing from this activity.
2016-09-07 15:20:11 +08:00
Jake Dallimore 8c42211e3f MDL-50803 login: Remove token from URL in forgot password process
Store the token value in the session and redirect to self, thus
removing the token from the URL and eliminating the problem where
the token is exposed via the http referer header.
2016-09-07 09:07:28 +08:00
Juan Leyva 468de02565 MDL-49026 webservice: Remove tokens on password change 2016-09-07 09:07:28 +08:00
Eloy Lafuente (stronk7) 5ef133e913 Merge branch 'wip-mdl-55764-m31' of https://github.com/rajeshtaneja/moodle into MOODLE_31_STABLE 2016-09-07 03:06:34 +02:00
Eloy Lafuente (stronk7) 2a681ccd06 Merge branch 'MDL-55618-m31' of https://github.com/NeillM/moodle into MOODLE_31_STABLE 2016-09-06 16:20:41 +02:00
Eloy Lafuente (stronk7) 2a098c992a Merge branch 'wip-MDL-55844-31' of git://github.com/marinaglancy/moodle into MOODLE_31_STABLE 2016-09-06 16:08:23 +02:00
Eloy Lafuente (stronk7) 9f16f3bdcd Merge branch 'wip-MDL-55832-31' of git://github.com/marinaglancy/moodle into MOODLE_31_STABLE 2016-09-06 15:56:15 +02:00
Dan Poltawski 929a775579 MDL-42125 quiz stats: removal trivial additional phpdocs newline 2016-09-06 11:49:11 +01:00
Dan Poltawski 2516b865f2 Merge branch 'MDL-42125_31' of git://github.com/timhunt/moodle into MOODLE_31_STABLE 2016-09-06 11:48:52 +01:00
Dan Poltawski 1ec726e2a4 Merge branch 'wip-mdl-55749-m31' of https://github.com/rajeshtaneja/moodle into MOODLE_31_STABLE 2016-09-06 08:45:44 +01:00
Andrew Nicols 0a6f9cf6d2 MDL-42041 mod_book: Add Turn Editing On to page body 2016-09-06 15:39:30 +08:00
Rajesh Taneja 9ce415860b MDL-55749 badges: define global before using it 2016-09-06 10:28:36 +08:00
David Monllao 009dcc16ae Merge branch 'MDL-55617-m31' of https://github.com/NeillM/moodle into MOODLE_31_STABLE 2016-09-06 10:18:16 +08:00
David Monllao bf80c7b9c1 Merge branch 'MDL-55587-31' of git://github.com/cameron1729/moodle into MOODLE_31_STABLE 2016-09-06 10:07:11 +08:00
Rajesh Taneja b7fc4a06f1 MDL-55610 behat: Clear static file cache
php file cache might be out-of-sync
to ensure full directory is deleted
clear php file cache
2016-09-06 09:43:54 +08:00
Eloy Lafuente (stronk7) 36142e4ed6 Merge branch 'MDL-55663-31' of git://github.com/FMCorz/moodle into MOODLE_31_STABLE 2016-09-05 18:07:16 +02:00
AMOS bot 3cb9eba870 Automatically generated installer lang files 2016-09-06 00:04:47 +08:00
Eloy Lafuente (stronk7) f3aeccb270 Merge branch 'MDL-55717_m31' of git://github.com/markn86/moodle into MOODLE_31_STABLE 2016-09-05 18:02:44 +02:00
Eloy Lafuente (stronk7) 28020ce31e Merge branch 'MDL-55724-m31' of https://github.com/sammarshallou/moodle into MOODLE_31_STABLE 2016-09-05 17:33:46 +02:00
Dan Poltawski 88e0275e29 Merge branch 'MDL-55627_31' of https://github.com/bostelm/moodle into MOODLE_31_STABLE 2016-09-05 14:09:16 +01:00
Dan Poltawski dd5a5b75e6 Merge branch 'MDL-55742-31' of https://github.com/xow/moodle into MOODLE_31_STABLE 2016-09-05 10:50:47 +01:00
Henning Bostelmann 9a6f6ee022 MDL-55627 filter_mathjaxloader: use correct string concatenation op 2016-09-05 11:48:33 +02:00
Dan Poltawski f641bde359 Merge branch 'MDL-55771_m31' of git://github.com/markn86/moodle into MOODLE_31_STABLE 2016-09-05 10:18:56 +01:00
Dan Poltawski 5a7ce1b2a2 Merge branch 'MDL-55815_31' of git://github.com/timhunt/moodle into MOODLE_31_STABLE 2016-09-05 08:57:36 +01:00
Dan Poltawski 51dd539322 Merge branch 'MDL-54113-31' of git://github.com/andrewnicols/moodle into MOODLE_31_STABLE 2016-09-05 07:53:07 +01:00
David Monllao d966b1b18d Merge branch 'wip-MDL-41174-31' of git://github.com/abgreeve/moodle into MOODLE_31_STABLE 2016-09-05 13:45:46 +08:00
David Monllao 28181985df Merge branch 'MDL-55457-31' of https://github.com/xow/moodle into MOODLE_31_STABLE 2016-09-05 11:48:43 +08:00
David Monllao c527b281d7 Merge branch 'wip-MDL-55707-31' of git://github.com/abgreeve/moodle into MOODLE_31_STABLE 2016-09-05 10:48:01 +08:00
Adrian Greeve 464890f58a MDL-41174 course: Module name change updates calendar. 2016-09-05 08:55:06 +08:00
Marina Glancy 8461e34f4d MDL-55844 profile: display formatted course name 2016-09-02 17:59:58 +08:00
John Okely 60df6ae90d MDL-55457 mod_lti: Support object icon_info in tool proxy 2016-09-02 09:45:42 +08:00
Marina Glancy 4ed5fc5efa MDL-55832 mod_feedback: apply filters to multichoice quesitons 2016-09-01 21:09:21 +08:00
Tim Hunt 603ee3605b MDL-42125 quiz stats: fix regression caused by MDL-51603 2016-09-01 12:39:01 +01:00
Tim Hunt ac32161ca6 MDL-42125 quiz stats: clearer message when manual grading required 2016-09-01 12:39:00 +01:00
Cameron Ball 9823b5c677 MDL-54793 webservice_xmlrpc: Don't treat GET and POST as arguments 2016-09-01 16:06:45 +08:00
Neill Magill 6130c2493f MDL-55617 backup: Possible fatal errors in backup and restore
The unserialize() function will not always return an object
especially when as can happen the controller field of a
record in the backup_controllers table is empty.

This change ensures that in this case the script will
not cause a fatal error, but instead throw an error.
2016-09-01 08:47:51 +01:00
Neill Magill 68cbd916a6 MDL-55618 backup: Header should not be output twice
Before this patch if the pre-check failed during
the final stage of an import a request for the
page header to be output was made for a second
time, this caused a coding_error to occur.

This change removes the second request to
output the page header, which will allow the user
to see the reasons the pre-check failed.
2016-09-01 08:46:32 +01:00
John Okely 7b55399004 MDL-55742 mod_lti: Remove support for get_magic_quotes_gpc
Thanks to Bishop Bettini for the original patch.
2016-09-01 14:59:50 +08:00
David Monllao c265709cab weekly release 3.1.1+ 2016-09-01 11:14:13 +08:00
David Monllao dae85c4658 Merge branch 'install_31_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_31_STABLE 2016-09-01 11:14:11 +08:00
Adrian Greeve 396d0d5e1d MDL-55707 grades: Stop infinite loop when regrading. 2016-09-01 10:26:12 +08:00
Dan Marsden c39f5f8806 MDL-55820 scorm: use correct displayattempt default options 2016-09-01 13:28:17 +12:00
Tim Hunt 246677d537 MDL-55815 quiz review: after close should beat immediately after
This only arises in specific situations: student submitted less than 2
mintues before time close, or when a teacher previews after the close
date. However, in those cases, the old behaviour was confusing. Now,
'After the quiz is closed' takes priority.
2016-08-31 13:00:22 +01:00
Tim Hunt 1e53257bce MDL-55815 quiz: convert attempt state tests to a data provider 2016-08-31 13:00:20 +01:00
Eloy Lafuente (stronk7) b60bd5b7d0 Merge branch 'MDL-55237_31' of git://github.com/dmonllao/moodle into MOODLE_31_STABLE 2016-08-30 12:54:53 +02:00
sam marshall 297486d1b7 MDL-55724 Glossary: Prevent infinite loop in trusttext_strip 2016-08-30 10:27:02 +01:00
Mark Nelson 18af7c0536 MDL-55771 core: added title attribute when using JS to render {{pix}} 2016-08-30 14:57:54 +08:00
Marina Glancy 0e611051a9 MDL-55581 htmlpurifier: test for attributes in video tag 2016-08-30 13:49:51 +08:00
David Monllao b514df00e1 Merge branch 'MDL-54873-31' of git://github.com/andrewnicols/moodle into MOODLE_31_STABLE 2016-08-30 12:52:48 +08:00
Andrew Nicols ebd8ffb4e1 MDL-54873 assign: Seed recordid to print_recent_activity 2016-08-30 11:57:42 +08:00
Andrew Nicols cb55cd8574 MDL-54873 assign: Add recordid fetching participants
get_submission_info_for_participants is primarily used by externallib.php
2016-08-30 11:49:29 +08:00
Andrew Nicols 4693e0ca86 MDL-54873 assign: Fetch mapping id for blind marking in cron 2016-08-30 11:49:29 +08:00
Andrew Nicols 91840654b1 MDL-54873 assign: Fetch mapping id for blind marking grading
This change modifies the grading table to pre-seed record ids where they
already exist.

Where they do not exist, they are still fetched.
2016-08-30 11:49:29 +08:00
Frederic Massart e4cbcf716b MDL-55663 filter: Filters could be incorrectly reported as inactive 2016-08-30 11:23:26 +08:00
David Monllao 0783a94d3e MDL-55237 core_component: Fix last namespace level matching
Thanks to Andreas Grabs for proposing a fix.
2016-08-30 11:16:20 +08:00
Rajesh Taneja 643b907d2f MDL-55764 behat: Reset static update db list
While running multiple suites we should
ensure static cli cache is also reset.
2016-08-30 08:01:24 +08:00
David Mudrák 0c3f40bd61 MDL-55660 tablelib: Fetch only a single row when auto defining columns
In a very rare cases where the columns are not declared explicitly, we
want to fetch single row only without a warning raised. This seems like
a valid use case for IGNORE_MULTIPLE flag.
2016-08-29 19:14:10 +02:00
AMOS bot 64e6f4e471 Automatically generated installer lang files 2016-08-30 00:04:56 +08:00
Eloy Lafuente (stronk7) 50eb83b357 Merge branch 'MDL-55667-31-participantslink' of git://github.com/mudrd8mz/moodle into MOODLE_31_STABLE 2016-08-29 16:53:54 +02:00
Eloy Lafuente (stronk7) 5c6b292d93 Merge branch 'MDL-55741_31' of git://github.com/timhunt/moodle into MOODLE_31_STABLE 2016-08-29 14:08:47 +02:00
Cameron Ball 4d4df5a1b3 MDL-55587 core_media: Properly escape ampersand 2016-08-29 19:16:29 +08:00
David Mudrák afb949e087 MDL-55667 navigation: Do not display site participants link to students
The problem here was that user/index.php checks the system level
capability moodle/site:viewparticipants when the user is on the front
page, and the moodle/course:viewparticipants on non-front pages.

But the navigation displayed the link by mistake even in situations,
when the user has the capability moodle/course:viewparticipants on the
front page (typically when the default role for the front page is set to
student).

Added behat tests for reproducing the bug and also for checking the
basic functionality of the feature.
2016-08-29 12:11:59 +02:00
David Monllao e0434911f3 Merge branch 'wip-MDL-55581-31' of git://github.com/marinaglancy/moodle into MOODLE_31_STABLE 2016-08-29 16:53:56 +08:00
David Monllao 7e24044902 Merge branch 'MDL-55661-31-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_31_STABLE 2016-08-29 14:40:37 +08:00
David Monllao db78183e45 Merge branch 'MDL-55312_load_timeout_for_amd_modules_31' of https://github.com/gthomas2/moodle into MOODLE_31_STABLE 2016-08-29 14:31:50 +08:00
Marina Glancy 28108d5e08 MDL-55581 htmlpurifier: allow track tag in videos and audios 2016-08-29 13:26:14 +08:00
David Monllao 4472485ebf Merge branch 'wip-MDL-55708-31' of git://github.com/marinaglancy/moodle into MOODLE_31_STABLE 2016-08-29 11:19:08 +08:00
David Monllao 93611f5e2c Merge branch 'MDL-55477_31' of git://github.com/timhunt/moodle into MOODLE_31_STABLE 2016-08-29 11:14:28 +08:00
David Monllao 6f3590457e Merge branch 'MDL-55668-31' of git://github.com/danpoltawski/moodle into MOODLE_31_STABLE 2016-08-29 10:26:58 +08:00
Tim Hunt b2a5bd853b MDL-55741 phpunit: does not reset get_log_manager cache 2016-08-26 17:15:26 +01:00
AMOS bot 0cd3d67eac Automatically generated installer lang files 2016-08-27 00:04:51 +08:00
Helen Foster 59dacea6a6 MDL-55661 lang: Merge English strings from the en_fix language pack 2016-08-25 14:40:28 +02:00
Dan Poltawski 95839d65c7 weekly release 3.1.1+ 2016-08-25 12:09:45 +01:00
Dan Poltawski 846523c75b Merge branch 'install_31_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_31_STABLE 2016-08-25 12:09:44 +01:00
Mark Nelson 97e886c576 MDL-55717 core: add 'ignoredirty' class to inplace editable 2016-08-25 16:08:09 +08:00
Rajesh Taneja 01f32afad4 MDL-46514 behat: Get config value from db, to avoid cache 2016-08-25 10:37:24 +08:00
Marina Glancy c59eddd327 MDL-55708 mod_assign: display formatted acitvity names 2016-08-25 09:53:51 +08:00
AMOS bot d4f6d857bf Automatically generated installer lang files 2016-08-25 00:05:19 +08:00
Damyon Wiese 1fc7e6b184 MDL-55668 assign: Don't link to user profile if blind marking is enabled 2016-08-24 11:39:48 +01:00
Andrew Nicols b6e3abd875 MDL-54113 assign: Open files in new window
Open files in a new window when viewing to ensure that the form change
checker does not warn about the page reloading.
2016-08-24 11:34:21 +08:00
David Monllao 08f5c15f6e MDL-55604 cache: Updating comment according to code changes 2016-08-24 09:39:01 +08:00
David Monllao 6fa8232f32 Merge branch 'MDL-55604-31' of https://github.com/mr-russ/moodle into MOODLE_31_STABLE 2016-08-24 09:36:36 +08:00
Russell Smith 6311ae6d29 MDL-55604 cache: Fix identifier and cacheable_object
When a cachable object is store in the static cache from
the backing store, it was incorrect serialised rather than
using the wake function.  This has been resolved and tests added.

During the investigation into cacheable_object, it was discovered
that set_identifiers never removes identifiers when you call it,
so set_identifiers(array('a')) and set_identifiers(array('b')) really
resulted in array('a','b') as the identifiers rather than 'b'.

The fix for this issue depends on the set_identifiers fix and
they have been coupled together as a result.
2016-08-24 11:25:53 +10:00
David Monllao 954881c187 Merge branch 'MDL-55385_31_STABLE' of https://github.com/marxjohnson/moodle into MOODLE_31_STABLE 2016-08-24 08:24:42 +08:00
gthomas2 1df4dfe560 MDL-55312 requirejs: Fix timeouts with infinite waitSeconds 2016-08-23 17:40:03 +01:00
Dan Poltawski 868acab35c Merge branch 'MDL-55628-m31' of https://github.com/sammarshallou/moodle into MOODLE_31_STABLE 2016-08-23 15:48:11 +01:00
Dan Poltawski 1e5edb62a0 MDL-55423 tests: remove non-cross-db testcase
This isn't used in moodle core and is problematic on oracle, don't test
it.
2016-08-23 12:37:24 +01:00
Mark Johnson 9f95b657e2 MDL-55385 output: Support non-integer output_buffering values 2016-08-23 11:22:57 +01:00
Dan Poltawski db10a07def Merge branch 'wip-mdl-46514-m31' of https://github.com/rajeshtaneja/moodle into MOODLE_31_STABLE 2016-08-23 08:59:41 +01:00
David Monllao 008dede307 Merge branch 'MDL-46654-31' of git://github.com/andrewnicols/moodle into MOODLE_31_STABLE 2016-08-23 15:31:12 +08:00
Rajesh Taneja 1278115963 MDL-46514 behat: section should be set before switch-case 2016-08-23 15:19:29 +08:00
Rajesh Taneja bb13f05a0e MDL-46514 behat: Catch php errors in shutdown hook
If error is not displayed in web browser then
it will be caught in shutdown hook, so we can
show it to user
2016-08-23 15:19:29 +08:00
Rajesh Taneja f7a8bc6378 MDL-46514 behat: Delete tablesupdatedbyscenario before suite
Delete tablesupdatedbyscenario before db reset to ensure
db is fully reset. In case user exits or process terminated
then the file will be left and can lead to wrong results
2016-08-23 15:19:29 +08:00
Rajesh Taneja 47f8aa9400 MDL-46514 behat: Catch errors shown by JS 2016-08-23 15:19:29 +08:00
David Monllao 8ea8024e35 Merge branch 'MDL-55391-31' of git://github.com/danpoltawski/moodle into MOODLE_31_STABLE 2016-08-23 13:00:42 +08:00
David Monllao 3a250bbae9 Merge branch 'MDL-54838-31' of https://github.com/nashtechdev01/moodle into MOODLE_31_STABLE 2016-08-23 12:44:08 +08:00
sam marshall 3226f39671 MDL-55628 Completion: Use simpledata for completion cache
The completion cache is currently not marked as simpledata. On the
course page it is frequently retrieved hundreds of times which results
in many calls to the slow unserialize function. By making a slight
change to the data format (using arrays instead of objects) we can
mark it as simpledata, which will avoid using unserialize.
2016-08-22 17:15:09 +01:00
Dan Poltawski 2f46fadb78 Merge branch 'MDL-55273-cookie-secure-default-MOODLE_31_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_31_STABLE 2016-08-22 15:25:38 +01:00
Jake Dallimore 4f424b7b0c MDL-55565 core_backup: Fix warning when restoring question categories
Fixed a call to get_records_sql, which was being used incorrectly in
restore_find_best_target_context to determine a unique contextid.
2016-08-22 14:23:18 +01:00
Dan Poltawski 5d27e53631 Merge branch 'MDL-55605-lesson-restore-bug-MOODLE_31_STABLE' of https://github.com/kenneth-hendricks/moodle into MOODLE_31_STABLE 2016-08-22 14:13:27 +01:00
Dan Poltawski d62cb5dd84 Merge branch 'MDL-55551_m31v1' of https://github.com/sbourget/moodle into MOODLE_31_STABLE 2016-08-22 12:53:32 +01:00
Dan Poltawski bbc4dd5810 Merge branch 'MDL-55557_m31v1' of https://github.com/sbourget/moodle into MOODLE_31_STABLE 2016-08-22 12:45:54 +01:00
Andrew Nicols b8ff0cd6e5 MDL-46654 mod_forum: Hide digestoptions when no subscription
Daily digest options should not be generated if the user cannot subscribe
to anything in the first place.
2016-08-22 19:12:52 +08:00
Dan Poltawski 64227b4233 Merge branch 'MDL_55423_31' of https://github.com/alexandru-elisei/moodle into MOODLE_31_STABLE 2016-08-22 09:57:21 +01:00
Tim Hunt 033edd6cf7 MDL-55477 quiz reports: all user fields should have repeats suppressed 2016-08-19 18:05:14 +01:00
Dan Poltawski 19660f1f0f MDL-55391 block_rss: fix typo preventing feed title display 2016-08-19 09:44:40 +01:00
Andrew Nicols fcc0c4c8c8 MDL-55632 mod_forum: Tidy up forum post messages 2016-08-19 09:57:28 +08:00
Kenneth Hendricks d56d575df9 MDL-55605 mod_lesson: Fix activitylinks restore bug 2016-08-18 16:38:20 +10:00
Adrian Greeve 2a6404aa68 MDL-22183 lib: More unit tests for next day start. 2016-08-18 10:21:06 +08:00
Adrian Greeve f65ff89e69 MDL-22183 lib: Cleanup of get_next functions. 2016-08-18 10:20:51 +08:00
Adrian Greeve 42490916b4 MDL-22183 lib: Time settings removed for stats cron.
Old settings that should be ignored have been removed from the
statistics cron code.
2016-08-18 10:20:31 +08:00
Alexandru Elisei e8d84901ca MDL-55423 accesslib: Prevent get_role_users() false debugging messages 2016-08-17 20:39:40 +03:00
Dan Poltawski e90dfb32ae weekly release 3.1.1+ 2016-08-17 14:47:20 +01:00
Andrew Nicols 1ea227df0c Merge branch 'wip-MDL-50586-31-fix' of https://github.com/marinaglancy/moodle into MOODLE_31_STABLE 2016-08-17 13:33:12 +08:00
Marina Glancy 69ec2b9e95 MDL-50586 gradingform_rubric: 0-level warning during redirection 2016-08-17 13:00:04 +08:00
Dan Poltawski 5ec43185b2 Merge branch 'MDL-36713_m31v2' of https://github.com/sbourget/moodle into MOODLE_31_STABLE 2016-08-16 12:05:13 +01:00
Andrew Nicols b4b46d838d Merge branch 'MDL-55272-31' of https://github.com/mr-russ/moodle into MOODLE_31_STABLE 2016-08-16 15:10:06 +08:00
Brendan Heywood 5c2e284ac5 MDL-55273 admin: Change $CFG->cookiesecure default to on 2016-08-16 13:35:47 +10:00
Damyon Wiese 6abdc807a9 MDL-55520 forms: Properly format the grademax for the database 2016-08-16 11:21:43 +08:00
Russell Smith ffd1a26a0b MDL-55272 lib: Allow random_bytes() to return large values.
PHP has a recursion limit and random_bytes on PHP5.6 without openssl
will error if sent a large value.  Using a loop has lower overhead than
recursion as well.
2016-08-16 12:15:04 +10:00
Stephen Bourget e70c8017ee MDL-36713 Blog: Display accurate error when a guest views a user blog 2016-08-15 21:49:25 -04:00
Andrew Nicols 7d7db30389 Merge branch 'wip-MDL-50586-31' of git://github.com/marinaglancy/moodle into MOODLE_31_STABLE 2016-08-16 08:52:37 +08:00
Andrew Nicols aab047089d MDL-54647 tests: Clarify unoconv tests 2016-08-16 08:18:39 +08:00
Andrew Nicols 31b0497988 Merge branch 'MDL-54647-31' of git://github.com/damyon/moodle into MOODLE_31_STABLE 2016-08-16 08:18:30 +08:00
Dan Poltawski 0ba31f0fd0 Merge branch 'wip-MDL-55494-31' of git://github.com/marinaglancy/moodle into MOODLE_31_STABLE 2016-08-15 13:14:41 +01:00
Dan Poltawski 22d7758077 MDL-52105 enrol_self: fix upgrade savepoint 2016-08-15 12:11:46 +01:00
Dan Poltawski 74d9779561 Merge branch 'wip-MDL-55366-31' of git://github.com/abgreeve/moodle into MOODLE_31_STABLE 2016-08-15 11:43:46 +01:00
Dan Poltawski 57d60766f5 Merge branch 'wip-mdl-55380-m31' of https://github.com/rajeshtaneja/moodle into MOODLE_31_STABLE 2016-08-15 11:38:34 +01:00
Dan Poltawski dbb90a1242 Merge branch 'wip-MDL-55397-31' of git://github.com/marinaglancy/moodle into MOODLE_31_STABLE 2016-08-15 11:35:37 +01:00
Dan Poltawski cc94a621e0 Merge branch 'MDL-52105-31' of git://github.com/lameze/moodle into MOODLE_31_STABLE 2016-08-15 11:15:46 +01:00
Damyon Wiese 6659c61d2c MDL-54647 tests: Reverse order of expected and actual 2016-08-15 16:34:59 +08:00
Damyon Wiese e9365f3e44 MDL-54647 file_storage: Redo the test pdf every time it's viewed 2016-08-15 16:34:58 +08:00
Andrew Nicols a5ea66c91a Merge branch 'MDL-55513-31' of https://github.com/lucisgit/moodle into MOODLE_31_STABLE 2016-08-15 14:09:23 +08:00
Simey Lameze 63bf2d4d50 MDL-52105 enrol_self: Behat test for key holder feature 2016-08-15 12:50:22 +08:00
Simey Lameze 331488f381 MDL-52105 enrol_self: Fix wrong holdkey cap restriction for manager
This commit add an upgrade step to remove wrong CAP_PROHIBIT on enrol/self:holdkey for manager role.
Also remove the restriction from the self enrolment access file.
2016-08-15 12:50:21 +08:00
Andrew Nicols 432ed966ae Merge branch 'MDL-55229-31' of git://github.com/lameze/moodle into MOODLE_31_STABLE 2016-08-15 12:40:43 +08:00
Andrew Nicols 30fdcea14c Merge branch 'MDL-55520-31' of git://github.com/damyon/moodle into MOODLE_31_STABLE 2016-08-15 11:02:35 +08:00
Adrian Greeve c013c28561 MDL-55366 mod_lesson: Fix warning with TF page.
Having an image in the answer text would create a warning.
2016-08-15 10:19:32 +08:00
Stephen Bourget f9bdb59be6 MDL-55557 mod_wiki: Add missing MOODLE_INTERNAL checks 2016-08-13 21:44:01 -04:00
Stephen Bourget 4bbb0f5f9d MDL-55551 Blog: Add missing MOODLE_INTERNAL check. 2016-08-12 20:22:30 -04:00
Marina Glancy 7407be758e MDL-55494 report_eventlist: ignore only logstore_legacy 2016-08-12 13:56:23 +08:00
Marina Glancy c8e4ff2aa5 MDL-55494 tool_monitor: ignore only tool_monitor and logstore_legacy
previously any plugin type ending with _monitor or _legacy would be ignored
2016-08-12 13:56:22 +08:00
Marina Glancy c9958ef015 MDL-50586 gradingform_rubric: warn about missing 0-points levels 2016-08-12 13:26:40 +08:00
Rajesh Taneja af24b9d15f MDL-55380 behat: Fixed shared stats definition
Stats definition was being shared between
progress and moodle_progress format which
was causing double counting. Now they both
have there own stats counter definitions
2016-08-12 10:28:04 +08:00
Marina Glancy 2f38964de1 MDL-55397 block_site_main_menu: eliminate CSS conflict
CSS for '.path-admin .buttons' defines padding, border and background that affected how main menu looks on admin pages
2016-08-11 15:42:11 +08:00
Damyon Wiese e5775ef5b2 MDL-55520 assign: Behat test for rescaling max grades bug
Verify the max grade is not silently changed back to 100 when you visit
and save the assignment settings form.
2016-08-11 15:14:38 +08:00
Damyon Wiese 6037304fc1 MDL-55520 forms: Mod grade is changing values back to default
When a field is disabled in the page - no value is sent and modgrade is reverting
to the default. This change prevents the max grade from changing accidentally.
2016-08-11 14:44:13 +08:00
Tony Butler 0ae591c0bd MDL-55513 core_filestorage: Touch and test size instead of file_exists()
file_exists() can return false when file exists (in certain scenarios)
2016-08-11 07:16:51 +01:00
Tony Butler 1dd284107c MDL-55513 core_filestorage: Pass full path of temp dir to remove_dir() 2016-08-11 07:16:51 +01:00
Andrew Nicols bba74ca5ce weekly release 3.1.1+ 2016-08-11 13:17:21 +08:00
Andrew Nicols c4f61a09f1 Merge branch 'install_31_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_31_STABLE 2016-08-11 13:17:18 +08:00
Andrew Nicols 6025c96e81 MDL-55333 mod_feedback: Correct constant name 2016-08-10 10:13:29 +08:00
Andrew Nicols 616638a3d8 Merge branch 'wip-MDL-55333-31' of git://github.com/marinaglancy/moodle into MOODLE_31_STABLE 2016-08-10 10:13:19 +08:00
Simey Lameze 369856e371 MDL-55229 course: Handle invisible course categories 2016-08-10 09:55:15 +08:00
AMOS bot 66de733a08 Automatically generated installer lang files 2016-08-10 00:04:51 +08:00
Dan Poltawski 6c906b7472 Merge branch 'wip-MDL-55425-31' of git://github.com/marinaglancy/moodle into MOODLE_31_STABLE 2016-08-09 10:58:41 +01:00
Dan Poltawski c349d5875f Merge branch 'MDL-55246_unoconv_31' of https://github.com/Syxton/moodle into MOODLE_31_STABLE 2016-08-09 10:11:14 +01:00
Dan Poltawski dde46ce38f Merge branch 'MDL-55390_31-fix' of git://github.com/dmonllao/moodle into MOODLE_31_STABLE 2016-08-09 09:29:44 +01:00
Dan Poltawski 77d2baacb1 Merge branch 'MDL-55225-31' of git://github.com/dpalou/moodle into MOODLE_31_STABLE 2016-08-09 09:21:23 +01:00
Dan Poltawski 1556a6461a MDL-51078 report_log: use simpler/faster str_split over preg_split 2016-08-09 09:08:05 +01:00
Stephen Bourget 78d55507e7 MDL-51078 report_log: Allow filtering by all changes 2016-08-09 09:08:01 +01:00
David Monllao faafae96e9 MDL-55390 search: base class was in core_search\area 2016-08-09 15:35:15 +08:00
Andrew Nicols 39bb6831fc Merge branch 'wip-mdl-55329-m31' of https://github.com/rajeshtaneja/moodle into MOODLE_31_STABLE 2016-08-09 14:27:49 +08:00
Andrew Nicols 362c7aa6bd Merge branch 'MDL-55480-31' of git://github.com/FMCorz/moodle into MOODLE_31_STABLE 2016-08-09 13:54:29 +08:00
Andrew Nicols 350918e58d MDL-55390 core_search: Correct variable name 2016-08-09 13:44:36 +08:00
Devang Gaur 0474ba379e MDL-55390 core_search: check if a search area is real 2016-08-09 13:44:32 +08:00
Andrew Nicols 657fc14951 MDL-55274 mod_chat: Add unit tests for special commands 2016-08-09 10:49:34 +08:00
Andrew Nicols 466c31ba43 Merge branch 'MDL-55274-31' of git://github.com/lameze/moodle into MOODLE_31_STABLE 2016-08-09 10:49:23 +08:00
Dan Poltawski a943c4cd4d Merge branch 'MDL-55398_m31v1' of https://github.com/sbourget/moodle into MOODLE_31_STABLE 2016-08-08 10:40:47 +01:00
Dan Poltawski 50b5467ba1 Merge branch 'wip-MDL-55418-m31' of https://github.com/marinaglancy/moodle into MOODLE_31_STABLE 2016-08-08 10:33:45 +01:00
Mark Nielsen 741d8abe84 MDL-55453 core_lib: Fix usage of js_send_uncached 2016-08-08 09:54:13 +01:00
Russell Smith cdb3a0e501 MDL-55292 performance: Allow Tideways profiler extension.
PHP7 doesn't have any default XHProf support and all other
investigated forks don't have stable PHP7.  Tideways is under
active development and is easy to install.  The data format
is compatible with XHProf so it is a drop-in replacement in that way.
2016-08-08 15:26:11 +08:00
Marina Glancy 837fb636d4 MDL-55333 mod_feedback: work around MySQL tables in join limit 2016-08-08 14:40:51 +08:00
Nick Phillips a27fe6be90 MDL-55274 mod_chat: regain beep and / command in mod_chat.
format_text cannot be called on the whole input text, but must be
called on user-supplied text that will be output into chats. This
means it cannot simply be called in one place, but must instead be
called on the relevant parts of text once commands have been matched.
2016-08-08 12:30:18 +08:00
fhuebler f14161532e MDL-55480 competency: Added missing closing tag 2016-08-08 11:01:04 +08:00
Andrew Nicols 30257f7959 Merge branch 'MDL-55454_31' of git://github.com/timhunt/moodle into MOODLE_31_STABLE 2016-08-08 10:03:53 +08:00
AMOS bot 80f687788d Automatically generated installer lang files 2016-08-06 00:04:58 +08:00
Matt Davidson c79398ea60 MDL-55246 assign: convert files with spaces
If a file is sent to unoconv with a filename that contains spaces,
unoconv will fail to produce the intended results.
2016-08-05 08:16:01 -04:00
Marina Glancy 9d98f9e1f4 MDL-55425 user: allow to update another user editor pref 2016-08-05 09:39:28 +08:00
Andrew Nicols 56394c8bd6 weekly release 3.1.1+ 2016-08-04 09:59:02 +08:00
Andrew Nicols 785ae8a346 Merge branch 'install_31_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_31_STABLE 2016-08-04 09:58:59 +08:00
Rajesh Taneja ab70395d0b MDL-54656 behat: Skip test if db family is not mysql or postgres 2016-08-04 08:47:04 +08:00
Tim Hunt df546e9e3a MDL-55454 quiz: loses shufflequestion setting restoring old backups 2016-08-03 18:46:20 +01:00
Marina Glancy 174b641661 MDL-55418 behat: correct exception class name 2016-08-03 09:17:52 +08:00
Eloy Lafuente (stronk7) 6e4672f5ce Merge branch 'MDL-54656_m31v3' of https://github.com/sbourget/moodle into MOODLE_31_STABLE 2016-08-03 00:51:37 +02:00
Eloy Lafuente (stronk7) 418c1835a2 Merge branch 'MDL-55166-31-blocksettings' of git://github.com/mudrd8mz/moodle into MOODLE_31_STABLE 2016-08-03 00:34:04 +02:00
Eloy Lafuente (stronk7) 8ac6adeaf8 Merge branch 'MDL-55322-31' of https://github.com/snake/moodle into MOODLE_31_STABLE 2016-08-03 00:14:41 +02:00
Dan Poltawski ad4fbd423f MDL-54847 tests: fix unused var 2016-08-02 20:13:56 +01:00
Cameron Ball 2c18b1321e MDL-54847 weblib: Test media attributes individually 2016-08-02 20:13:49 +01:00
Mark Nielsen 528a9d1a02 MDL-55314 mod_lti: Several fixes to lti_load_cartridge
* Fixed XML loading when there is an error
* Fixed exception thrown by lti_load_cartridge
* By default, don't allow LTI mod generator to
  use a toolurl as that results in a cURL call.
2016-08-02 17:40:46 +02:00
Eloy Lafuente (stronk7) 790b9eab79 Merge branch 'MDL-55315-M31' of https://github.com/mrmark/moodle into MOODLE_31_STABLE 2016-08-02 17:08:39 +02:00
Eloy Lafuente (stronk7) 67d51a5eff Merge branch 'MDL-55316-M31' of https://github.com/mrmark/moodle into MOODLE_31_STABLE 2016-08-02 17:02:43 +02:00
Eloy Lafuente (stronk7) 91071cffce Merge branch 'MDL-55348-31' of git://github.com/dpalou/moodle into MOODLE_31_STABLE 2016-08-02 16:48:57 +02:00
Dan Poltawski 311eae0213 Merge branch 'wip-MDL-33741-m31' of git://github.com/marinaglancy/moodle into MOODLE_31_STABLE 2016-08-02 12:20:32 +01:00
Dan Poltawski 82e580d698 Merge branch 'MDL-55357_31' of git://github.com/dmonllao/moodle into MOODLE_31_STABLE 2016-08-02 11:01:17 +01:00
Dan Poltawski 8cf6371521 Merge branch 'MDL-54847-31' of git://github.com/cameron1729/moodle into MOODLE_31_STABLE 2016-08-02 11:00:34 +01:00
Cameron Ball 469aa911c1 MDL-54847 weblib: Support basic HTML media tags 2016-08-02 15:54:56 +08:00
Andrew Nicols 20eb9b3998 Merge branch 'MDL-54879-31' of git://github.com/junpataleta/moodle into MOODLE_31_STABLE 2016-08-02 09:13:35 +08:00
Stephen Bourget 93375cb2f9 MDL-55398 mod_feedback: prevent direct script access to lib files. 2016-08-01 20:55:12 -04:00
Dan Poltawski 8025e88b87 Merge branch 'MDL-55360-31-workshopgradepass' of git://github.com/mudrd8mz/moodle into MOODLE_31_STABLE 2016-08-01 18:55:08 +01:00
AMOS bot f1ef8b34df Automatically generated installer lang files 2016-08-02 00:04:26 +08:00
Dan Poltawski 3b753dc7ca MDL-55376 assign: trailing whitespace 2016-08-01 16:07:58 +01:00
Dan Poltawski 79315c0306 Merge branch 'MDL-55376-31' of git://github.com/cameron1729/moodle into MOODLE_31_STABLE 2016-08-01 16:06:58 +01:00
Dan Poltawski 266e48893a Merge branch 'MDL-55323-31' of git://github.com/junpataleta/moodle into MOODLE_31_STABLE 2016-08-01 13:58:21 +01:00
Dan Poltawski 32bc32736b Merge branch 'MDL-55374-31' of git://github.com/damyon/moodle into MOODLE_31_STABLE 2016-08-01 13:50:40 +01:00
Andrew Nicols 55d3501159 Merge branch 'MDL-53152-31' of git://github.com/junpataleta/moodle into MOODLE_31_STABLE 2016-08-01 15:07:23 +08:00
Jun Pataleta 2a07ee5c2a MDL-53152 theme: Add parentheses to variable calculations 2016-08-01 13:41:08 +08:00
Jake Dallimore 9e6ed38418 MDL-55322 assignfeedback_editpdf: Prevent scroll when moving comments
Prevent the default scroll behaviour when using gestures to move
comments on the mobile site.
2016-08-01 09:48:20 +08:00
Andrew Nicols 1335a27a0b Merge branch 'MDL-55289-31-exsubmission' of git://github.com/mudrd8mz/moodle into MOODLE_31_STABLE 2016-08-01 09:29:12 +08:00
Marina Glancy 562593e9db MDL-33741 file_info: show courses in hidden categories
This also has a couple of bugfixes:
- file_info_context_system::get_children() was looking for courses with parent=0, it is impossible, block removed;
- file_info_context_coursecat::get_area_coursecat_description() was checking the wrong capability to view files in description
2016-08-01 09:17:03 +08:00
Marina Glancy d6a24b5794 MDL-33741 file_info: check capability when serving file in coursecat description 2016-08-01 09:16:59 +08:00
Cameron Ball 04ad26aa2a MDL-55376 mod_assign: Fix bug stopping admin from editing submissions 2016-07-29 19:08:58 +08:00
David Monllao b5b1eedaac MDL-55357 search: Contents include UTF8 characters, adding u modifier 2016-07-29 14:36:49 +08:00
Damyon Wiese 50cb7da5f9 MDL-55374 mod_assign: Force utf-8 for DOMDocument
This prevents charset issues on some sites.
2016-07-29 10:45:54 +08:00
AMOS bot 023bf2ed39 Automatically generated installer lang files 2016-07-29 00:05:49 +08:00
Dani Palou a44bee5f2d MDL-55348 wiki: Convert 'section' WS params to PARAM_RAW 2016-07-28 10:39:46 +02:00
David Mudrák 2b09881896 MDL-55360 workshop: Add tests for setting grades to pass via mod form
These scenarios should cover common cases of defining the grades to pass
pass via the workshop settings form. Note that behaviour of the fields
in terms of locale-specific decimals input (MDL-51806) is not covered
with these tests as I want to avoid installation of additional language
pack. Instead, I assume that functionality of unformat_float() is tested
separately in the core.
2016-07-28 09:54:45 +02:00
David Mudrák d3a636163f MDL-55360 workshop: Emptying grades to pass should set them to zero
When editing existing workshop with a grade to pass defined, when the
field is emptied, it should be interpreted as setting it to zero. This
was not happening because unformat_float replaces the field with null,
therefore effectively unsetting it.

By casting to float, we interpret all empty values (including null) as
zeros. This behaviour is consistent with how gradebook setup UI works.
2016-07-28 09:54:45 +02:00
David Mudrák 6b8511e8c5 MDL-55360 workshop: Allow creating workshops with empty grades to pass
As a regression of MDL-55360, it was not possible to create new
workshops if the field "Submission grade to pass" or "Assessment grade
to pass" was left empty. The validation failed with "You must enter a
number here".

The fields submissiongradepass and gradinggradepass are always present
as we explicitly define them in the mod form. So the isset() condition
in the validation was useless and it did not allow to submit the form
with these fields empty.

Additionally, the unformat_float() returns null only if it receives
empty value on the input. Which can't happen in our case so I am
removing this condition to improve the readability of the code.
2016-07-28 09:54:45 +02:00
David Mudrák a2e7fd18ee MDL-55289 workshop: Fix files processing in example submissions
While testing the issue MDL-55289 I realized that attaching files to
workshop example submissions does not work at all and throws an error.

The reason was that in MDL-50794 (996f7e82), the variables $contentopts
and $attachmentopts were replaced with the result of the methods
submission_content_options() and submission_attachment_options().
But I forgot to perform the full refactoring in exsubmission.php too.

Attached behat test should cover both issues on this branch.
2016-07-28 09:51:18 +02:00
David Mudrák badf4c1eef MDL-55289 workshop: Include repository/lib.php to use its constants
As a result of MDL-41556 (146893d6), the repository/lib.php was included
in submission.php so that its constant FILE_INTERNAL could be used in
field options. Recent development in MDL-50794 (996f7e8) moved the
options declaration to standalone methods but we forgot to check they
work in exsubmission.php too.

This patch moves the repository/lib.php inclusion to where the
library is actually needed.

Additionally it unifies how options are set for overall feedback content
and overall feedback attachment fields.
2016-07-28 09:51:18 +02:00
Jun Pataleta 1d991dcf32 MDL-55323 enrol_lti: Remove unused required parameter 2016-07-28 14:45:08 +08:00
Jun Pataleta fee48e90ad MDL-54879 mod_lti: Add fallback options for error message upon failure 2016-07-28 14:39:25 +08:00
David Monllao 2a9c12ce0b weekly release 3.1.1+ 2016-07-28 12:07:27 +08:00
David Mudrák f5a1aafa89 MDL-55166 admin: Fix display of misleading debug warning on manage block
Blocks can declare has_config() as true without actually using the
default node in the admin tree. Typical use case is when the block
injects its settings to other parts of the admin tree and it assigns
null to its $setting node in its settings.php file.

As Janek L.B. correctly spotted, this led to false debugging message
on admin/blocks.php as the code interpreted it as missing settings.php
file.

The patch adds explicit file existence test for this rare case.
2016-07-27 23:09:51 +02:00
Dani Palou f147248f5c MDL-55225 assign: Format assignment submission text in WS 2016-07-27 13:31:09 +02:00
Rajesh Taneja 85f20080a0 MDL-55329 behat: PyStrings should end with : (colon) 2016-07-27 07:02:09 +08:00
Tony Butler ab3894208a MDL-55245 assignfeedback_editpdf: Enable text in comments to be selected
Only move comment boxes if 'select' tool is selected, enabling users to
drag-select text within comments using the 'comment' tool.
2016-07-26 23:47:16 +02:00
Eloy Lafuente (stronk7) 34930b4115 Merge branch 'wip-MDL-51735-31' of git://github.com/abgreeve/moodle into MOODLE_31_STABLE 2016-07-26 20:16:59 +02:00
Eloy Lafuente (stronk7) 5839f95f3a Merge branch 'MDL-54657_m31v1' of https://github.com/sbourget/moodle into MOODLE_31_STABLE 2016-07-26 19:57:06 +02:00
Eloy Lafuente (stronk7) b5fc1b1f13 Merge branch 'wip-mdl-55337-m31' of https://github.com/rajeshtaneja/moodle into MOODLE_31_STABLE 2016-07-26 13:27:03 +02:00
Rajesh Taneja 3eacb31527 MDL-55337 behat: Added 1 sec delay between post
Ensure post is created at different timestamp, else
returned posts will be different and test fails.
This will happen on a fast machine.
2016-07-26 19:01:15 +08:00
David Monllao ea634405d6 MDL-55183 atto: Fix whitespaces 2016-07-26 10:05:44 +08:00
David Monllao 2f905b06d7 Merge branch 'wip-MDL-55183-31' of git://github.com/abgreeve/moodle into MOODLE_31_STABLE
Conflicts:
	lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-min.js
2016-07-26 09:56:52 +08:00
Adrian Greeve bc29b3920b MDL-55183 editor_atto: Fix requires error.
When using a different theme and removing an editor
plugin such as the equation plugin, atto will display
an error about a missing dependency.

A thank you to Anthony Forth for providing this patch.
2016-07-26 09:42:37 +08:00
David Monllao cf620188a7 Merge branch 'MDL-55283-31' of git://github.com/andrewnicols/moodle into MOODLE_31_STABLE 2016-07-26 05:04:21 +08:00
David Monllao e764c1bf72 Merge branch 'MDL-51242-31' of git://github.com/andrewnicols/moodle into MOODLE_31_STABLE 2016-07-26 02:41:06 +08:00
Mark Nielsen 73c218f4c5 MDL-55315 mod_lti: Fix Nginx 405 error
It appears that Nginx doesn't allow POST
to static files.  So rename the fixture from
a HTML file to a PHP file.
2016-07-25 09:23:14 -07:00
Mark Nielsen df93cb661b MDL-55316 core_completion: Expand fields for Behat
This only happens if you create the course with
one user and then try to enable completion
with another user.
2016-07-25 09:19:35 -07:00
Dan Poltawski f8b4522d35 Merge branch 'MDL-55284-31' of git://github.com/damyon/moodle into MOODLE_31_STABLE 2016-07-25 15:53:39 +01:00
Dan Poltawski 929329f58c Merge branch 'wip-MDL-54796-31' of git://github.com/abgreeve/moodle into MOODLE_31_STABLE 2016-07-25 10:28:29 +01:00
Stephen Bourget f6d310f0f7 MDL-55252 mod_chat: prevent direct script access to lib files. 2016-07-25 09:42:37 +01:00
Stephen Bourget 7e8203ec65 MDL-55253 mod_choice: prevent direct script access to lib files. 2016-07-25 09:40:43 +01:00
Stephen Bourget 180c475961 MDL-55255 mod_data: prevent direct script access to lib files. 2016-07-25 09:40:16 +01:00
An Pham Van 6358e71651 MDL-54838 workshop: Differentiate labels for each comment field.
In a Workshop activity, comment fields on Assessment forms do not properly link to the corresponding Aspect.
So screen reader users may find it difficult to complete the Assessment forms.
There should be a hidden label text for each comment field.
2016-07-25 14:16:27 +07:00
Adrian Greeve 8861612c52 MDL-51735 mod_lesson: A lesson with no content shows a message.
Before it would show an error.
2016-07-25 10:54:53 +08:00
Adrian Greeve 2f7b29a366 MDL-54796 forms: Editor restore event created.
The editor restore event is currently being subscribed
to by the change checkers to refresh their savedstate.
2016-07-25 10:45:30 +08:00
Eloy Lafuente (stronk7) 4eeb5e469b weekly release 3.1.1+ 2016-07-21 11:45:14 +02:00
Eloy Lafuente (stronk7) 9744164d37 Merge branch 'install_31_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_31_STABLE 2016-07-21 11:45:10 +02:00
Damyon Wiese 2d2aaf36f3 MDL-55284 assign: Add missing webservice param 'onlyids'
Mod assign list_participants webservice is supposed to accept a param to limit the
returned data to only show user ids and not the full user details. It is missing
and so the full user records are fetched every time. This has a major impact on the
performance of the new assignment grading interface.
2016-07-20 15:18:18 +08:00
Andrew Nicols 15f8415fef MDL-55283 javascript: Check dir is readable before traversing them 2016-07-20 12:16:56 +08:00
AMOS bot 6837281309 Automatically generated installer lang files 2016-07-20 00:05:27 +08:00
Eloy Lafuente (stronk7) f97b4d2198 Merge branch 'MDL-55220-31' of git://github.com/jleyva/moodle into MOODLE_31_STABLE 2016-07-19 13:22:16 +02:00
Eloy Lafuente (stronk7) 3ca9d711e1 Merge branch 'wip-mdl-55258-m31' of https://github.com/rajeshtaneja/moodle into MOODLE_31_STABLE 2016-07-19 12:13:10 +02:00
Dan Poltawski e731e849f7 Merge branch 'MDL-55206-31' of git://github.com/junpataleta/moodle into MOODLE_31_STABLE 2016-07-19 10:52:35 +01:00
Dan Poltawski f6824dd82f Merge branch 'MDL-54915-31' of http://github.com/damyon/moodle into MOODLE_31_STABLE 2016-07-19 09:38:58 +01:00
Dan Poltawski f8e748dd4d Revert "Merge branch 'MDL-54915-31' of git://github.com/andrewnicols/moodle into MOODLE_31_STABLE"
This reverts commit f1ec07fe11, reversing
changes made to 1972614e16.
2016-07-19 09:37:18 +01:00
David Monllao ca8cef50d3 Merge branch 'MDL-55157_m31v6' of https://github.com/sbourget/moodle into MOODLE_31_STABLE 2016-07-19 08:42:07 +02:00
Damyon Wiese e2bae72003 MDL-54915 templates: Fix async rendering of js blocks
Mustache JS helper can overwrite JS blocks when using nested templates.

Each call to render should have it's own scope.
2016-07-19 13:00:59 +08:00
Rajesh Taneja 695df07228 MDL-55258 behat: Set focus on button before clicking it
Set the focus on button to ensure it is in
viewport before clicking on it.
2016-07-19 10:40:55 +08:00
Stephen Bourget 887eb290ba MDL-55157 mod_feedback: Course reset should update dates 2016-07-18 22:10:15 -04:00
Eloy Lafuente (stronk7) 539b53d611 MDL-52544 oracle: small tweaks
This commit just:

- Moves the null => '' to better place, restricting it to PHP >= 7.0
  (bug https://bugs.php.net/bug.php?id=72524)
- Adds a couple of notes here and there.
- Changes some small details to keep the file using the same coding.
2016-07-19 04:04:44 +02:00
Eloy Lafuente (stronk7) 70d4cfb9f7 Merge branch 'MDL-52544-31' of git://github.com/damyon/moodle into MOODLE_31_STABLE 2016-07-19 04:04:40 +02:00
Eloy Lafuente (stronk7) d93247a237 Merge branch 'MDL-51410_m31v2' of https://github.com/sbourget/moodle into MOODLE_31_STABLE 2016-07-19 02:31:31 +02:00
David Monllao 923053d5a1 Merge branch 'MDL-55161-m31' of https://github.com/micaherne/moodle into MOODLE_31_STABLE 2016-07-18 20:02:22 +02:00
David Monllao 15f367ba1d Merge branch 'MDL-55163-31' of git://github.com/jleyva/moodle into MOODLE_31_STABLE 2016-07-18 19:45:08 +02:00
Dan Poltawski f825156be9 Merge branch 'wip-mdl-55174-m31' of https://github.com/rajeshtaneja/moodle into MOODLE_31_STABLE 2016-07-18 14:49:52 +01:00
Dan Poltawski bcbc0b9f03 Merge branch 'MDL-55190-31' of git://github.com/merrill-oakland/moodle into MOODLE_31_STABLE 2016-07-18 14:21:04 +01:00
Dan Poltawski 4dc180b05d Merge branch 'MDL-55012-31' of git://github.com/damyon/moodle into MOODLE_31_STABLE 2016-07-18 13:57:41 +01:00
Dan Poltawski bff5af27de Merge branch 'MDL-54963_31' of git://github.com/dmonllao/moodle into MOODLE_31_STABLE 2016-07-18 13:38:39 +01:00
Dan Poltawski 19722fbf92 Merge branch 'wip-mdl-54977-m31' of https://github.com/rajeshtaneja/moodle into MOODLE_31_STABLE 2016-07-18 13:27:53 +01:00
Dan Poltawski 259c070a9d Merge branch 'MDL-55240-31' of git://github.com/junpataleta/moodle into MOODLE_31_STABLE 2016-07-18 10:51:08 +01:00
Dan Poltawski f1ec07fe11 Merge branch 'MDL-54915-31' of git://github.com/andrewnicols/moodle into MOODLE_31_STABLE 2016-07-18 09:17:53 +01:00
Rajesh Taneja 5adea0017f MDL-55174 core_tests: Use proper itemid while creating file 2016-07-18 10:30:05 +08:00
AMOS bot b9aee5ae58 Automatically generated installer lang files 2016-07-16 00:05:39 +08:00
Jun Pataleta f4e03e2aa1 MDL-55206 admin: Some code cleanup
* Removed unnecessary TODOs.
* Changed message prompt case to sentence case.
2016-07-15 14:52:25 +08:00
Jun Pataleta 5e1291cf90 MDL-55206 admin: Remove div tags in password policy error message 2016-07-15 14:47:15 +08:00
Rajesh Taneja b62061f44a MDL-55174 core_testing: Use proper directory separator
While searching for existing files if directory
separator is not correct then original files
and directories will be deleted. So use DIRECTORY_SEPARATOR.
2016-07-15 13:53:10 +08:00
Damyon Wiese 7166d2ab48 MDL-55012 Atto: no style attrs on paste
Specifically on paste - we don't need all the random style attributes
from content on the clipboard. When you copy from a webpage - the browser
inlines all the styles from the page so that the pasted content will look
like the place it was copied from. But this is never what you want - you
want the content on paste, but with no special styling.
2016-07-15 13:36:50 +08:00
Jun Pataleta 7b1c27076b MDL-55240 editpdf: Revert changes in MDL-54772
* Revert rendering of annotations and comments back to the
  drawing region.
* Bind events to stamp annotation when editing only.
2016-07-15 10:37:48 +08:00
David Monllao 1972614e16 weekly release 3.1.1+ 2016-07-14 11:28:52 +02:00
David Monllao 379b194e3e Merge branch 'install_31_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_31_STABLE 2016-07-14 11:28:50 +02:00
Juan Leyva ab793a088d MDL-55220 forum: Add string filtering in WS
The following external functions now filter the discussion and post
name and subject.
- get_forum_discussions_paginated
- get_forum_discussion_posts
2016-07-14 09:14:48 +01:00
Stephen Bourget 237f52a9fb MDL-54657 Behat: Add tests for section_links block 2016-07-13 21:39:37 -04:00
Eric Merrill 5010e7aebd MDL-55190 search: Limit search to non-files if disabled 2016-07-13 06:06:05 -04:00
Michael Aherne e2c0f3ee50 MDL-55161 assign: Check for existence of gradebook feedback plugin 2016-07-13 09:02:42 +01:00
JD 9b81a977e1 MDL-54977 blocks_navigation: Use html_writer::random_id for id
uniqid() may returns the same id for faster machines (seen on iis)
so use html_writer::random_id(), to ensure id is different and
navigation don't break
2016-07-13 14:01:20 +08:00
Andrew Nicols 2f6241d030 Merge branch 'MDL-47371-31-fix' of git://github.com/cameron1729/moodle into MOODLE_31_STABLE 2016-07-13 12:11:19 +08:00
Cameron Ball b5af9da5d3 MDL-47371 mod_book: Fix out of scope $unescapedtitle 2016-07-13 10:27:58 +08:00
Damyon Wiese fc9a1820e5 MDL-52544 oracle: Apply upstream pull request to AdoDB oracle driver
Upstream: https://github.com/ADOdb/ADOdb/pull/259

Prevent segfault with ocipo driver on php7.

The OCIFetchinto function is causing segfaults on php7 - probably because the fields array
is not initialised or it is optimised out. This fixes just changes to use the safer function
oci_fetch_array instead.
2016-07-13 08:46:01 +08:00
Stephen Bourget 3e02472261 MDL-51410 mod_survey: fix notifications when saving analysis 2016-07-12 20:08:51 -04:00
tunele 705b215b63 MDL-55083 admin: provide friendly error in case phpxml is missing 2016-07-13 00:09:42 +02:00
Eloy Lafuente (stronk7) 20474552ac MDL-53803 mod_choice: fix trailing whitespace 2016-07-12 18:06:21 +02:00
AMOS bot ad48cf4e28 Automatically generated installer lang files 2016-07-13 00:04:45 +08:00
Eloy Lafuente (stronk7) d5b38dfea1 Merge branch 'MDL-53803_m31v1' of https://github.com/sbourget/moodle into MOODLE_31_STABLE 2016-07-12 18:02:59 +02:00
Eloy Lafuente (stronk7) 19b118ad42 Merge branch 'MDL-54892-MOODLE_31_STABLE' of https://github.com/tobiasreischmann/moodle into MOODLE_31_STABLE 2016-07-12 17:51:46 +02:00
Eloy Lafuente (stronk7) 8d1623b7ed Merge branch 'MDL-55136_dataobject_31' of git://github.com/davosmith/moodle into MOODLE_31_STABLE 2016-07-12 15:48:22 +02:00
David Monllao 0bf06fbee5 Merge branch 'MDL-54771-31' of git://github.com/cameron1729/moodle into MOODLE_31_STABLE 2016-07-12 14:53:40 +02:00
Eloy Lafuente (stronk7) 3b9f7d90d0 MDL-37250 mod_lesson: Move conditions to queries for better performance
While this ony seems to affect MySQL, better put the filter/conditions
on every query so the temporary view/table does not need to handle
thousands of potentially unrelated records.
2016-07-12 13:32:46 +02:00
Eloy Lafuente (stronk7) 4de30cdce3 Merge branch 'wip-MDL-37250-31' of git://github.com/abgreeve/moodle into MOODLE_31_STABLE 2016-07-12 13:32:36 +02:00
David Monllao a59d8bfdcb Merge branch 'MDL-55133-31' of git://github.com/damyon/moodle into MOODLE_31_STABLE 2016-07-12 13:16:40 +02:00
David Monllao c4312f0ac7 Merge branch 'wip-MDL-55107-31' of git://github.com/abgreeve/moodle into MOODLE_31_STABLE 2016-07-12 13:03:30 +02:00
Dan Poltawski 9770f74eda Merge branch 'MDL-47371-31' of git://github.com/cameron1729/moodle into MOODLE_31_STABLE 2016-07-12 10:14:29 +01:00
David Monllao f7c1b3d776 Merge branch 'MDL-55170_M31' of https://github.com/nadavkav/moodle into MOODLE_31_STABLE 2016-07-12 10:30:42 +02:00
David Monllao cc145bf17b MDL-54963 search: Show no results 2016-07-12 10:23:52 +02:00
Dan Poltawski 3e159646ad Merge branch 'MDL-55007-m31' of https://github.com/dthies/moodle into MOODLE_31_STABLE 2016-07-12 09:21:06 +01:00
Adrian Greeve 0173297438 MDL-55107 gradebook: Unit tests for the new setting check. 2016-07-12 13:33:04 +08:00
Adrian Greeve d6f4093376 MDL-55107 gradebook: Improve the 57 letter boundary upgrade.
This fixes a setting not being checked before and also
reduces the number of false positives.
2016-07-12 13:32:53 +08:00
Cameron Ball a74908ae4c MDL-47371 mod_book: Don't double escape book titles 2016-07-12 10:34:01 +08:00
Cameron Ball 85f1d94f0b MDL-47371 block_navigation: Don't double escape course titles 2016-07-12 10:34:00 +08:00
Cameron Ball cbc6b9f475 MDL-47371 weblib: Add option to disable escaping 2016-07-12 10:33:58 +08:00
Andrew Nicols 36a9aba565 MDL-54915 core: JS Blocks must not used shared variables
The JS blocks in a template must _not_ use a shared variable as they can be
executed asynchronously and complete in any order.

Instead it is stored in the only local variable available - the current
context.

Since the context can be passed in from elsewhere, we namespace it to
reduce the chance of collission.
2016-07-12 09:54:42 +08:00
Daniel Thies 09b3ec720f MDL-5507 filter_mathjaxloader: Add commeents for regexes 2016-07-11 13:22:13 -05:00
Dan Poltawski 27f66455dc Merge branch 'MDL-54926-31' of git://github.com/merrill-oakland/moodle into MOODLE_31_STABLE 2016-07-11 16:54:42 +01:00
Dan Poltawski cca0fe3e3a Merge branch 'MDL-55082-31' of git://github.com/merrill-oakland/moodle into MOODLE_31_STABLE 2016-07-11 15:20:55 +01:00
David Monllao 200c2745e9 Merge branch 'wip-MDL-54962-31' of git://github.com/abgreeve/moodle into MOODLE_31_STABLE 2016-07-11 16:15:56 +02:00
Dan Poltawski 2c089c2f72 Merge branch 'MDL-55112-31' of git://github.com/junpataleta/moodle into MOODLE_31_STABLE 2016-07-11 14:42:14 +01:00
Dan Poltawski 46844a6b6e Merge branch 'MDL-55137-31' of git://github.com/cameron1729/moodle into MOODLE_31_STABLE 2016-07-11 14:37:57 +01:00
Dan Poltawski 02848ae89f Merge branch 'MDL-55128-31' of git://github.com/jleyva/moodle into MOODLE_31_STABLE 2016-07-11 13:33:23 +01:00
Dan Poltawski c9ddcaff47 Merge branch 'wip-MDL-55154-31' of git://github.com/abgreeve/moodle into MOODLE_31_STABLE 2016-07-11 13:31:25 +01:00
Juan Leyva 9eb1e017e1 MDL-55163 mod_assign: Fix mod_assign_copy_previous_attempts
- Not exposed via WS
- Have a bug when calling the api function
2016-07-11 10:33:23 +01:00
David Monllao 9fda3f17d0 Merge branch 'MDL-54832-31' of https://github.com/nashtechdev01/moodle into MOODLE_31_STABLE 2016-07-11 06:47:34 +02:00
Adrian Greeve f0c57645e5 MDL-37250 mod_lesson: All actual attempts on the lesson are displayed.
The lesson overview report now shows all attempts made including hitting
the page and immediately navigating away.
2016-07-11 08:19:23 +08:00
AMOS bot 820b5b2a46 Automatically generated installer lang files 2016-07-11 00:06:00 +08:00
Eloy Lafuente (stronk7) 47806ea17e Moodle release 3.1.1 2016-07-10 00:29:25 +02:00
Nadav Kavalerchik c4891ac771 MDL-55170 theme_bootstrapbase: Fix user enrollment dialog, RTL 2016-07-09 14:53:33 +03:00
Davo Smith 2a59561f7e MDL-55136 data_object: fix param handling in fetch_all_helper 2016-07-09 09:21:09 +01:00
Adrian Greeve 0e40fc6e85 MDL-54962 mod_data: Approval status is now translated.
It was using hardcoded English. Now it uses get_string.
2016-07-08 10:56:29 +08:00
Adrian Greeve 0f1ae159df MDL-55154 mod_lesson: Lesson numerical response shows images. 2016-07-08 09:52:10 +08:00
Daniel Thies 0b2b9e21dc MDL-55007 filter_mathjaxloader: Change unit test 2016-07-07 20:23:26 -05:00
Daniel Thies 6857304753 MDL-55007 filter_mathjaxloader: Wrap nolink around each expresssion 2016-07-07 20:22:56 -05:00
Eloy Lafuente (stronk7) a0473f798d weekly release 3.1+ 2016-07-07 10:20:09 +02:00
Eloy Lafuente (stronk7) b4e5db392e NOBUG: Fixed SVG browser compatibility 2016-07-07 10:20:05 +02:00
Eloy Lafuente (stronk7) b775dad6e6 Merge branch 'install_31_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_31_STABLE 2016-07-07 10:20:04 +02:00
Damyon Wiese 75ff893a27 MDL-52544 oracle: php7 fixes for oci driver
These are our bugs actually - the oci docs are very clear that bound
params should be in-scope when oci_execute is called - and due to pass by value etc,
this was not true for our driver.

There is another bug that needed fixing - OCI barfs if null values are bound - this
can be avoided by setting them to '' which oci treats as null.

And finally - all our lob/clob/blob hacks were also binding to local "out-of-scope" vars.
2016-07-07 13:09:59 +08:00
Andrew Nicols 56d67f1a9d Merge branch 'wip-mdl-55043-m31' of https://github.com/rajeshtaneja/moodle into MOODLE_31_STABLE 2016-07-07 11:29:14 +08:00
Rajesh Taneja e9f2e5bea7 MDL-55043 core_competency: Sort by id to ensure we get expected result. 2016-07-10 11:25:43 +08:00
Andrew Nicols 6416b84bd6 Merge branch 'MDL-54869-31' of git://github.com/jleyva/moodle into MOODLE_31_STABLE 2016-07-07 10:48:48 +08:00
Stephen Bourget 10120241ae MDL-53803 mod_choice: remove orphaned answers when removing options 2016-07-06 17:15:33 -04:00
Eloy Lafuente (stronk7) 4e4e8e1da9 Merge branch 'wip-MDL-46682-31' of git://github.com/abgreeve/moodle into MOODLE_31_STABLE 2016-07-06 18:13:58 +02:00
Cameron Ball c7010e82ae MDL-54771 tool_recyclebin: Don't add temp course to recycle bin 2016-07-06 23:19:00 +08:00
Cameron Ball bd7cc14d6a MDL-54771 restore: Add deletesource to course object
Since deleting a course now triggers the pre_course_delete hook
it may be useful for hook implementations to know whether it was
a "true" course deletion, or one originating from a temporary
course created during a restore.
2016-07-06 23:19:00 +08:00
Cameron Ball 8bc112e645 MDL-55137: Update PHPDoc for external_format_text 2016-07-06 17:48:33 +08:00
Eloy Lafuente (stronk7) 2a55226144 MDL-54934 workshop: ensure "Current phase" is always separated
Apparently some readers can join 2 adjacent spans completely, simply
adding a whitespace between them prevents that, ensuring separation.,
2016-07-06 11:36:11 +02:00
Adrian Greeve 46672f08d6 MDL-46682 auth/db: Increase of chunk size and update change.
The update query was not checking the mnet auth id and could
have been updating the wrong entry.
2016-07-06 16:43:47 +08:00
Andrew Nicols 9563554a1a Merge branch 'MDL-54734-31' of git://github.com/lameze/moodle into MOODLE_31_STABLE 2016-07-06 15:02:16 +08:00
Simey Lameze 73ad749ca0 MDL-54734 core_user: do not cache dummy user records 2016-07-06 13:44:27 +08:00
Andrew Nicols e1f29cf6e2 MDL-54734 user: Add tests to demonstrate multi-user issues 2016-07-06 13:44:27 +08:00
Andrew Nicols 40867c234a Merge branch 'MDL-54165-31' of git://github.com/ryanwyllie/moodle into MOODLE_31_STABLE 2016-07-06 12:02:31 +08:00
Ryan Wyllie 22861d00c7 MDL-54165 mod_assign: Fix doc in grading_events.js 2016-07-06 03:47:35 +00:00
Rajesh Taneja 5c280e9e1e MDL-54844 mod_glossary: Don't append AND as it's done later 2016-07-06 11:35:23 +08:00
Andrew Nicols 61453e1a79 Merge branch 'MDL-54165-31' of git://github.com/ryanwyllie/moodle into MOODLE_31_STABLE 2016-07-06 11:08:05 +08:00
Ryan Wyllie 30a9fe133a MDL-54165 mod_assign: Collapsible review and grade panel 2016-07-06 02:54:18 +00:00
Barbara Ramiro 879b5bb6fc MDL-54165 mod_assign: Layout icons for the new grading interface 2016-07-06 02:53:13 +00:00
Damyon Wiese 2c72d1b8b5 MDL-55133 javascript: Correctly use component names in requirejs
Core subsystems must use the 'core_' prefix always.
2016-07-06 10:26:58 +08:00
Jerome Mouneyrac b406f53662 MDL-46682 auth/db: IN clause crashes when too many users to sync 2016-07-06 10:06:03 +08:00
Adrian Greeve ec0edd25ac MDL-54844 mod_glossary: Limiting of glossary searching.
Searching of the glossary was returning results from all
glossaries on the site. It has now been returned to just
the glossary that you are currently viewing.
2016-07-06 09:20:31 +08:00
Eloy Lafuente (stronk7) 8d30e8370d Merge branch 'wip-mdl-55043-m31' of https://github.com/rajeshtaneja/moodle into MOODLE_31_STABLE 2016-07-06 03:19:17 +02:00
Rajesh Taneja d49170cb14 MDL-55043 core_competency: Set proper sort order for each field 2016-07-06 08:18:33 +08:00
Eloy Lafuente (stronk7) c3001c7457 Merge branch 'wip-mdl-54860-m31' of https://github.com/rajeshtaneja/moodle into MOODLE_31_STABLE 2016-07-06 01:42:50 +02:00
Rajesh Taneja 4f5a6e28ec MDL-54860 behat: Stop execution if setup problem found 2016-07-06 07:28:31 +08:00
Eloy Lafuente (stronk7) 395a315e9f Merge branch 'MDL-54934-31' of https://github.com/nashtechdev01/moodle into MOODLE_31_STABLE 2016-07-05 20:44:21 +02:00
Eloy Lafuente (stronk7) 501f7d53c6 Merge branch 'MDL-54867-31' of git://github.com/jleyva/moodle into MOODLE_31_STABLE 2016-07-05 20:27:28 +02:00
Eloy Lafuente (stronk7) a7a037ecde Merge branch 'MDL-49244-31' of git://github.com/jleyva/moodle into MOODLE_31_STABLE 2016-07-05 20:19:47 +02:00
Eloy Lafuente (stronk7) 967a7bc2ac Merge branch 'MDL-54795_31' of https://github.com/snake/moodle into MOODLE_31_STABLE 2016-07-05 20:10:42 +02:00
Eloy Lafuente (stronk7) defc74db0d Merge branch 'MDL-29738-31' of git://github.com/andrewnicols/moodle into MOODLE_31_STABLE 2016-07-05 17:06:06 +02:00
Loc Nguyen d54b4cdfa1 MDL-54832 workshop: adding landmark for userplantable
Accessibility enhance: add an aria-label on the userplan table so
that it's accessible to me through my screen reader
2016-07-05 20:15:30 +07:00
Andrew Nicols 222e854a9e MDL-29738 file: Remove unused stylesheet functionality
This functionality was commented out in
78946b9bdb for MDL-20204 back in 2009.
Since then it has been wasting cycles performing utterly pointless
preg_match and preg_replace calls.
2016-07-05 19:03:39 +08:00
Andrew Nicols ccb97f2eef MDL-55114 chat: Remove commented-out variables 2016-07-05 12:46:46 +02:00
Eloy Lafuente (stronk7) cf3ac3f218 Merge branch 'MDL-55113-31' of git://github.com/dpalou/moodle into MOODLE_31_STABLE 2016-07-05 12:21:53 +02:00
Dan Poltawski c25d8efc47 Merge branch 'MDL-54928-31' of git://github.com/dpalou/moodle into MOODLE_31_STABLE 2016-07-05 11:20:08 +01:00
Dan Poltawski abc0cac40a Merge branch 'MDL-54841-31' of https://github.com/nashtechdev01/moodle into MOODLE_31_STABLE 2016-07-05 11:06:39 +01:00
Juan Leyva 9b7d5cd41b MDL-55128 course: Fix param type for shortname 2016-07-05 09:51:21 +01:00
Dani Palou eef85ddc40 MDL-54928 notifications: Add username to emailto users 2016-07-05 10:36:13 +02:00
Dani Palou b65a928372 MDL-54928 notifications: Retrieve username from DB if empty 2016-07-05 10:36:13 +02:00
Juan Leyva 47560d0eb0 MDL-54869 webservice: Fix core_user_add_user_private_files 2016-07-05 09:00:43 +01:00
Juan Leyva 068904f73b MDL-54869 files: Create new required functions
This was a complex change requiring three new functions:
file_merge_files_from_draft_area_into_filearea - To just add files from a draft area into a real one (just adding or updating, not deleting)
file_merge_draft_area_into_draft_area - To merge files from two draft areas, used by the latest for creating a draft area with all the original files plus the new ones.
file_overwrite_existing_draftfile - Required to update existing files not losing metadata or references.

The whole process is the following:

    User uploads a file (upload.php)
    Client gets a new draftid A containing the file only (return of upload.php)
    Client requests to merge that draftid in the user's private files (core_user_add_user_private_files)
    Server prepares a new UNUSED draftid B from existing area
    Server merges A into B
    Server saves the draft B into the final area
2016-07-05 09:00:43 +01:00
Andrew Nicols 767eaec731 MDL-51242 messageinbound: Guess the port from hostspec
Existing language strings for the host component suggest that the host can
be provided in the format hostname:port, but we previously did not support
this.

This patch explodes the string based on the colon character and assumes
that if there are two parts, that they are in the format hostname:port.

Note: This does not attempt to deal with full host specifications (e.g.
protocol://hostname:port), as this is beyond the scope of this change.
2016-07-05 14:54:08 +08:00
An Pham Van 65432b1b7b MDL-54841 workshop: Combine links for attachment icon and text.
In a workshop activity, on the view submission page where having attachment(s), there's an accessibility issue.
There're 2 separate links for the icon and text which causes an issue for keyboard and screen reader users.
So the text and icon should be combined in one link.
2016-07-05 13:26:55 +07:00
Jake Dallimore 8fba57e950 MDL-53431 tool_monitor: Access control for tool monitor subscriptions 2016-07-05 10:45:17 +08:00
Dan Poltawski a933f85a73 Merge branch 'MDL-55019-31' of git://github.com/jleyva/moodle into MOODLE_31_STABLE 2016-07-04 15:29:45 +01:00
Dan Poltawski 8cba7fda3a Merge branch 'MDL-54976-31' of git://github.com/junpataleta/moodle into MOODLE_31_STABLE 2016-07-04 14:52:01 +01:00
Dan Poltawski f852010c6c Merge branch 'MDL-54994_31' of git://github.com/stronk7/moodle into MOODLE_31_STABLE 2016-07-04 14:18:20 +01:00
Dan Poltawski 2a5bb77321 Merge branch 'MDL-55032-31' of git://github.com/marinaglancy/moodle into MOODLE_31_STABLE 2016-07-04 13:28:49 +01:00
Dan Poltawski 2212fbf028 Merge branch 'MDL-55041_31_STABLE' of https://github.com/marxjohnson/moodle into MOODLE_31_STABLE 2016-07-04 12:45:56 +01:00
Dan Poltawski 1a4184a396 Merge branch 'MDL-41945-31' of git://github.com/cameron1729/moodle into MOODLE_31_STABLE 2016-07-04 12:39:37 +01:00
Marina Glancy d722da1bb4 MDL-55069 core: escape special characters in email headers 2016-07-04 12:28:02 +01:00
Dani Palou c58312fe82 MDL-55113 assign: Use PARAM_RAW in onlinetext text 2016-07-04 09:59:14 +02:00
Jun Pataleta bc795079f7 MDL-55112 mod_forum: Query all forum fields to avoid debug messages 2016-07-04 15:23:47 +08:00
Andrew Nicols cdea4ac6b9 Merge branch 'MDL-54953-31' of git://github.com/marinaglancy/moodle into MOODLE_31_STABLE 2016-07-04 15:18:59 +08:00
Andrew Nicols 6db40f889f Merge branch 'MDL-55049-31' of git://github.com/jleyva/moodle into MOODLE_31_STABLE 2016-07-04 14:22:19 +08:00
Andrew Nicols e0db9ee82f Merge branch 'MDL-55053-31' of git://github.com/merrill-oakland/moodle into MOODLE_31_STABLE 2016-07-04 14:14:52 +08:00
Davo Smith b3a751da05 MDL-55057 mod_scorm: fix handling of SCO identifiers with apostrophes 2016-07-04 13:14:27 +08:00
Andrew Nicols 388367917d Merge branch 'MDL-54877-31-clean-on-output' of git://github.com/junpataleta/moodle into MOODLE_31_STABLE 2016-07-04 12:14:09 +08:00
Cameron Ball 3141d42c63 MDL-41945 mod_assign: Check if submission has been modified
This patch adds a check that stops a user submitting an assignment
if someone else has modified it in the meantime.
2016-07-04 12:11:08 +08:00
Andrew Nicols 0c725854e5 Merge branch 'MDL-55020-31-pluginzip' of git://github.com/mudrd8mz/moodle into MOODLE_31_STABLE 2016-07-04 11:26:18 +08:00
Andrew Nicols 965b65b7fc Merge branch 'MDL-54968-31' of git://github.com/marinaglancy/moodle into MOODLE_31_STABLE 2016-07-04 10:32:50 +08:00
Andrew Nicols 759f83aa63 Merge branch 'MDL-53019_31' of git://github.com/stronk7/moodle into MOODLE_31_STABLE 2016-07-04 09:10:19 +08:00
AMOS bot d046221fba Automatically generated installer lang files 2016-07-02 00:05:12 +08:00
Mark Johnson ad1e11c2e4 MDL-55041 roles: Fix JSON parsing in permission manager 2016-07-01 15:02:02 +01:00
Loc Nguyen e1f14856da MDL-54934 workshop: indicate current phase
Indicate phase in page titles, current phase in userplan table
so that it's accessible to me through my screen reader
2016-07-01 18:51:31 +07:00
Eloy Lafuente (stronk7) 7d0add9d19 MDL-53019 environment: 3.2 requirements added
Changes:
 - PHP 5.6.5 required
2016-07-01 13:49:32 +02:00
Eloy Lafuente (stronk7) 7ef6433c2f MDL-54994 badges: Count correctly the number of external badges shown 2016-07-01 13:40:59 +02:00
Juan Leyva f80645cc48 MDL-54869 files: Fix file_save_draft_area_files documentation 2016-07-01 10:16:28 +01:00
Jun Pataleta 184a6e1647 MDL-54976 mod_scorm: Add validation for availability dates 2016-07-01 14:51:04 +08:00
Jake Dallimore 89ea16e44e MDL-54795 mod_assign: Fix Atto notify js error in grading interface 2016-07-01 13:52:38 +08:00
Marina Glancy 938a970d1f MDL-55032 tool_lp: check access when showing link to competencies
Also if course competencies page is accessed without capabilities do
redirect before starting output.
2016-07-01 13:45:46 +08:00
Andrew Nicols 6513308ba7 weekly release 3.1+ 2016-07-01 10:20:36 +08:00
Andrew Nicols 9c6b1e40e5 Merge branch 'install_31_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_31_STABLE 2016-07-01 10:20:32 +08:00
David Mudrák 9ba44fa3fd MDL-55020 admin: Fix renaming of the plugin package root folder
There was a problem with core\update\code_manager::unzip_plugin_file()
if it was used to extract a plugin package into a non-empty target
directory and the plugin package root folder was being renamed at the
same time.

The problem was caused by the underlying helper method
rename_extracted_rootdir() that worked only for ZIPs extracted to an
empty temporary location. When the plugin was extracted to the actual
dirroot with other existing plugin folders present, the method failed
badly.

The solution in the patch is to always extract the ZIP into a temporary
empty location, perform the eventual root renaming there, and only then
move the extracted contents to the final destination. Additionally we
are changing the behaviour of the rename_extracted_rootdir() method so
that now it throws exception if the plugin package contains multiple
root folders (it should not happen in normal situations as such a plugin
would not pass the pre-install validation).

Unit tests did not catch this bug before because in the tests, the
target directory had been empty. Now we are adding a new directory
"aaa_another" to the target location to test in more realistic
environment. Tests for the new behaviour of the renaming method are
added, too.

p.s. I noticed that moodle_exception class was not imported into the
namespace and this is fixed now too (and covered with unit tests).
2016-07-01 01:11:36 +02:00
Eric Merrill c9e63147b9 MDL-55082 search: Update core areas to return results in time ASC order 2016-06-30 11:12:03 -04:00
Juan Leyva ddbd25d941 MDL-49244 course: Clean parameters in core_course_get_categories 2016-06-30 13:27:51 +01:00
Dan Poltawski 9c3b409079 MDL-32135 mod_choice: fix behat tests 2016-06-30 09:25:23 +01:00
Stephen Bourget 161cb17822 MDL-32135 mod_choice: update behat tests 2016-06-30 09:25:23 +01:00
Andrew Nicols c944c35cff Merge branch 'MDL-54610_31' of https://github.com/snake/moodle into MOODLE_31_STABLE 2016-06-30 09:25:22 +01:00
Dan Poltawski 31ba691136 Merge branch 'MDL-55022-31' of git://github.com/junpataleta/moodle into MOODLE_31_STABLE 2016-06-30 09:25:22 +01:00
Dan Poltawski 6f8f5068f2 Merge branch 'MDL-55027_m31' of git://github.com/markn86/moodle into MOODLE_31_STABLE 2016-06-30 09:25:21 +01:00
Dan Poltawski 2a1401d20f Merge branch 'MDL-54993-31' of https://github.com/sk-unikent/moodle into MOODLE_31_STABLE 2016-06-30 09:25:21 +01:00
Dan Poltawski a1b8fc6ab7 Merge branch 'MDL-32135_m31v2' of https://github.com/sbourget/moodle into MOODLE_31_STABLE 2016-06-30 09:25:20 +01:00
Jun Pataleta 3d152bc38e MDL-54877 mod_lti: Clean LTI tool type name and description on output
* Use clean_param() for name and description when displaying the tool type.
    Basically in the following functions:
    - serialise_tool_type()
    - lti_get_configured_types()
* Changed name and description's type from PARAM_TEXT to PARAM_RAW
    in tool update parameters.
* Changed name and description's type from PARAM_TEXT to PARAM_RAW
   in mod_lti_external::tool_type_return_structure()
2016-06-30 15:59:37 +08:00
AMOS bot 640c427b68 Automatically generated installer lang files 2016-06-30 00:04:50 +08:00
Eric Merrill 9a4c8f1c1a MDL-55053 search: Display search areas in alphabetical order 2016-06-28 17:19:35 -04:00
Eric Merrill 124baf197a MDL-54926 search: Reduce over-escaping in results 2016-06-28 16:34:02 -04:00
Juan Leyva 19a7ed9484 MDL-55049 webservice: Scan for viruses in webservice/upload.php 2016-06-28 16:15:09 +01:00
Dan Poltawski 27733ee4d0 Merge branch 'MDL-54868-31' of git://github.com/cameron1729/moodle into MOODLE_31_STABLE 2016-06-28 09:19:50 +01:00
Dan Poltawski 5a1ead041a Merge branch 'MDL-55002-31-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_31_STABLE 2016-06-28 09:06:10 +01:00
Andrew Nicols 04bb5da9de Merge branch 'MDL-54991-31' of git://github.com/crazyserver/moodle into MOODLE_31_STABLE 2016-06-28 15:32:24 +08:00
Andrew Nicols 25a4f6c2d6 Merge branch 'MDL-54909-31' of git://github.com/crazyserver/moodle into MOODLE_31_STABLE 2016-06-28 15:21:42 +08:00
Cameron Ball 3078a3b7a1 MDL-54868 webservice_xmlrpc: Don't escape non-ascii characters 2016-06-28 14:49:29 +08:00
Andrew Nicols 82f52c19fa Merge branch 'MDL-54910_m31v2' of https://github.com/sbourget/moodle into MOODLE_31_STABLE 2016-06-28 12:57:23 +08:00
Andrew Nicols 143e3dc11c Merge branch 'MDL-54911_m31v3' of https://github.com/sbourget/moodle into MOODLE_31_STABLE 2016-06-28 12:40:10 +08:00
Andrew Nicols 7403d5ea59 MDL-54755 core: Correct behat language 2016-06-28 10:01:26 +08:00
Andrew Nicols a1a562fbbe Merge branch 'MDL-54755_moodle31' of https://github.com/StudiUM/moodle into MOODLE_31_STABLE 2016-06-28 09:55:08 +08:00
Andrew Nicols e31f0fdf7e Merge branch 'MDL-54935-31' of git://github.com/ryanwyllie/moodle into MOODLE_31_STABLE 2016-06-28 09:40:19 +08:00
Andrew Nicols b228a7cf40 Merge branch 'MDL-54964-31' of git://github.com/jleyva/moodle into MOODLE_31_STABLE 2016-06-28 08:47:42 +08:00
Andrew Nicols e9ae977cb8 Merge branch 'wip-mdl-54974-m31' of https://github.com/rajeshtaneja/moodle into MOODLE_31_STABLE 2016-06-28 08:33:10 +08:00
David Mudrák 31a5f2a08c MDL-55002 lang: Fix behat scenarios using modified strings 2016-06-27 23:04:40 +02:00
Helen Foster f9bca6404e MDL-55002 lang: Merge English strings from the en_fix language pack 2016-06-27 23:02:41 +02:00
Eloy Lafuente (stronk7) 78c703bc12 Merge branch 'MDL-55028-31' of git://github.com/junpataleta/moodle into MOODLE_31_STABLE 2016-06-27 22:13:55 +02:00
Eloy Lafuente (stronk7) f1198d7998 Merge branch 'MDL-54997-31' of git://github.com/damyon/moodle into MOODLE_31_STABLE 2016-06-27 20:22:20 +02:00
Eloy Lafuente (stronk7) 29cc92c86f Merge branch 'MDL-54707_31' of git://github.com/dmonllao/moodle into MOODLE_31_STABLE 2016-06-27 20:00:56 +02:00
Eloy Lafuente (stronk7) 2ac06ec994 Merge branch 'MDL-54900-31' of git://github.com/marinaglancy/moodle into MOODLE_31_STABLE 2016-06-27 19:03:25 +02:00
AMOS bot 4c19da2a1e Automatically generated installer lang files 2016-06-28 00:05:48 +08:00
Eloy Lafuente (stronk7) ac081697da Merge branch 'MDL-52887-31' of git://github.com/marinaglancy/moodle into MOODLE_31_STABLE 2016-06-27 16:13:37 +02:00
Gilles-Philippe Leblanc 97b0761cdf MDL-54755 core: Incorrect redirection after password change 2016-06-27 08:21:31 -04:00
Eloy Lafuente (stronk7) 54b80ab68d Merge branch 'MDL-54663-31' of git://github.com/andrewnicols/moodle into MOODLE_31_STABLE 2016-06-27 13:26:42 +02:00
Juan Leyva 4ec683ac2f MDL-54964 tool_mobile: Fix tests to make it work with non-core plugins 2016-06-27 09:46:33 +01:00
Pau Ferrer Ocaña 41931b749d MDL-54991 assign: Invalid submissiongroup when not using groups 2016-06-27 09:28:14 +02:00
Marina Glancy 79796a1590 MDL-54968 user: change query for resetting dashboard
In case of inconsistent data the fatal error could have happen.
Also improve performance by joining several queries into one.
2016-06-27 15:09:12 +08:00
Rajesh Taneja 793d92aa86 MDL-54974 behat: Handle interupts on PHP7
As https://bugs.php.net/bug.php?id=71448 is
not going to get fixed, we need to declare tick
2016-06-27 14:32:22 +08:00
Andrew Nicols e0b8d7864f Merge branch 'MDL-53111_m31v1' of https://github.com/sbourget/moodle into MOODLE_31_STABLE 2016-06-27 14:18:36 +08:00
Jun Pataleta a8bab41277 MDL-55028 webservice_soap: Use strlen for setting Content-Length header 2016-06-27 14:02:04 +08:00
Mark Nelson 20ede33d61 MDL-55027 enrol_lti: avoid invalid image URL causing an exception 2016-06-27 13:29:17 +08:00
Andrew Nicols cd7cc95637 Merge branch 'MDL-54924-31' of git://github.com/junpataleta/moodle into MOODLE_31_STABLE 2016-06-27 13:15:37 +08:00
Marina Glancy 1348e21d66 MDL-54900 mod_choice: correctly count number of answered users 2016-06-27 12:48:30 +08:00
Jun Pataleta 99e7d66fba MDL-55022 mod_lti: Fix undefined variable 2016-06-27 11:41:50 +08:00
Andrew Nicols d53a433b6f Merge branch 'MDL-54785-31' of git://github.com/FMCorz/moodle into MOODLE_31_STABLE 2016-06-27 09:20:55 +08:00
David Monllao 3a71830435 MDL-54707 search: Add user context to get_areas_user_accesses 2016-06-26 21:22:28 +02:00
Damyon Wiese 862792e1a1 MDL-54997 competencies: Fix random unit test fail
Sorting on timecreated is not unique enough to
guarantee a predictable ordering.
2016-06-25 08:05:26 -07:00
Damyon Wiese 80d2c7cfb0 MDL-54997 competencies: Listing evidence contexts
When listing the evidence for a user competency in a course,
the query is missing evidences for sub-contexts in the course.
2016-06-25 07:19:20 -07:00
Juan Leyva b36b4f05c7 MDL-55019 webservice: Course summary text should not be cleaned 2016-06-24 13:34:22 +01:00
Jake Dallimore 063bf930f9 MDL-54610 mod_lti: Fix cartridge support for admin tool add/edit forms 2016-06-24 14:28:12 +08:00
Stephen Bourget fdc9faed62 MDL-54911 mod_feedback: start date should be before the end date 2016-06-23 17:41:48 -04:00
Stephen Bourget 2d0bbd3b6e MDL-54910 mod_data: Open dates should be before close dates 2016-06-23 17:33:32 -04:00
Stephen Bourget dd171628ea MDL-32135 mod_choice: Open time should be before close time 2016-06-23 17:22:02 -04:00
Pau Ferrer Ocaña a11180570f MDL-54909 assign: Style editpdf background to differ from page bg 2016-06-23 15:07:09 +02:00
Andrew Nicols eb36cfcbb6 weekly release 3.1+ 2016-06-23 14:49:48 +08:00
Andrew Nicols 7f2fd69024 Merge branch 'install_31_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_31_STABLE 2016-06-23 14:49:45 +08:00
Frederic Massart 97bf703346 MDL-54785 files: Deprecate the support for $usepost and related 2016-06-23 12:40:51 +08:00
Frederic Massart 89bacb163f Revert "MDL-44626 files: Show the PHP max upload size instead of 'unlimited'"
This reverts commit 6f0768618a.
2016-06-23 12:33:04 +08:00
Frederic Massart f31567294d Revert "Merge branch 'MDL-54110_master' of https://github.com/marxjohnson/moodle"
This reverts commit 016e0abfbc, reversing
changes made to 58a2f0ac40.
2016-06-23 12:33:04 +08:00
Frederic Massart 055bf3ca61 Revert "MDL-54110 repositories: Whitespace, Typo + unit test fixes"
This reverts commit 7e4d43e1a2.
2016-06-23 12:33:04 +08:00
Andrew Nicols e9019af21d Merge branch 'MDL-54948-31-fix2' of https://github.com/lameze/moodle into MOODLE_31_STABLE 2016-06-23 11:01:49 +08:00
Stephen Bourget df221cbf8d MDL-54935 Survey: Remove duplicate event trigger 2016-06-23 03:01:28 +00:00
Simey Lameze e4f4a7c353 MDL-54948 core_files: return false if theres no output from unoconv 2016-06-23 08:37:56 +08:00
AMOS bot 1036d079c1 Automatically generated installer lang files 2016-06-23 00:06:41 +08:00
Skylar Kelty f000a6635b MDL-54993 search: Provide areaid parts to template 2016-06-22 14:53:59 +01:00
Juan Leyva 479b269fe9 MDL-54867 webservice: Document webservice/upload.php deprecation
The 'private' file area is not supported anymore, only 'draft' is
supported right now.
2016-06-22 09:27:05 +01:00
Cameron Ball 6ba23735ab MDL-35104 auth: Always allow editing username for new users 2016-06-22 14:59:55 +08:00
Andrew Nicols 988b11c4da Merge branch 'MDL-54948-31-fix' of https://github.com/lameze/moodle into MOODLE_31_STABLE 2016-06-22 14:49:05 +08:00
Simey Lameze 1b43a5372c MDL-54948 core_upgrade: fix check_unoconv_version logic 2016-06-22 13:54:29 +08:00
Marina Glancy cbe10ace43 MDL-52887 mod_choice: backup allowmultiple option 2016-06-22 13:52:12 +08:00
Andrew Nicols de854b05c3 MDL-54663 forum: Correct digest link to forum preferences 2016-06-22 13:12:20 +08:00
Marina Glancy 465db5bd7c MDL-54953 mod_chat: remove Safari hack
This hack was introduced in MDL-16878 and is not needed in modern Safari versions
but it was reported that it can breaks chat in IE
2016-06-22 12:22:23 +08:00
Eloy Lafuente (stronk7) 2579f5f1fa Merge branch 'wip-mdl-54589-m31' of https://github.com/rajeshtaneja/moodle into MOODLE_31_STABLE 2016-06-22 01:42:05 +02:00
Eloy Lafuente (stronk7) 50804bc956 MDL-54778 form: Make it all js style (eslint) compliant
The changes in this commit should not be problematic, just:

- different whitespace.
- some docs.
- 1 variable to camelCase.

And then, less trivial, but safe enough IMO:

- a change to camelCase some identifiers and their calculation.
2016-06-22 01:30:06 +02:00
Eloy Lafuente (stronk7) 6b90efd076 Merge branch 'MDL-54778-31' of git://github.com/andrewnicols/moodle into MOODLE_31_STABLE 2016-06-22 01:30:01 +02:00
AMOS bot 64995b83fc Automatically generated installer lang files 2016-06-22 00:06:21 +08:00
Rajesh Taneja 041e40cf1b MDL-54940 behat: No need to press save
Previous step press save button, so no need to press again
2016-06-21 19:01:22 +08:00
Eloy Lafuente (stronk7) e2dee6f3cd Merge branch 'MDL-54948-31' of git://github.com/lameze/moodle into MOODLE_31_STABLE 2016-06-21 11:47:11 +02:00
Tobias Reischmann e23d29dc91 MDL-54892 core: Pass proper parameter for plugin uninstall queries 2016-06-21 09:14:48 +02:00
Andrew Nicols afee01ac2f Merge branch 'MDL-54920-m31' of https://github.com/sammarshallou/moodle into MOODLE_31_STABLE 2016-06-21 14:19:09 +08:00
Andrew Nicols f4d1b3ec40 Merge branch 'MDL-54894-31' of git://github.com/crazyserver/moodle into MOODLE_31_STABLE 2016-06-21 12:10:20 +08:00
Andrew Nicols d5088c4ef5 Merge branch 'MDL-54940-31' of https://github.com/LukeCarrier/moodle into MOODLE_31_STABLE 2016-06-21 11:54:00 +08:00
Andrew Nicols cbcbf005fb Merge branch 'MDL-54881_31' of https://github.com/mr-russ/moodle into MOODLE_31_STABLE 2016-06-21 11:32:19 +08:00
Andrew Nicols 4e1af2ead5 Merge branch 'MDL-35104-31-2' of git://github.com/cameron1729/moodle into MOODLE_31_STABLE 2016-06-21 11:22:52 +08:00
Cameron Ball 34d728d3e9 MDL-35104 auth: Don't allow modification of username
Presently it is either unreliable, or not possible to change
the username of a user created with an authentication plugin.
In some cases it is even hard coded to fail. Ideally we would
sync the username, and the issue MDL-21928 exists to address
that. However, in the mean time we should not allow the
username of an external user to be modified.
2016-06-21 11:16:06 +08:00
Andrew Nicols cb2844dc40 Merge branch 'MDL-51505-31' of git://github.com/FMCorz/moodle into MOODLE_31_STABLE 2016-06-21 10:30:46 +08:00
Simey Lameze ccddc71ecb MDL-54948 core_upgrade: fix unoconv check on the environment page 2016-06-21 09:40:08 +08:00
Simey Lameze 9759072f4f MDL-54948 core_files: make the check consistent on unoconv test page 2016-06-21 09:40:07 +08:00
Andrew Nicols 56fb03794c MDL-54778 form: Fix lots of issues with form dependencies
The original issue here was that each loop of the named values did not
check for prototypal properties. As a result, if there were input fields
with names such as 'sort', 'valueOf', 'constructor', etc. these would
return their prototypal functions instead of a falsy value, and be treated
as though they are array - hence the 'Cannot push to Function' type error.

Following on from this I discovered that the data stores were being created
as arrays, but used as objects. This can also cause issues with some form
input names -- e.g. if they are numeric.

These two issues were resolved together by correctly storing them in
objects, and checking that those objects had real properties
(hasOwnProperty). This itself has to use the prototypal function to cater
for the potential of a field name called 'hasOwnProperty'.

I also found that the instance value stores were being initialised in the
prototype (and therefore shared), which meant that there were numerous
issues if two forms were present on the same page, or one form replaced an
existing one (e.g. forms initialised in JS).

In addition, it also became apparant that several values were being used
outside of scope, or in the wrong scope. This caused further issues when
creating multiple forms on a page.
2016-06-21 08:08:03 +08:00
Russell Smith 9b1232cb59 MDL-54881 quiz: Ensure user attempts are deterministic for testing. 2016-06-21 08:32:42 +10:00
AMOS bot 1e0b57f90d Automatically generated installer lang files 2016-06-21 00:05:30 +08:00
AMOS bot b1ab556419 Automatically generated installer lang files 2016-06-21 00:05:30 +08:00
Rajesh Taneja 6bf8caa573 MDL-54589 behat: Update composer to point to new tag 2016-06-20 16:03:12 +08:00
Rajesh Taneja 9d2e2a80be MDL-54589 behat: Fixed failures for phantomjs standalone 2016-06-20 16:03:12 +08:00
Rajesh Taneja 315c9ba2d4 MDL-54589 behat: Don't allow floating headers for behat 2016-06-20 16:03:12 +08:00
Rajesh Taneja 86e079521b MDL-54589 behat: Added hack for some OS/browsers 2016-06-20 16:03:11 +08:00
Jun Pataleta b25610f206 MDL-54924 tool_lp: Make the url property optional 2016-06-20 15:05:34 +08:00
Pau Ferrer Ocaña 0e31c8f92b MDL-54894 comments: Get course from context if not informed 2016-06-20 09:02:15 +02:00
Rajesh Taneja 8e6783526e MDL-54589 group: ensure loader is available before remobing 2016-06-20 10:00:00 +08:00
Rajesh Taneja 5f738b0be5 MDL-54589 behat: Trigger change event after selecting option
After selecting option, some browsers need
explicit change event
2016-06-20 09:59:59 +08:00
Luke Carrier 0bca566c04 MDL-54940 behat: use the fixed step 2016-06-19 17:24:59 +01:00
Luke Carrier 2cfe2ecee6 MDL-54940 behat: rectify section edit regression in MDL-53381 2016-06-19 17:24:59 +01:00
AMOS bot 0ab99aa340 Automatically generated installer lang files 2016-06-20 00:04:58 +08:00
AMOS bot e12f32dcda Automatically generated installer lang files 2016-06-19 00:06:21 +08:00
Eloy Lafuente (stronk7) a7221c5f19 weekly release 3.1+ 2016-06-16 17:01:46 +02:00
Eloy Lafuente (stronk7) 940fe6f99c NOBUG: Fixed SVG browser compatibility 2016-06-16 17:01:42 +02:00
sam marshall 143f3624cf MDL-54920 Behat: Allow viewport size to be set consistently
Provides a new Behat step

And I set viewport size to "800x600"
2016-06-15 15:26:42 +01:00
Nicholas Hoobin bdcc0dd59f MDL-53788 multilangupgrade: fix aggressive course cache rebuilding 2016-06-15 09:12:20 +08:00
Nicholas Hoobin b77709ca67 MDL-53788 user: fix aggressive course cache rebuilding 2016-06-15 09:12:20 +08:00
Nicholas Hoobin 557ca0146d MDL-53788 mod_lti: fix aggressive course cache rebuilding 2016-06-15 09:12:19 +08:00
Andrew Nicols 261eb32955 Merge branch 'MDL-54559-int-31' of https://github.com/merrill-oakland/moodle into MOODLE_31_STABLE 2016-06-15 08:24:42 +08:00
Eric Merrill 28ac27c0c2 MDL-54559 theme: Recenter search box 2016-06-14 11:01:02 -04:00
Andrew Nicols 894ed0c657 Merge branch 'MDL-54712-31' of git://github.com/junpataleta/moodle into MOODLE_31_STABLE 2016-06-14 16:06:09 +08:00
Andrew Nicols 07c8765f2b Merge branch 'MDL-54559-31' of git://github.com/junpataleta/moodle into MOODLE_31_STABLE 2016-06-14 14:30:20 +08:00
Andrew Nicols c4c826305d Merge branch 'MDL-54797_31' of git://github.com/aolley/moodle into MOODLE_31_STABLE 2016-06-14 13:27:10 +08:00
Andrew Nicols cff883d5a1 Merge branch 'MDL-54787-31' of https://github.com/snake/moodle into MOODLE_31_STABLE 2016-06-14 11:54:19 +08:00
jogarcia b5882aa15c MDL-54576 theme: Redirect to show confirmation
After selecting a new theme, save the new configs
then redirect to show the confirmation and the new
theme's read me.  This prevents any odd behavior
from the old theme bleeding into the display of
the confirmation.
2016-06-14 11:44:23 +08:00
Andrew Nicols e744a082e1 Merge branch 'MDL-54859_31' of git://github.com/dmonllao/moodle into MOODLE_31_STABLE 2016-06-14 11:01:31 +08:00
Eloy Lafuente (stronk7) 23bba6e190 Merge branch 'MDL-54890-31' of git://github.com/danpoltawski/moodle into MOODLE_31_STABLE 2016-06-13 20:07:24 +02:00
Joby Harding f9a6276f42 MDL-51505 tool_templatelibrary: Prevent jumping when selecting template 2016-06-13 17:07:57 +08:00
Dan Poltawski 5f9e0cd58b Merge branch 'MDL-51683-31' of git://github.com/FMCorz/moodle into MOODLE_31_STABLE 2016-06-13 09:48:52 +01:00
Dan Poltawski 082a4b6b6c Merge branch 'MDL-54772-31' of git://github.com/junpataleta/moodle into MOODLE_31_STABLE 2016-06-13 09:35:52 +01:00
David Monllao 50b19dc897 MDL-54562 mod_data: Add activities info to search 2016-06-13 09:18:11 +01:00
Dan Poltawski beb50de63d Merge branch 'MDL-54837-31' of git://github.com/marinaglancy/moodle into MOODLE_31_STABLE 2016-06-13 08:51:58 +01:00
Jun Pataleta 3863f17ffe MDL-54712 mod_lti: Remove markup from LTI admin notification messages 2016-06-13 10:08:59 +08:00
Jun Pataleta 233231def7 MDL-54772 mod_assign: Fixes for PDF editor
* Render the annotations and comments within the drawing canvas, not in
the drawing region.
* Remove edit-related event bindings for stamp annotations.
2016-06-13 09:59:33 +08:00
Stephen Bourget f20a35754f MDL-54656 Behat: Additional tests for advanced search 2016-06-12 21:07:06 -04:00
Stephen Bourget b43d3fbdcb MDL-54656 Behat: Add tests for search_forums block 2016-06-12 21:06:59 -04:00
Jake Dallimore 9685d369ad MDL-54787 mod_quiz: Fix notification error on regrade 2016-06-10 18:32:49 +08:00
Dan Poltawski d991bbefe9 MDL-54890 course: remove erranous duplicated switch label
Detected by eslint rule 'no-duplicate-case'
2016-06-10 10:08:23 +01:00
Dan Poltawski ba7a9b6b9c MDL-54890 assignfeedback_editpdf: Fix missing semicolon
Detected by eslint rule 'semi'
2016-06-10 10:08:23 +01:00
Jun Pataleta edc4a0af61 MDL-54842 core_renderer: Hide additional body HTML in embedded layout 2016-06-10 14:47:54 +08:00
Stephen Bourget a3bc32d4e9 MDL-53111 Lesson: Allow "end reached" criteria to be disabled 2016-06-09 12:21:33 -04:00
Dan Poltawski 0563e83290 weekly release 3.1+ 2016-06-09 11:25:27 +01:00
Dan Poltawski ec82991b97 Merge branch 'install_31_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_31_STABLE 2016-06-09 11:25:25 +01:00
Andrew Nicols bf98b7fe3b MDL-54853 weblib: Specify version and fixed encoding 2016-06-09 09:54:41 +08:00
Andrew Nicols 2331a70c89 Merge branch 'MDL-54853-31' of git://github.com/cameron1729/moodle into MOODLE_31_STABLE 2016-06-09 09:54:37 +08:00
Cameron Ball 63ba15c7db MDL-54853 weblib: Properly specify encoding for blanktarget 2016-06-08 18:29:42 +08:00
David Monllao 2398d9160a MDL-54859 mod_wiki: Client rules only when fields are visible 2016-06-08 16:46:54 +08:00
Andrew Nicols a72a8de00c Merge branch 'MDL-53947-31' of git://github.com/junpataleta/moodle into MOODLE_31_STABLE 2016-06-08 08:46:51 +08:00
Dan Poltawski 490b6ff9ea MDL-46721 assign: clarify ternerary statement 2016-06-07 12:15:50 +01:00
Dan Poltawski 7512e4d33c Merge branch 'MDL-46721-31' of git://github.com/cameron1729/moodle into MOODLE_31_STABLE 2016-06-07 12:12:37 +01:00
Frederic Massart adaf294a75 MDL-48756 editor_atto: Bulk atto autosave queries 2016-06-07 11:49:49 +01:00
Dan Poltawski 906c52ee96 MDL-54729 mod_forum: clarify static variable usage
After some time discussing with integrators, we decided that this
slightly yukky solution probably fits safely, so just making its usage
better explained and speciifc.
2016-06-07 10:48:07 +01:00
Adrian Greeve 8dc6bb8591 MDL-54729 mod_forum: Deep link highlighting works in IE. 2016-06-07 10:47:51 +01:00
Dan Poltawski 5043e4c31c Merge branch 'MDL-54765-31' of git://github.com/junpataleta/moodle into MOODLE_31_STABLE 2016-06-07 09:41:34 +01:00
David Monllao dbc6c12766 Merge branch 'MDL-54180_31_STABLE' of https://github.com/marxjohnson/moodle into MOODLE_31_STABLE 2016-06-07 16:17:19 +08:00
Eric Merrill 8abe0e83ee MDL-54559 theme: Fix padding that pushes navbar down 2016-06-07 14:58:40 +08:00
Skylar Kelty 318ff4acd7 MDL-53947 memcached: Fix memcached session warning on PHP7 2016-06-07 10:27:18 +08:00
Marina Glancy e9ada19fbb MDL-54837 tags: allow to specify static function as callback 2016-06-07 09:06:44 +08:00
Marina Glancy af8fc4c11d MDL-54837 tags: fixed bug when collection is locked
also fixed fatal error for upgraded plugins that did not pass tag
component to the tag form element
2016-06-07 09:06:44 +08:00
AMOS bot a2ae2c665f Automatically generated installer lang files 2016-06-07 06:28:19 +08:00
Eloy Lafuente (stronk7) e7bb6f945c Merge branch 'MDL-54739-31' of git://github.com/lameze/moodle into MOODLE_31_STABLE 2016-06-07 00:16:39 +02:00
Eloy Lafuente (stronk7) aa6fa3a56e Merge branch 'MDL-54769-31' of git://github.com/marinaglancy/moodle into MOODLE_31_STABLE 2016-06-06 23:56:51 +02:00
Eloy Lafuente (stronk7) 94f5d8a803 Merge branch 'MDL-54805-31-test' of git://github.com/junpataleta/moodle into MOODLE_31_STABLE 2016-06-06 18:08:41 +02:00
Dan Poltawski 162dbe8d8c Merge branch 'wip-MDL-50824-MOODLE_31_STABLE' of https://github.com/cdsmith-umn/moodle into MOODLE_31_STABLE 2016-06-06 15:07:02 +01:00
Dan Poltawski 5761f5831b Merge branch 'MDL-54820-31' of git://github.com/jleyva/moodle into MOODLE_31_STABLE 2016-06-06 14:12:24 +01:00
Dan Poltawski d4e14393b4 Merge branch 'MDL-54702_31' of https://github.com/snake/moodle into MOODLE_31_STABLE 2016-06-06 13:41:47 +01:00
Dan Poltawski 76c2a5dfbd Merge branch 'MDL-53392_31' of https://github.com/snake/moodle into MOODLE_31_STABLE 2016-06-06 13:21:10 +01:00
Dan Poltawski 5bb6def595 Merge branch 'MDL-54557-31' of git://github.com/marinaglancy/moodle into MOODLE_31_STABLE 2016-06-06 13:17:11 +01:00
Dan Poltawski 1b6d059624 Merge branch 'wip-MDL-49852-31' of git://github.com/abgreeve/moodle into MOODLE_31_STABLE 2016-06-06 11:59:44 +01:00
Eloy Lafuente (stronk7) f0043725b5 Merge branch 'MDL-41922-31-c' of git://github.com/FMCorz/moodle into MOODLE_31_STABLE 2016-06-06 11:51:40 +02:00
Juan Leyva c8f3dfd3af MDL-54820 webservice: Fix regression in core_course_search_courses
Regression caused by MDL-51324
2016-06-03 13:04:00 +02:00
Mike Churchward bbe5d6c827 MDL-54805 portfolio_download: Adding a 'require' of necessary library file 2016-06-03 16:53:10 +08:00
Jun Pataleta 34d3e68c0d MDL-54765 mod_assign: Use selectedIndex for setting page selection
Set the 'selectedIndex' attribute of the page selection element instead of
the 'value' attribute since YUI is having trouble with this in IE.
2016-06-03 14:55:27 +08:00
Frederic Massart fa46696e27 MDL-41922 mod_quiz: Don't report quiz due when an attempt was finished 2016-06-03 14:53:08 +08:00
Andrew Nicols 30062d5a8e weekly release 3.1+ 2016-06-03 12:01:53 +08:00
Simey Lameze cbf3b1db5e MDL-54739 blocks: fix activity chooser link alignment 2016-06-03 10:44:18 +08:00
Clement Smith 599293befd MDL-50824 message/externallib.php: Fix get_string call
This fixes the get_string call by adding the intended recipient's
fullname as the third argument when a user tries to message the
recipient, the recipient is blocking non-contacts from messaging
them, and the user is not in the recipient's contact list.
2016-06-02 07:22:04 -05:00
Adam Olley 7141480e85 MDL-54797 course: Add indexed field to condition of delete query
Deleting records from the course_completion_criteria table goes much
faster when we include the indexed course field in the delete query.
2016-06-02 15:52:07 +09:30
Marina Glancy 32e79050f8 MDL-54557 course: treat section summary as contents 2016-06-02 12:57:10 +08:00
Andrew Nicols b0f7923ff0 MDL-54722 javascript: Add YUI depend wrapper to global event 2016-06-02 10:09:31 +08:00
Frederic Massart b30e4fd68d MDL-48248 enrol_manual: Handle durations more precise than int days 2016-06-01 15:57:45 +08:00
Andrew Nicols eb17d699ab Merge branch 'MDL-54722-31' of git://github.com/cameron1729/moodle into MOODLE_31_STABLE 2016-06-01 12:24:32 +08:00
Cameron Ball 4f66e19b09 MDL-54722 navigation: Properly overflow expanded nav trees 2016-06-01 10:16:46 +08:00
Jake Dallimore 1b27eacc4a MDL-54702 mod_lti: Support standard cartridge icons in LTI import 2016-06-01 09:48:13 +08:00
Marina Glancy 88ed1fab62 MDL-54769 backup: add missing error language string 2016-06-01 09:45:42 +08:00
Andrew Nicols 328bc43039 Merge branch 'MDL-53598-31' of git://github.com/marinaglancy/moodle into MOODLE_31_STABLE 2016-06-01 08:25:26 +08:00
Mark Johnson 6862093122 MDL-54180 Behat: Handle exceptions from driver when saving screenshot 2016-05-31 12:34:58 +01:00
Marina Glancy 9fb7f10fc5 MDL-53598 block_glossary_random: do not fail if glossary was deleted
This commit refactors how associated glossary is searched for and removes
unnecessary DB queries. Also prevents from situations when the global glossary or course have
been deleted
2016-05-31 15:31:40 +08:00
David Monllao 50e4de2385 Merge branch 'MDL-54065-31' of git://github.com/marinaglancy/moodle into MOODLE_31_STABLE 2016-05-31 15:27:53 +08:00
Andrew Nicols 347cab92be Merge branch 'MDL-54655_m31v1' of https://github.com/sbourget/moodle into MOODLE_31_STABLE 2016-05-31 13:50:17 +08:00
David Monllao 86d0cd25c4 Merge branch 'MDL-54667-31' of git://github.com/junpataleta/moodle into MOODLE_31_STABLE 2016-05-31 13:09:46 +08:00
David Monllao b1d6b851c0 Merge branch 'MDL-54763_m31' of git://github.com/markn86/moodle into MOODLE_31_STABLE 2016-05-31 12:31:47 +08:00
David Monllao 9ec8754e68 Merge branch 'MDL-53851-31' of https://github.com/blckct/moodle into MOODLE_31_STABLE 2016-05-31 11:46:25 +08:00
David Monllao 117b5cb9a3 Merge branch 'MDL-53938_31' of git://github.com/timhunt/moodle into MOODLE_31_STABLE 2016-05-31 11:42:53 +08:00
David Monllao 035cc9e043 Merge branch 'MDL-54605_31' of git://github.com/timhunt/moodle into MOODLE_31_STABLE 2016-05-31 11:32:49 +08:00
Stephen Bourget b42e0d4465 MDL-54579 Behat: tests for the private_files block 2016-05-31 11:18:59 +08:00
Barbara Ramiro 6294da8660 MDL-51683 design: New icon for competencies 2016-05-31 10:47:13 +08:00
Jakub Kania 88e39d3fdd MDL-54667 core_lib: Fix the param name in edit profile link 2016-05-30 16:35:42 +08:00
Cameron Ball 8a101cc06d MDL-37138 weblib: Document blanktarget in upgrade.txt 2016-05-30 16:12:51 +08:00
David Monllao eb61d44fec Merge branch 'MDL_54002_m31v3' of https://github.com/sbourget/moodle into MOODLE_31_STABLE 2016-05-30 16:09:14 +08:00
David Monllao 44ed5d73f2 Merge branch 'MDL-54010-31' of git://github.com/cameron1729/moodle into MOODLE_31_STABLE 2016-05-30 16:04:37 +08:00
David Monllao 5f14cedd3a Merge branch 'MDL-54577-31' of git://github.com/cameron1729/moodle into MOODLE_31_STABLE 2016-05-30 15:45:58 +08:00
David Monllao c32dd85426 Merge branch 'MDL-29905-31' of git://github.com/FMCorz/moodle into MOODLE_31_STABLE 2016-05-30 15:40:56 +08:00
David Monllao 502a3013ce Merge branch 'MDL-54116-31' of git://github.com/cameron1729/moodle into MOODLE_31_STABLE 2016-05-30 15:36:14 +08:00
David Monllao fdf8bf0793 Merge branch 'MDL-49943-31' of git://github.com/marinaglancy/moodle into MOODLE_31_STABLE 2016-05-30 15:29:33 +08:00
Andrew Nicols 78792b028f Merge branch 'MDL-54756_31' of git://github.com/timhunt/moodle into MOODLE_31_STABLE 2016-05-30 15:19:35 +08:00
David Monllao c183e31da0 Merge branch 'MDL-37138-31-2' of git://github.com/cameron1729/moodle into MOODLE_31_STABLE 2016-05-30 15:02:30 +08:00
Andrew Nicols 6381f3bfe0 Merge branch 'MDL-54567-31-build' of git://github.com/FMCorz/moodle into MOODLE_31_STABLE 2016-05-30 14:41:48 +08:00
Marina Glancy 73cf33aad4 MDL-49943 mod_choice: display multiple answers in complete report 2016-05-30 14:18:06 +08:00
Jun Pataleta 49634dadc9 MDL-53425 blocklib: Raise execution time for dashboard reset process 2016-05-30 14:12:38 +08:00
Andrew Nicols f14ddb2a8c Merge branch 'MDL-35987-31' of git://github.com/FMCorz/moodle into MOODLE_31_STABLE 2016-05-30 13:40:56 +08:00
David Monllao 245aed199b Merge branch 'MDL-53425-31-delete-by-chunks' of git://github.com/junpataleta/moodle into MOODLE_31_STABLE 2016-05-30 13:35:37 +08:00
Andrew Nicols 87e2b6154c MDL-54567 backup: Fixtures for legacy grade value rewrite 2016-05-30 13:34:04 +08:00
Frederic Massart c2235a04bf MDL-54567 backup: Process the calculations_freeze item upon restore 2016-05-30 13:34:04 +08:00
Mark Nelson 3574cae7ff MDL-54763 tool_lp: fixed typo in HTML tag 2016-05-30 13:32:04 +08:00
Cameron Ball 11c59cb6b4 MDL-37138 chat: Use blanktarget option for chat text 2016-05-30 13:18:17 +08:00
Cameron Ball 89b2e4fb30 MDL-37138 message: Use blanktarget option for message text 2016-05-30 13:18:17 +08:00
Cameron Ball 5a2228cf82 MDL-37138 weblib: Add blanktarget option to format_text 2016-05-30 13:18:17 +08:00
David Monllao 6898e4da78 Merge branch 'MDL-48248-31' of git://github.com/FMCorz/moodle into MOODLE_31_STABLE 2016-05-30 13:02:56 +08:00
Frederic Massart 83350ad075 MDL-29905 question: Auto remove stale questions upon category deletion 2016-05-30 12:26:41 +08:00
Eric Merrill cfb0491dad MDL-29905 question: Try to delete unused hidden/random questions
Before going to display the warning about moving in use questions,
try to delete unused Random qtype questions, as well as 'hidden'
questions (these are questions that were deleted from the category),
but were in use at the time.
2016-05-30 12:26:40 +08:00
Jun Pataleta 54720d454f MDL-53425 blocklib: Perform deletion of block instances by chunk 2016-05-30 11:24:36 +08:00
David Monllao 4c5ab56a33 Merge branch 'MDL-54721-31' of git://github.com/FMCorz/moodle into MOODLE_31_STABLE 2016-05-30 11:15:45 +08:00
David Monllao fd52a9fbe2 Merge branch 'MDL-43887-31' of git://github.com/cameron1729/moodle into MOODLE_31_STABLE 2016-05-30 11:09:05 +08:00
David Monllao 849b9e71b0 Merge branch 'MDL-51806_31' of https://github.com/snake/moodle into MOODLE_31_STABLE 2016-05-30 10:51:53 +08:00
Jake Dallimore 1b383c0177 MDL-51806 mod_workshop: Add locale support for grade values. 2016-05-30 10:49:39 +08:00
David Monllao 3077735595 Merge branch 'wip-MDL-45427-31' of git://github.com/abgreeve/moodle into MOODLE_31_STABLE 2016-05-30 10:19:41 +08:00
Marina Glancy 8b374f593c MDL-54065 gradebook: correctly display module icon 2016-05-30 10:08:33 +08:00
Stephen Bourget 0995a547d9 MDL-54655 Behat: Tests for the online_users block 2016-05-27 18:24:18 -04:00
Tim Hunt 330216eb8a MDL-54756 moodle_url: remove dangerous trim from make_file_url
This was a regression caused by MDL-50268. It broke qtype_stack.
2016-05-27 21:30:34 +01:00
Tim Hunt fb91edbe50 MDL-54605 quiz regrading: incorrect DB query
There were two issues. With groups, the $params array was wrong
due to PHP + vs array_merge sillyness.

Also, the first column in the SQL was not necessarily unique,
so we need to use a recordset rather than get_records.
2016-05-27 21:28:59 +01:00
Tim Hunt 6760e6db34 MDL-53938 qformat_gift: handle multi-choice MR with one 100% choice 2016-05-27 21:28:46 +01:00
Adrian Greeve 66da5c76b3 MDL-49852 mod_assign: Unit tests for activity completion. 2016-05-27 14:16:04 +08:00
Steve Bader 782aa36c34 MDL-49852 mod_assign: Fix group assignment completion tracking
Fixes completion tracking for group assignments where either only
one student is required to click Submit when submitting the
assignment for grading, all students are required to submit,
or no students are required to click submit (meaning that simply
uploading submits for grading).
2016-05-27 13:06:58 +08:00
Cameron Ball 1ad3ddcd24 MDL-43887 formslib: Allow not set date field
Previously if the date field was not enabled it would
be treated as having value 0. A bug would allow this 0
to pass through and save the date as 1 January 1970
2016-05-27 01:53:24 +08:00
Frederic Massart d30f466a17 MDL-54721 report_competency: Do not ignore the first user selection 2016-05-26 17:55:29 +08:00
Jake Dallimore f7a5f1c835 MDL-53392 mod_assign: Remove old Grade Max warning string references 2016-05-26 17:13:51 +08:00
Cameron Ball 93f06a35dd MDL-54010 roles: Specify encoding for escaped export data 2016-05-26 10:32:01 +08:00
Nigel Cunningham 9efa43c6a9 MDL-54010 roles: Fix missing HTMLspecialchars in role export code.
Role name and description fields are currently not escaped when
exporting a role. This results in an unusable file when characters
such as ampersands are used in a name or description. Fix this by
using htmlspecialchars on both fields.

Signed-off-by: Nigel Cunningham <nigelc@catalyst-au.net>
2016-05-26 10:32:00 +08:00
Stephen Bourget 80d33cde74 MDL-54577 Behat: Add tests for messages block 2016-05-26 10:22:05 +08:00
Marina Glancy 89fba73a45 MDL-54116 block_comments: warnings when commenting outside of a course 2016-05-26 10:20:13 +08:00
Stephen Bourget 95b82c9dcf MDL-54116 block_comments: behat test 2016-05-26 10:20:12 +08:00
Eloy Lafuente (stronk7) b1b097e2b6 weekly release 3.1+ 2016-05-26 02:14:18 +02:00
Adrian Greeve d7f63b7499 MDL-45427 mod_data: Inserting tags into templates.
Allows tags to be inserted into the editor without
having to touch Atto at all.
2016-05-25 15:28:40 +08:00
Frederic Massart 9cfc039669 MDL-35987 qtype_multianswer: Prevent restore failure due to bad sequence 2016-05-25 12:24:23 +08:00
Andrew Nicols f60b424d82 MDL-54059 testing: Add grunt test 2016-05-25 10:53:19 +08:00
Andrew Nicols f5cd3cb44d MDL-54059 testing: Simplify travis output 2016-05-25 10:53:19 +08:00
Frederic Massart 14b4959d75 MDL-48248 enrol_manual: Ensure that the default value is always selected 2016-05-25 10:17:31 +08:00
Eloy Lafuente (stronk7) 5d2f086eea Merge branch 'MDL-54714-31' of git://github.com/andrewnicols/moodle into MOODLE_31_STABLE 2016-05-24 22:23:41 +02:00
Stephen Bourget 5cd7c8e84f MDL-54002 Behat: tests for recent blogs block 2016-05-24 12:49:06 -04:00
Cameron Ball 2e458712c8 MDL-46721 assign: Make blind marking participant numbers match
Previously emails were setting the "From" header to the incorrect
participant number.
2016-05-24 18:25:25 +08:00
Andrew Nicols 87ae1417bf Merge branch 'MDL-54715-31' of git://github.com/marinaglancy/moodle into MOODLE_31_STABLE 2016-05-24 14:53:56 +08:00
Marina Glancy 01fbf70982 MDL-54715 core_question: fixed bug when importing questions with tags
Thanks to WangYang for original patch
2016-05-24 14:38:38 +08:00
David Monllao fad41516de Merge branch 'MDL-54675-forum-highlight-MOODLE_31_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_31_STABLE 2016-05-24 14:20:26 +08:00
Brendan Heywood 1987b771ad MDL-54675 forum: Fixed bug with multiple adjacent hash anchors 2016-05-24 16:07:46 +10:00
Andrew Nicols 0761279e9e MDL-54714 testing: Correct fetch branch for .travis.yml 2016-05-24 13:34:23 +08:00
Tim Hunt f073424c08 MDL-54582 accesslib: improve performance of load_course_context
The new query is logically equivalen, but much, much faster, at
least on Postgred. (15ms, instead of 700ms, in one example I tried
on the database for the OU's main Moodle site.)
2016-05-24 11:18:01 +08:00
Andrew Nicols 7b6cb91d6c MDL-53687 core_media: Comment fix 2016-05-24 09:06:40 +08:00
Andrew Nicols 98e4407615 Merge branch 'MDL-53687-31' of git://github.com/FMCorz/moodle into MOODLE_31_STABLE 2016-05-24 09:06:35 +08:00
Jakub Kania 4f92858527 MDL-53851 news block: Display news from all the accessible groups 2016-05-23 17:23:43 +02:00
Frederic Massart 025e98434d MDL-53687 core_media: Edge does not yet support WebM and OGG 2016-05-23 16:25:47 +08:00
Ryan Wyllie 48e08145e2 MDL-54642 tool_lp: Fix learning plan button layout in FF
The learning plan buttons are floating left but the table below it wasn't
clearning floating elements so it was appearing on the same line.
2016-05-23 14:53:18 +08:00
Frederic Massart 0f365eb0b2 MDL-46934 webservice_rest: Fixed undefined index on XML output 2016-05-23 14:39:00 +08:00
David Monllao d0adf43eec Merge branch 'MDL-54661-31' of git://github.com/junpataleta/moodle into MOODLE_31_STABLE 2016-05-23 14:24:18 +08:00
Jun Pataleta 4ac0e2d5e1 MDL-54661 mod_assign: Unescape course name in grading nav template 2016-05-23 12:12:42 +08:00
Jun Pataleta dabfdc2c6c MDL-54664 blocks_lp: Set the layout of to review pages to standard 2016-05-23 09:51:29 +08:00
Eloy Lafuente (stronk7) 1f010acdd0 MDL-54677 upgrade: add 3.1.0 separation line to all upgrade scripts 2016-05-23 01:32:56 +02:00
956 changed files with 20055 additions and 4582 deletions
+17
View File
@@ -0,0 +1,17 @@
*/**/yui/src/*/meta/
*/**/build/
node_modules/
vendor/
lib/editor/atto/yui/src/rangy/js/
lib/editor/tinymce/plugins/pdw/tinymce/
lib/editor/tinymce/tiny_mce/
lib/requirejs/
lib/yuilib/
lib/jquery/
lib/htmlpurifier/
lib/flowplayer/
lib/xhprof/
lib/amd/src/loglevel.js
lib/amd/src/mustache.js
theme/bootstrapbase/javascript/html5shiv.js
theme/bootstrapbase/amd/src/bootstrap.js
+172
View File
@@ -0,0 +1,172 @@
{
'env': {
'browser': true,
'amd': true
},
'globals': {
'M': true,
'Y': true
},
'rules': {
// See http://eslint.org/docs/rules/ for all rules and explanations of all
// rules.
// === Possible Errors ===
'comma-dangle': 'off',
'no-cond-assign': 'error',
'no-console': 'error',
'no-constant-condition': 'error',
'no-control-regex': 'error',
'no-debugger': 'error',
'no-dupe-args': 'error',
'no-dupe-keys': 'error',
'no-duplicate-case': 'error',
'no-empty': 'warn',
'no-empty-character-class': 'error',
'no-ex-assign': 'error',
'no-extra-boolean-cast': 'error',
'no-extra-parens': 'off',
'no-extra-semi': 'error',
'no-func-assign': 'error',
'no-inner-declarations': 'error',
'no-invalid-regexp': 'error',
'no-irregular-whitespace': 'error',
'no-negated-in-lhs': 'error',
'no-obj-calls': 'error',
'no-prototype-builtins': 'off',
'no-regex-spaces': 'error',
'no-sparse-arrays': 'error',
'no-unexpected-multiline': 'error',
'no-unreachable': 'warn',
'no-unsafe-finally': 'error',
'use-isnan': 'error',
'valid-jsdoc': ['warn', { 'requireReturn': false, 'requireParamDescription': false, 'requireReturnDescription': false }],
'valid-typeof': 'error',
// === 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-case-declarations': 'error',
'no-div-regex': 'error',
'no-empty-pattern': 'error',
'no-empty-function': 'warn',
'no-eq-null': 'error',
'no-eval': 'error',
'no-extend-native': 'error',
'no-extra-bind': 'warn',
'no-fallthrough': 'error',
'no-floating-decimal': 'warn',
// Enabled by grunt for AMD modules: 'no-implicit-globals': 'error',
'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-native-reassign': 'warn',
'no-new-func': 'error',
'no-new-wrappers': 'error',
'no-octal': 'error',
'no-octal-escape': 'error',
'no-proto': 'error',
'no-redeclare': 'warn',
'no-return-assign': 'error',
'no-script-url': 'error',
'no-self-assign': 'error',
'no-self-compare': 'error',
'no-sequences': 'warn',
'no-throw-literal': 'warn',
'no-unmodified-loop-condition': 'error',
'no-unused-expressions': 'error',
'no-unused-labels': 'error',
'no-useless-call': 'warn',
'no-useless-escape': 'warn',
'no-with': 'error',
'wrap-iife': ['error', 'any'],
// === Variables ===
'no-delete-var': 'error',
'no-undef': 'error',
'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',
'comma-spacing': ['warn', { 'before': false, 'after': true }],
'comma-style': ['warn', 'last'],
'computed-property-spacing': 'error',
'consistent-this': 'off',
'eol-last': 'off',
'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-after-var': 'off',
'newline-before-return': 'off',
'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-mixed-spaces-and-tabs': 'error',
'no-multiple-empty-lines': 'warn',
'no-negated-condition': 'off',
'no-nested-ternary': 'warn',
'no-new-object': 'off',
'no-plusplus': 'off',
'no-spaced-func': 'warn',
'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',
'require-jsdoc': 'warn',
'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',
}
}
+92 -46
View File
@@ -27,16 +27,16 @@ env:
# Postgres is significantly is pretty reasonable in its run-time.
# Run unit tests on MySQL
- DB=mysqli PHPUNIT=true INSTALL=false CITEST=false
- DB=mysqli TASK=PHPUNIT
# Run CI Tests without running PHPUnit.
- DB=none PHPUNIT=false INSTALL=false CITEST=true
- DB=none TASK=CITEST
# Run unit tests on Postgres
- DB=pgsql PHPUNIT=true INSTALL=false CITEST=false
- DB=pgsql TASK=PHPUNIT
# Perform an upgrade test too.
- DB=pgsql PHPUNIT=false INSTALL=true CITEST=false UPGRADE=true
- DB=pgsql TASK=UPGRADE
matrix:
# Enable fast finish.
@@ -44,41 +44,66 @@ matrix:
# It will not stop the jobs from running.
fast_finish: true
include:
# Run grunt/npm install on lowest supported npm version
- php: 7
env: DB=none TASK=GRUNT NVM_VERSION='0.10'
# Run grunt/npm install on highest version ('node' is an alias for the latest node.js version.)
- php: 7
env: DB=none TASK=GRUNT NVM_VERSION='node'
exclude:
# MySQL - it's just too slow.
# Exclude it on all versions except for 7.0
# - env: DB=mysqli PHPUNIT=true INSTALL=false CITEST=false
# - env: DB=mysqli TASK=PHPUNIT
# php: 5.6
#
# - env: DB=mysqli PHPUNIT=true INSTALL=false CITEST=false
# - env: DB=mysqli TASK=PHPUNIT
# php: 5.5
- env: DB=mysqli PHPUNIT=true INSTALL=false CITEST=false
- env: DB=mysqli TASK=PHPUNIT
php: 5.4
- env: DB=none TASK=GRUNT
php: 5.4
# Moodle 2.7 is not compatible with PHP 7 for the upgrade test.
- env: DB=pgsql PHPUNIT=false INSTALL=true CITEST=false UPGRADE=true
- env: DB=pgsql TASK=UPGRADE
php: 7.0
cache:
directories:
- $HOME/.composer/cache
- $HOME/.npm
install:
# Disable xdebug. We aren't generating code coverage, and it has a huge impact upon test performance.
- rm /home/travis/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini
# Set the encrypted GITHUB_TOKEN if it's available to raise the API limit.
- if [ -n "$GITHUB_APITOKEN" ]; then composer config github-oauth.github.com $GITHUB_APITOKEN; fi
- >
if [ "$TASK" = 'PHPUNIT' ];
then
if [ -n "$GITHUB_APITOKEN" ]; then
composer config github-oauth.github.com $GITHUB_APITOKEN;
echo 'auth.json' >> .git/info/exclude
fi
# Install composer dependencies.
# We need --no-interaction in case we hit API limits for composer. This causes it to fall back to a standard clone.
# Typically it should be able to use the Composer cache if any other job has already completed before we started here.
- travis_retry composer install --prefer-dist --no-interaction
# Install composer dependencies.
# We need --no-interaction in case we hit API limits for composer. This causes it to fall back to a standard clone.
# Typically it should be able to use the Composer cache if any other job has already completed before we started here.
travis_retry composer install --prefer-dist --no-interaction;
fi
- >
if [ "$TASK" = 'GRUNT' ];
then
nvm install $NVM_VERSION ;
nvm use $NVM_VERSION ;
fi
before_script:
- >
if [ "$INSTALL" = 'true' -o "$PHPUNIT" = 'true' ];
if [ "$TASK" = 'PHPUNIT' -o "$TASK" = 'UPGRADE' ];
then
# Copy generic configuration in place.
cp config-dist.php config.php ;
@@ -120,38 +145,36 @@ before_script:
mysql -u root -e 'SET GLOBAL innodb_file_per_table=ON;' ;
mysql -e 'CREATE DATABASE travis_ci_test DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_bin;' ;
fi
if [ "$PHPUNIT" = 'true' ];
then
# Create a directory for the phpunit dataroot.
mkdir -p "$HOME"/roots/phpunit
# The phpunit dataroot and prefix..
sed -i \
-e "/require_once/i \\\$CFG->phpunit_dataroot = '\/home\/travis\/roots\/phpunit';" \
-e "/require_once/i \\\$CFG->phpunit_prefix = 'p_';" \
config.php ;
# Initialise PHPUnit for Moodle.
php admin/tool/phpunit/cli/init.php
fi
fi
script:
########################################################################
# PHPUnit
########################################################################
- >
if [ "$PHPUNIT" = 'true' ];
if [ "$TASK" = 'PHPUNIT' ];
then
vendor/bin/phpunit;
# Create a directory for the phpunit dataroot.
mkdir -p "$HOME"/roots/phpunit
# The phpunit dataroot and prefix..
sed -i \
-e "/require_once/i \\\$CFG->phpunit_dataroot = '\/home\/travis\/roots\/phpunit';" \
-e "/require_once/i \\\$CFG->phpunit_prefix = 'p_';" \
config.php ;
# Initialise PHPUnit for Moodle.
php admin/tool/phpunit/cli/init.php
fi
- >
if [ "$TASK" = 'GRUNT' ];
then
npm install --no-spin;
npm install --no-spin -g grunt ;
fi
########################################################################
# CI Tests
########################################################################
- >
if [ "$CITEST" = 'true' ];
if [ "$TASK" = 'CITEST' ];
then
# Note - this is deliberately placed in the script section as we
# should not add any code until after phpunit has run.
@@ -163,7 +186,7 @@ script:
# We need the official upstream for comparison
git remote add upstream https://github.com/moodle/moodle.git;
git fetch upstream master;
git fetch upstream MOODLE_31_STABLE;
export GIT_PREVIOUS_COMMIT="`git merge-base FETCH_HEAD $TRAVIS_COMMIT`";
export GIT_COMMIT="$TRAVIS_COMMIT";
export UPSTREAM_FETCH_HEAD=`git rev-parse FETCH_HEAD`
@@ -174,18 +197,11 @@ script:
export phpcmd=`which php`;
fi
# Actually run the CI Tests - do this outside of the main test to make output clearer.
- >
if [ "$CITEST" = 'true' ];
then
bash local/ci/php_lint/php_lint.sh;
fi
########################################################################
# Upgrade test
########################################################################
- >
if [ "$UPGRADE" = 'true' ];
if [ "$TASK" = 'UPGRADE' ];
then
# We need the official upstream.
git remote add upstream https://github.com/moodle/moodle.git;
@@ -205,7 +221,37 @@ script:
# The local_ci repository can be used to check upgrade savepoints.
git clone https://github.com/moodlehq/moodle-local_ci.git local/ci ;
fi
script:
- >
if [ "$TASK" = 'PHPUNIT' ];
then
vendor/bin/phpunit;
fi
- >
if [ "$TASK" = 'CITEST' ];
then
bash local/ci/php_lint/php_lint.sh;
fi
- >
if [ "$TASK" = 'GRUNT' ];
then
grunt ;
# 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.
git add . ;
git diff --cached --exit-code ;
fi
########################################################################
# Upgrade test
########################################################################
- >
if [ "$TASK" = 'UPGRADE' ];
then
cp local/ci/check_upgrade_savepoints/check_upgrade_savepoints.php ./check_upgrade_savepoints.php
result=`php check_upgrade_savepoints.php`;
# Check if there are problems
+4 -1
View File
@@ -154,7 +154,10 @@
$settings = '<a href="' . $blocksettings->url . '">' . get_string('settings') . '</a>';
} else if ($blocksettings instanceof admin_settingpage) {
$settings = '<a href="'.$CFG->wwwroot.'/'.$CFG->admin.'/settings.php?section=blocksetting'.$block->name.'">'.$strsettings.'</a>';
} else {
} else if (!file_exists($CFG->dirroot.'/blocks/'.$block->name.'/settings.php')) {
// If the block's settings node was not found, we check that the block really provides the settings.php file.
// Note that blocks can inject their settings to other nodes in the admin tree without using the default locations.
// This can be done by assigning null to $setting in settings.php and it is a valid case.
debugging('Warning: block_'.$block->name.' returns true in has_config() but does not provide a settings.php file',
DEBUG_DEVELOPER);
}
+6 -6
View File
@@ -51,25 +51,25 @@ Options:
Example:
\$sudo -u www-data /usr/bin/php admin/cli/reset_password.php
"; //TODO: localize - to be translated later when everything is finished
";
echo $help;
die;
}
cli_heading('Password reset'); // TODO: localize
$prompt = "enter username (manual authentication only)"; // TODO: localize
cli_heading('Password reset');
$prompt = "Enter username (manual authentication only)";
$username = cli_input($prompt);
if (!$user = $DB->get_record('user', array('auth'=>'manual', 'username'=>$username, 'mnethostid'=>$CFG->mnet_localhost_id))) {
cli_error("Can not find user '$username'");
}
$prompt = "Enter new password"; // TODO: localize
$prompt = "Enter new password";
$password = cli_input($prompt);
$errmsg = '';//prevent eclipse warning
if (!check_password_policy($password, $errmsg)) {
cli_error($errmsg);
cli_error(html_to_text($errmsg, 0));
}
$hashedpassword = hash_internal_user_password($password);
@@ -78,4 +78,4 @@ $DB->set_field('user', 'password', $hashedpassword, array('id'=>$user->id));
echo "Password changed\n";
exit(0); // 0 means success
exit(0); // 0 means success.
+172
View File
@@ -1145,6 +1145,11 @@
<ON_CHECK message="unsupporteddbtablerowformat" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_libcurl_version" level="optional">
<FEEDBACK>
<ON_CHECK message="libcurlwarning" />
</FEEDBACK>
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
<MOODLE version="2.8" requires="2.2">
@@ -1418,6 +1423,11 @@
<ON_CHECK message="unsupporteddbtablerowformat" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_libcurl_version" level="optional">
<FEEDBACK>
<ON_CHECK message="libcurlwarning" />
</FEEDBACK>
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
<MOODLE version="3.0" requires="2.2">
@@ -1434,6 +1444,7 @@
<VENDOR name="oracle" version="10.2" />
</DATABASE>
<PHP version="5.4.4" level="required">
<RESTRICT function="restrict_php_version_71" message="unsupportedphpversion71" />
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
@@ -1556,6 +1567,11 @@
<ON_CHECK message="unsupporteddbtablerowformat" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_libcurl_version" level="optional">
<FEEDBACK>
<ON_CHECK message="libcurlwarning" />
</FEEDBACK>
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
<MOODLE version="3.1" requires="2.7">
@@ -1572,6 +1588,7 @@
<VENDOR name="oracle" version="10.2" />
</DATABASE>
<PHP version="5.4.4" level="required">
<RESTRICT function="restrict_php_version_71" message="unsupportedphpversion71" />
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
@@ -1701,6 +1718,161 @@
<ON_CHECK message="unoconvwarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_libcurl_version" level="optional">
<FEEDBACK>
<ON_CHECK message="libcurlwarning" />
</FEEDBACK>
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
<MOODLE version="3.2" requires="2.7">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mariadb" version="5.5.31" />
<VENDOR name="mysql" version="5.5.31" />
<VENDOR name="postgres" version="9.1" />
<VENDOR name="mssql" version="10.0" />
<VENDOR name="oracle" version="10.2" />
</DATABASE>
<PHP version="5.6.5" level="required">
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
<ON_CHECK message="pcreunicodewarning" />
</FEEDBACK>
</PCREUNICODE>
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="required">
<FEEDBACK>
<ON_ERROR message="iconvrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="optional">
<FEEDBACK>
<ON_CHECK message="mbstringrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="required">
<FEEDBACK>
<ON_ERROR message="curlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="optional">
<FEEDBACK>
<ON_CHECK message="opensslrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="tokenizer" level="optional">
<FEEDBACK>
<ON_CHECK message="tokenizerrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="xmlrpc" level="optional">
<FEEDBACK>
<ON_CHECK message="xmlrpcrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="soap" level="optional">
<FEEDBACK>
<ON_CHECK message="soaprecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="ctype" level="required">
<FEEDBACK>
<ON_ERROR message="ctyperequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zip" level="required">
<FEEDBACK>
<ON_ERROR message="ziprequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zlib" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="gd" level="required">
<FEEDBACK>
<ON_ERROR message="gdrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="simplexml" level="required">
<FEEDBACK>
<ON_ERROR message="simplexmlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="spl" level="required">
<FEEDBACK>
<ON_ERROR message="splrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="pcre" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="dom" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xml" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xmlreader" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="intl" level="optional">
<FEEDBACK>
<ON_CHECK message="intlrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="json" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="hash" level="required"/>
</PHP_EXTENSIONS>
<PHP_SETTINGS>
<PHP_SETTING name="memory_limit" value="96M" level="required">
<FEEDBACK>
<ON_ERROR message="settingmemorylimit" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="file_uploads" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="settingfileuploads" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="opcache.enable" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="opcacherecommended" />
</FEEDBACK>
</PHP_SETTING>
</PHP_SETTINGS>
<CUSTOM_CHECKS>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_storage_engine" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbstorageengine" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="question/engine/upgrade/upgradelib.php" function="quiz_attempts_upgraded" level="required">
<FEEDBACK>
<ON_ERROR message="quizattemptsupgradedmessage" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_slasharguments" level="optional">
<FEEDBACK>
<ON_CHECK message="slashargumentswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_tables_row_format" level="optional">
<FEEDBACK>
<ON_CHECK message="unsupporteddbtablerowformat" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_unoconv_version" level="optional">
<FEEDBACK>
<ON_CHECK message="unoconvwarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_libcurl_version" level="optional">
<FEEDBACK>
<ON_CHECK message="libcurlwarning" />
</FEEDBACK>
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
</COMPATIBILITY_MATRIX>
+6
View File
@@ -52,6 +52,12 @@ if (!function_exists('json_encode') || !function_exists('json_decode')) {
die();
}
// Make sure xml extension is available.
if (!extension_loaded('xml')) {
echo 'Moodle requires the xml PHP extension. Please install or enable the xml extension.';
die();
}
define('NO_OUTPUT_BUFFERING', true);
if (isset($_POST['upgradekey'])) {
+2 -1
View File
@@ -60,7 +60,8 @@ class mnet_simple_host_form extends moodleform {
}
if ($host = $DB->get_record('mnet_host', array('wwwroot' => $wwwroot))) {
global $CFG;
return array('wwwroot' => get_string('hostexists', 'mnet', $CFG->wwwroot . '/admin/mnet/peers.php?hostid=' . $host->id));
return array('wwwroot' => get_string('hostexists', 'mnet',
new moodle_url('/admin/mnet/peers.php', array('hostid' => $host->id))));
}
return array();
}
+2 -2
View File
@@ -109,7 +109,7 @@ if (!empty($hostid)) {
$mnet_peer->set_id($hostid);
echo $OUTPUT->header();
$currenttab = 'mnetdetails';
require_once($CFG->dirroot . '/admin/mnet/tabs.php');
require_once($CFG->dirroot . '/' . $CFG->admin . '/mnet/tabs.php');
if ($hostid != $CFG->mnet_all_hosts_id) {
$mnet_peer->currentkey = mnet_get_public_key($mnet_peer->wwwroot, $mnet_peer->application);
@@ -144,7 +144,7 @@ if (empty($noreviewform) && $id = optional_param('id', 0, PARAM_INT)) {
// we're editing an existing one, so set up the tabs
$currenttab = 'mnetdetails';
$mnet_peer->set_id($id);
require_once($CFG->dirroot . '/admin/mnet/tabs.php');
require_once($CFG->dirroot . '/' . $CFG->admin . '/mnet/tabs.php');
} else if (empty($noreviewform) && ($wwwroot = optional_param('wwwroot', '', PARAM_URL)) && ($applicationid = optional_param('applicationid', 0, PARAM_INT))) {
$application = $DB->get_field('mnet_application', 'name', array('id'=>$applicationid));
$mnet_peer->bootstrap($wwwroot, null, $application);
+1 -1
View File
@@ -26,7 +26,7 @@
require(dirname(dirname(dirname(__FILE__))).'/config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->dirroot . '/admin/mnet/profilefields_form.php');
require_once($CFG->dirroot . '/' . $CFG->admin .'/mnet/profilefields_form.php');
$mnet = get_mnet_environment();
require_login();
+2 -2
View File
@@ -27,7 +27,7 @@
require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->dirroot . '/admin/mnet/services_form.php');
require_once($CFG->dirroot . '/' . $CFG->admin . '/mnet/services_form.php');
$mnet = get_mnet_environment();
require_login();
@@ -82,7 +82,7 @@ if ($formdata = $mform->get_data()) {
echo $OUTPUT->header();
$currenttab = 'mnetservices';
require_once($CFG->dirroot . '/admin/mnet/tabs.php');
require_once($CFG->dirroot . '/' . $CFG->admin . '/mnet/tabs.php');
echo $OUTPUT->box_start();
$s = mnet_get_service_info($mnet_peer, false); // basic data only
$mform->set_data($s);
+4
View File
@@ -32,10 +32,14 @@ $getroles = optional_param('getroles', 0, PARAM_BOOL);
list($context, $course, $cm) = get_context_info_array($contextid);
$PAGE->set_context($context);
require_login($course, false, $cm);
require_capability('moodle/role:review', $context);
require_sesskey();
$OUTPUT->header();
list($overridableroles, $overridecounts, $nameswithcounts) = get_overridable_roles($context,
ROLENAME_BOTH, true);
+3 -2
View File
@@ -71,8 +71,9 @@ class core_role_preset {
$dom->appendChild($top);
$top->appendChild($dom->createElement('shortname', $role->shortname));
$top->appendChild($dom->createElement('name', $role->name));
$top->appendChild($dom->createElement('description', $role->description));
$top->appendChild($dom->createElement('name', htmlspecialchars($role->name, ENT_COMPAT | ENT_HTML401, 'UTF-8')));
$top->appendChild($dom->createElement('description', htmlspecialchars($role->description, ENT_COMPAT | ENT_HTML401,
'UTF-8')));
$top->appendChild($dom->createElement('archetype', $role->archetype));
$contextlevels = $dom->createElement('contextlevels');
+5 -2
View File
@@ -258,8 +258,11 @@ preferences,moodle|/user/preferences.php|preferences',
$temp->add(new admin_setting_configcheckbox('blockeditingmenu', new lang_string('blockeditingmenu', 'admin'), new lang_string('blockeditingmenu_desc', 'admin'), 1));
$ADMIN->add('appearance', $temp);
// link to tag management interface
$ADMIN->add('appearance', new admin_externalpage('managetags', new lang_string('managetags', 'tag'), $CFG->wwwroot.'/tag/manage.php', 'moodle/tag:manage'));
// Link to tag management interface.
$url = new moodle_url('/tag/manage.php');
$hidden = empty($CFG->usetags);
$page = new admin_externalpage('managetags', new lang_string('managetags', 'tag'), $url, 'moodle/tag:manage', $hidden);
$ADMIN->add('appearance', $page);
$temp = new admin_settingpage('additionalhtml', new lang_string('additionalhtml', 'admin'));
$temp->add(new admin_setting_heading('additionalhtml_heading', new lang_string('additionalhtml_heading', 'admin'), new lang_string('additionalhtml_desc', 'admin')));
+1 -1
View File
@@ -32,7 +32,7 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
$ADMIN->add('development', $temp);
// "Profiling" settingpage (conditionally if the 'xhprof' extension is available only).
$xhprofenabled = extension_loaded('xhprof') && function_exists('xhprof_enable');
$xhprofenabled = extension_loaded('xhprof') || extension_loaded('tideways');
$temp = new admin_settingpage('profiling', new lang_string('profiling', 'admin'), 'moodle/site:config', !$xhprofenabled);
// Main profiling switch.
$temp->add(new admin_setting_configcheckbox('profilingenabled', new lang_string('profilingenabled', 'admin'), new lang_string('profilingenabled_help', 'admin'), false));
+1 -1
View File
@@ -109,7 +109,7 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
// "httpsecurity" settingpage
$temp = new admin_settingpage('httpsecurity', new lang_string('httpsecurity', 'admin'));
$temp->add(new admin_setting_configcheckbox('loginhttps', new lang_string('loginhttps', 'admin'), new lang_string('configloginhttps', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('cookiesecure', new lang_string('cookiesecure', 'admin'), new lang_string('configcookiesecure', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('cookiesecure', new lang_string('cookiesecure', 'admin'), new lang_string('configcookiesecure', 'admin'), 1));
$temp->add(new admin_setting_configcheckbox('cookiehttponly', new lang_string('cookiehttponly', 'admin'), new lang_string('configcookiehttponly', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('allowframembedding', new lang_string('allowframembedding', 'admin'), new lang_string('allowframembedding_help', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('loginpasswordautocomplete', new lang_string('loginpasswordautocomplete', 'admin'), new lang_string('loginpasswordautocomplete_help', 'admin'), 0));
-1
View File
@@ -79,7 +79,6 @@ $temp->add(new admin_setting_configselect('statsmaxruntime', new lang_string('st
60*60*7 => '7 '.new lang_string('hours'),
60*60*8 => '8 '.new lang_string('hours') )));
$temp->add(new admin_setting_configtext('statsruntimedays', new lang_string('statsruntimedays', 'admin'), new lang_string('configstatsruntimedays', 'admin'), 31, PARAM_INT));
$temp->add(new admin_setting_configtime('statsruntimestarthour', 'statsruntimestartminute', new lang_string('statsruntimestart', 'admin'), new lang_string('configstatsruntimestart', 'admin'), array('h' => 0, 'm' => 0)));
$temp->add(new admin_setting_configtext('statsuserthreshold', new lang_string('statsuserthreshold', 'admin'), new lang_string('configstatsuserthreshold', 'admin'), 0, PARAM_INT));
$ADMIN->add('server', $temp);
+3
View File
@@ -101,6 +101,9 @@ if (empty($options['torun'])) {
if (extension_loaded('pcntl')) {
$disabled = explode(',', ini_get('disable_functions'));
if (!in_array('pcntl_signal', $disabled)) {
// Handle interrupts on PHP7.
declare(ticks = 1);
pcntl_signal(SIGTERM, "signal_handler");
pcntl_signal(SIGINT, "signal_handler");
}
+3
View File
@@ -38,5 +38,8 @@ function xmldb_tool_customlang_upgrade($oldversion) {
// Moodle v3.0.0 release upgrade line.
// Put any upgrade step following this.
// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
@@ -184,6 +184,8 @@ class controller {
if ($updated) {
$this->info[] = get_string('langupdatecomplete', 'tool_langimport');
// The strings have been changed so we need to purge their cache to ensure users see the changes.
get_string_manager()->reset_caches();
} else {
$this->info[] = get_string('nolangupdateneeded', 'tool_langimport');
}
+3
View File
@@ -42,5 +42,8 @@ function xmldb_tool_log_upgrade($oldversion) {
// Moodle v3.0.0 release upgrade line.
// Put any upgrade step following this.
// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
@@ -36,5 +36,8 @@ function xmldb_logstore_database_upgrade($oldversion) {
// Moodle v3.0.0 release upgrade line.
// Put any upgrade step following this.
// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
@@ -53,5 +53,8 @@ function xmldb_logstore_standard_upgrade($oldversion) {
upgrade_plugin_savepoint(true, 2016041200, 'logstore', 'standard');
}
// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
@@ -1 +1 @@
define(["jquery"],function(a){var b=function(b,c,d,e,f,g){this._baseUrl=d,this._userId=e+"",this._competencyId=f+"",this._courseId=g,a(b).on("change",this._userChanged.bind(this)),a(c).on("change",this._competencyChanged.bind(this))};return b.prototype._userChanged=function(b){var c=a(b.target).val(),d="?userid="+c+"&courseid="+this._courseId+"&competencyid="+this._competencyId;document.location=this._baseUrl+d},b.prototype._competencyChanged=function(b){var c=a(b.target).val(),d="?userid="+this._userId+"&courseid="+this._courseId+"&competencyid="+c;document.location=this._baseUrl+d},b.prototype._competencyId=null,b.prototype._userId=null,b.prototype._courseId=null,b.prototype._baseUrl=null,b.prototype._ignoreFirstUser=null,b.prototype._ignoreFirstCompetency=null,b});
define(["jquery"],function(a){var b=function(b,c,d,e,f,g){this._baseUrl=d,this._userId=e+"",this._competencyId=f+"",this._courseId=g,a(b).on("change",this._userChanged.bind(this)),a(c).on("change",this._competencyChanged.bind(this))};return b.prototype._userChanged=function(b){var c=a(b.target).val(),d="?userid="+c+"&courseid="+this._courseId+"&competencyid="+this._competencyId;document.location=this._baseUrl+d},b.prototype._competencyChanged=function(b){var c=a(b.target).val(),d="?userid="+this._userId+"&courseid="+this._courseId+"&competencyid="+c;document.location=this._baseUrl+d},b.prototype._competencyId=null,b.prototype._userId=null,b.prototype._courseId=null,b.prototype._baseUrl=null,b.prototype._ignoreFirstCompetency=null,b});
@@ -75,8 +75,6 @@ define(['jquery'], function($) {
UserCompetencyCourseNavigation.prototype._courseId = null;
/** @type {String} Plugin base url. */
UserCompetencyCourseNavigation.prototype._baseUrl = null;
/** @type {Boolean} Ignore the first change event for users. */
UserCompetencyCourseNavigation.prototype._ignoreFirstUser = null;
/** @type {Boolean} Ignore the first change event for competencies. */
UserCompetencyCourseNavigation.prototype._ignoreFirstCompetency = null;
@@ -40,14 +40,18 @@ class course_module_summary_exporter extends \core_competency\external\exporter
}
protected function get_other_values(renderer_base $output) {
$context = $this->related['cm']->context;
$cm = $this->related['cm'];
$context = $cm->context;
return array(
'id' => $this->related['cm']->id,
'name' => external_format_string($this->related['cm']->name, $context->id),
'url' => $this->related['cm']->url->out(),
'iconurl' => $this->related['cm']->get_icon_url()->out()
$values = array(
'id' => $cm->id,
'name' => external_format_string($cm->name, $context->id),
'iconurl' => $cm->get_icon_url()->out()
);
if ($cm->url) {
$values['url'] = $cm->url->out();
}
return $values;
}
@@ -60,7 +64,8 @@ class course_module_summary_exporter extends \core_competency\external\exporter
'type' => PARAM_TEXT
),
'url' => array(
'type' => PARAM_URL
'type' => PARAM_URL,
'optional' => true,
),
'iconurl' => array(
'type' => PARAM_URL
@@ -91,7 +91,7 @@ class framework_autocomplete extends MoodleQuickForm_autocomplete {
$ids = array();
foreach ($values as $onevalue) {
if ((!$this->optionExists($onevalue)) &&
if (!empty($onevalue) && (!$this->optionExists($onevalue)) &&
($onevalue !== '_qf__force_multiselect_submission')) {
array_push($ids, $onevalue);
}
+5 -3
View File
@@ -95,13 +95,15 @@ class plan_page implements renderable, templatable {
// Get the scale.
$scaleid = $comp->get_scaleid();
$compscale = $comp->get_scale();
if ($scaleid === null) {
$scaleid = $framework->get_scaleid();
$compscale = $framework->get_scale();
}
if (!isset($scales[$framework->get_scaleid()])) {
$scales[$framework->get_scaleid()] = $framework->get_scale();
if (!isset($scales[$scaleid])) {
$scales[$scaleid] = $compscale;
}
$scale = $scales[$framework->get_scaleid()];
$scale = $scales[$scaleid];
// Prepare the data.
$record = new stdClass();
+2 -2
View File
@@ -40,11 +40,11 @@ $url = new moodle_url('/admin/tool/lp/coursecompetencies.php', $urlparams);
list($title, $subtitle) = \tool_lp\page_helper::setup_for_course($url, $course);
$output = $PAGE->get_renderer('tool_lp');
$page = new \tool_lp\output\course_competencies_page($course->id);
echo $output->header();
echo $output->heading($title);
$page = new \tool_lp\output\course_competencies_page($course->id);
echo $output->render($page);
echo $output->footer();
+12 -5
View File
@@ -36,6 +36,13 @@ function tool_lp_extend_navigation_course($navigation, $course, $coursecontext)
return;
}
// Check access to the course and competencies page.
$capabilities = array('moodle/competency:coursecompetencyview', 'moodle/competency:coursecompetencymanage');
$context = context_course::instance($course->id);
if (!has_any_capability($capabilities, $context) || !can_access_course($course)) {
return;
}
// Just a link to course competency.
$title = get_string('competencies', 'core_competency');
$path = new moodle_url("/admin/tool/lp/coursecompetencies.php", array('courseid' => $course->id));
@@ -44,7 +51,7 @@ function tool_lp_extend_navigation_course($navigation, $course, $coursecontext)
navigation_node::TYPE_SETTING,
null,
null,
new pix_icon('competency', '', 'tool_lp'));
new pix_icon('i/competencies', ''));
if (isset($settingsnode)) {
$navigation->add_node($settingsnode);
}
@@ -129,7 +136,7 @@ function tool_lp_extend_navigation_category_settings($navigation, $coursecategor
navigation_node::TYPE_SETTING,
null,
null,
new pix_icon('competency', '', 'tool_lp'));
new pix_icon('i/competencies', ''));
if (isset($settingsnode)) {
$navigation->add_node($settingsnode);
}
@@ -144,7 +151,7 @@ function tool_lp_extend_navigation_category_settings($navigation, $coursecategor
navigation_node::TYPE_SETTING,
null,
null,
new pix_icon('competency', '', 'tool_lp'));
new pix_icon('i/competencies', ''));
if (isset($settingsnode)) {
$navigation->add_node($settingsnode);
}
@@ -169,7 +176,7 @@ function tool_lp_coursemodule_standard_elements($formwrapper, $mform) {
$mform->addElement('header', 'competenciessection', get_string('competencies', 'core_competency'));
MoodleQuickForm::registerElementType('course_competencies',
"$CFG->dirroot/admin/tool/lp/classes/course_competencies_form_element.php",
"$CFG->dirroot/$CFG->admin/tool/lp/classes/course_competencies_form_element.php",
'tool_lp_course_competencies_form_element');
$cmid = null;
if ($cm = $formwrapper->get_coursemodule()) {
@@ -182,7 +189,7 @@ function tool_lp_coursemodule_standard_elements($formwrapper, $mform) {
$mform->addElement('course_competencies', 'competencies', get_string('modcompetencies', 'tool_lp'), $options);
$mform->addHelpButton('competencies', 'modcompetencies', 'tool_lp');
MoodleQuickForm::registerElementType('course_competency_rule',
"$CFG->dirroot/admin/tool/lp/classes/course_competency_rule_form_element.php",
"$CFG->dirroot/$CFG->admin/tool/lp/classes/course_competency_rule_form_element.php",
'tool_lp_course_competency_rule_form_element');
// Reuse the same options.
$mform->addElement('course_competency_rule', 'competency_rule', get_string('uponcoursemodulecompletion', 'tool_lp'), $options);
Binary file not shown.

Before

Width:  |  Height:  |  Size: 994 B

After

Width:  |  Height:  |  Size: 245 B

+15 -76
View File
@@ -1,76 +1,15 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="32"
height="32"
id="svg2"
version="1.1"
inkscape:version="0.48.4 r9939"
sodipodi:docname="New document 1" preserveAspectRatio="xMinYMid meet">
<defs
id="defs4" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="5.6"
inkscape:cx="32.609372"
inkscape:cy="35.818362"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
width="33px"
inkscape:window-width="1916"
inkscape:window-height="981"
inkscape:window-x="0"
inkscape:window-y="72"
inkscape:window-maximized="0" />
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-1020.3622)">
<g
id="g3050"
transform="matrix(0.92121849,0,0,0.92121849,-35.507391,91.120599)">
<path
style="fill:#fafafa"
d="m 38.892857,1026.2908 0,-17 17,0 17,0 0,17 0,17 -17,0 -17,0 0,-17 z"
id="path3056"
inkscape:connector-curvature="0" />
<path
style="fill:#989898"
d="m 40.954049,1037.3439 c -3.465234,-3.0054 -1.687876,-4.0531 6.875853,-4.0531 6.919599,0 7.985143,0.2502 9.263277,2.1752 0.947236,1.4266 2.021632,1.9536 3.121972,1.5314 1.37559,-0.5279 1.677706,-2.0754 1.677706,-8.5934 0,-4.3723 0.273145,-8.6614 0.606989,-9.5314 0.509481,-1.3277 -0.303204,-1.5818 -5.059017,-1.5818 -3.522693,0 -5.432219,-0.3783 -5.047972,-1 1.028329,-1.6639 14.737848,-1.2221 17.277494,0.5567 3.593622,2.5171 2.823056,4.4433 -1.777494,4.4433 l -4,0 0,7.345 c 0,9.8743 -0.892111,10.655 -12.175731,10.655 -7.005509,0 -8.916904,-0.3458 -10.763077,-1.9469 z m 3.938808,-10.6589 c 0,-2.9538 0.324365,-3.3942 2.5,-3.3942 2.153991,0 2.499902,0.4498 2.499294,3.25 -6e-4,2.7611 -0.376693,3.2717 -2.5,3.3942 -2.203157,0.1271 -2.499294,-0.2579 -2.499294,-3.25 z m 7.428571,-1.3942 c 0,-1.6931 0.666667,-2 4.344732,-2 5.000845,0 4.927087,1.9191 -0.08232,2.1419 -3.011559,0.1339 -2.966069,0.1822 0.809017,0.8581 l 4,0.7162 -4.535714,0.1419 c -3.91635,0.1225 -4.535715,-0.1312 -4.535715,-1.8581 z m -6.761904,-3.6667 c -1.167788,-1.1678 -0.718106,-4.0457 0.833333,-5.3333 1.846181,-1.5322 4.5,0.2461 4.5,3.0155 0,2.2918 -3.735778,3.9154 -5.333333,2.3178 z m 6.833333,-0.3333 c 0.339919,-0.55 2.139919,-1 4,-1 1.860081,0 3.660081,0.45 4,1 0.377944,0.6115 -1.175955,1 -4,1 -2.824045,0 -4.377944,-0.3885 -4,-1 z"
id="path3054"
inkscape:connector-curvature="0" />
<path
style="fill:#5e5e5e"
d="m 40.892857,1036.2908 c -1.027328,-1.9196 -0.76049,-2 6.636076,-2 5.863885,0 8.157677,0.4084 9.593719,1.708 1.429812,1.2939 2.297278,1.4506 3.578741,0.6463 1.318167,-0.8273 1.801811,-3.0713 2.191464,-10.1678 l 0.5,-9.1062 -5.5,-0.351 c -4.40263,-0.2811 -3.893849,-0.3889 2.55,-0.5402 5.16365,-0.1213 8.480263,0.2412 9.25,1.0109 2.011735,2.0117 1.364232,2.8 -2.3,2.8 l -3.5,0 0,7.0657 c 0,10.7479 -0.204518,10.9343 -12,10.9343 -8.906177,0 -10.039956,-0.2061 -11,-2 z m 5.078947,-9.0357 c -0.06465,-2.8954 0.283272,-3.5357 1.921053,-3.5357 1.608782,0 2,0.6666 2,3.4081 0,2.8111 -0.245749,3.2042 -1.402754,2.244 -1.077175,-0.894 -1.523051,-0.8644 -1.921053,0.1276 -0.285064,0.7104 -0.553825,-0.2994 -0.597246,-2.244 z m 8.682712,-0.6716 c 1.243913,-0.2392 3.043913,-0.2301 4,0.02 0.956088,0.2503 -0.06166,0.446 -2.261659,0.4349 -2.2,-0.011 -2.982253,-0.2159 -1.738341,-0.4551 z m 0,-3 c 1.243913,-0.2392 3.043913,-0.2301 4,0.02 0.956088,0.2503 -0.06166,0.446 -2.261659,0.4349 -2.2,-0.011 -2.982253,-0.2159 -1.738341,-0.4551 z m 0,-2 c 1.243913,-0.2392 3.043913,-0.2301 4,0.02 0.956088,0.2503 -0.06166,0.446 -2.261659,0.4349 -2.2,-0.011 -2.982253,-0.2159 -1.738341,-0.4551 z m -9.205886,-1.2025 c -0.810187,-1.3109 0.447721,-4.0902 1.851216,-4.0902 1.828446,0 3.499178,2.081 2.907877,3.6219 -0.592966,1.5452 -3.892838,1.87 -4.759093,0.4683 z"
id="path3052"
inkscape:connector-curvature="0" />
</g>
</g>
</svg>
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
]>
<svg version="1.1"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
x="0px" y="0px" width="16px" height="16px" viewBox="-0.042 -0.036 16 16"
style="overflow:visible;enable-background:new -0.042 -0.036 16 16;" xml:space="preserve" preserveAspectRatio="xMinYMid meet">
<defs>
</defs>
<path style="fill:#999999;" d="M15.821,15.071c0.248,0.491,0,0.893-0.55,0.893H0.646c-0.55,0-0.797-0.401-0.55-0.893l1.566-3.107
h12.592L15.821,15.071z M4.184,6.964l-2.017,4H13.75l-2.017-4H4.184z M11.23,5.964L8.409,0.369c-0.248-0.491-0.653-0.491-0.9,0
L4.688,5.964H11.23z"/>
</svg>

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 934 B

+3
View File
@@ -118,6 +118,9 @@
.path-admin-tool-lp [data-region="competencylinktree"] select {
width: 100%;
}
.path-admin-tool-lp [data-region] .generaltable.fullwidth {
clear: both;
}
.path-admin-tool-lp .competency-rule-points {
margin-top: 10px;
@@ -32,10 +32,10 @@
Example context (json):
{
competencycount: 4,
proficientcompetencycount: 3,
proficientcompetencypercentage: 75,
proficientcompetencypercentageformatted: 75.0
"competencycount": 4,
"proficientcompetencycount": 3,
"proficientcompetencypercentage": 75,
"proficientcompetencypercentageformatted": 75.0
}
}}
@@ -32,12 +32,12 @@
Example context (json):
{
linkedcompetencycount: 4,
competencycount: 8,
linkedcompetencypercentage: 50,
plancount: 40,
completedplancount: 30,
completedplanpercentage: 75,
"linkedcompetencycount": 4,
"competencycount": 8,
"linkedcompetencypercentage": 50,
"plancount": 40,
"completedplancount": 30,
"completedplanpercentage": 75
}
}}
@@ -64,7 +64,7 @@
<dt>{{#str}}rating, tool_lp{{/str}}</dt>
<dd>{{gradename}}
{{#cangrade}}
<buttn class="btn" id="rate_{{uniqid}}">{{#str}}rate, tool_lp{{/str}}</button>
<button class="btn" id="rate_{{uniqid}}">{{#str}}rate, tool_lp{{/str}}</button>
{{/cangrade}}
</dd>
{{#js}}
@@ -75,7 +75,7 @@
<dt>{{#str}}rating, tool_lp{{/str}}</dt>
<dd>{{gradename}}
{{#cangrade}}
<buttn class="btn" id="rate_{{uniqid}}">{{#str}}rate, tool_lp{{/str}}</button>
<button class="btn" id="rate_{{uniqid}}">{{#str}}rate, tool_lp{{/str}}</button>
{{/cangrade}}
</dd>
{{/usercompetencycourse}}
@@ -110,4 +110,5 @@
</dd>
</dl>
</div>
</div>
{{/usercompetencysummary}}
@@ -26,7 +26,7 @@
require_once(__DIR__ . '/../../../../../lib/behat/behat_base.php');
use Behat\Gherkin\Node\TableNode as TableNode;
use Behat\Behat\Exception\PendingException as PendingException;
use Behat\Behat\Tester\Exception\PendingException as PendingException;
use core_competency\competency;
use core_competency\competency_framework;
use core_competency\plan;
+6
View File
@@ -0,0 +1,6 @@
This files describes changes in /admin/tool/lp/* - plugins,
information provided here is intended especially for developers.
=== 3.1.1 ===
* The plugin icon 'competency.png/svg' will be removed in the future use i/competencies instead.
+6 -6
View File
@@ -36,16 +36,16 @@ $PAGE->set_url($url);
$PAGE->set_title($title);
$PAGE->set_heading(get_string('pluginname', 'tool_lpmigrate'));
$output = $PAGE->get_renderer('tool_lpmigrate');
echo $output->header();
echo $output->heading($title);
$form = new \tool_lpmigrate\form\migrate_framework($context);
if ($form->is_cancelled()) {
redirect($url);
}
} else if ($data = $form->get_data()) {
$output = $PAGE->get_renderer('tool_lpmigrate');
echo $output->header();
echo $output->heading($title);
if ($data = $form->get_data()) {
// Map competencies from both framework.
$mapper = new \tool_lpmigrate\framework_mapper($data->from, $data->to);
@@ -103,6 +103,15 @@ class manager {
'debug' => empty($CFG->debugimap) ? null : fopen('php://stderr', 'w'),
);
if (strpos($configuration['hostspec'], ':')) {
$hostdata = explode(':', $configuration['hostspec']);
if (count($hostdata) === 2) {
// A hostname in the format hostname:port has been provided.
$configuration['hostspec'] = $hostdata[0];
$configuration['port'] = $hostdata[1];
}
}
$this->client = new \Horde_Imap_Client_Socket($configuration);
try {
+2 -1
View File
@@ -50,7 +50,8 @@ class tool_mobile_external_testcase extends externallib_advanced_testcase {
$result = external::get_plugins_supporting_mobile();
$result = external_api::clean_returnvalue(external::get_plugins_supporting_mobile_returns(), $result);
$this->assertCount(0, $result['warnings']);
$this->assertCount(0, $result['plugins']);
$this->assertArrayHasKey('plugins', $result);
$this->assertTrue(is_array($result['plugins']));
}
}
+5 -4
View File
@@ -103,15 +103,16 @@ class eventlist {
foreach ($pluginlist as $plugin => $directory) {
$plugindirectory = $directory . '/classes/event';
foreach (self::get_file_list($plugindirectory) as $eventname => $notused) {
$plugineventname = '\\' . $plugintype . '_' . $plugin . '\\event\\' . $eventname;
$fullpluginname = $plugintype . '_' . $plugin;
$plugineventname = '\\' . $fullpluginname . '\\event\\' . $eventname;
// Check that this is actually an event.
if (method_exists($plugineventname, 'get_static_info') && $plugin != 'monitor') { // No selfie here.
if (method_exists($plugineventname, 'get_static_info') && $fullpluginname !== 'tool_monitor') { // No selfie here.
$ref = new \ReflectionClass($plugineventname);
if (!$ref->isAbstract() && $plugin != 'legacy') {
if (!$ref->isAbstract() && $fullpluginname !== 'logstore_legacy') {
if ($withoutcomponent) {
$noncorepluginlist[$plugineventname] = $plugineventname::get_name();
} else {
$noncorepluginlist[$plugintype . '_' . $plugin][$plugineventname] = $plugineventname::get_name();
$noncorepluginlist[$fullpluginname][$plugineventname] = $plugineventname::get_name();
}
}
}
@@ -140,6 +140,10 @@ class eventobservers {
$subscriptions = subscription_manager::get_subscriptions_by_event($eventobj);
$idstosend = array();
foreach ($subscriptions as $subscription) {
// Only proceed to fire events and notifications if the subscription is active.
if (!subscription_manager::subscription_is_active($subscription)) {
continue;
}
$starttime = $now - $subscription->timewindow;
$starttime = ($starttime > $subscription->lastnotificationsent) ? $starttime : $subscription->lastnotificationsent;
if ($subscription->courseid == 0) {
+11 -2
View File
@@ -55,17 +55,26 @@ class subscription {
* Magic get method.
*
* @param string $prop property to get.
*
* @return mixed
* @throws \coding_exception
*/
public function __get($prop) {
if (property_exists($this->subscription, $prop)) {
if (isset($this->subscription->$prop)) {
return $this->subscription->$prop;
}
throw new \coding_exception('Property "' . $prop . '" doesn\'t exist');
}
/**
* Magic isset method.
*
* @param string $prop the property to get.
* @return bool true if the property is set, false otherwise.
*/
public function __isset($prop) {
return property_exists($this->subscription, $prop);
}
/**
* Get a human readable name for instances associated with this subscription.
*
@@ -35,6 +35,10 @@ defined('MOODLE_INTERNAL') || die();
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class subscription_manager {
/** @const Period of time, in days, after which an inactive subscription will be removed completely.*/
const INACTIVE_SUBSCRIPTION_LIFESPAN_IN_DAYS = 30;
/**
* Subscribe a user to a given rule.
*
@@ -456,4 +460,78 @@ class subscription_manager {
return false;
}
/**
* Activates a group of subscriptions based on an input array of ids.
*
* @since 3.1.1
* @param array $ids of subscription ids.
* @return bool true if the operation was successful, false otherwise.
*/
public static function activate_subscriptions(array $ids) {
global $DB;
if (!empty($ids)) {
list($sql, $params) = $DB->get_in_or_equal($ids);
$success = $DB->set_field_select('tool_monitor_subscriptions', 'inactivedate', '0', 'id ' . $sql, $params);
return $success;
}
return false;
}
/**
* Deactivates a group of subscriptions based on an input array of ids.
*
* @since 3.1.1
* @param array $ids of subscription ids.
* @return bool true if the operation was successful, false otherwise.
*/
public static function deactivate_subscriptions(array $ids) {
global $DB;
if (!empty($ids)) {
$inactivedate = time();
list($sql, $params) = $DB->get_in_or_equal($ids);
$success = $DB->set_field_select('tool_monitor_subscriptions', 'inactivedate', $inactivedate, 'id ' . $sql,
$params);
return $success;
}
return false;
}
/**
* Deletes subscriptions which have been inactive for a period of time.
*
* @since 3.1.1
* @param int $userid if provided, only this user's stale subscriptions will be deleted.
* @return bool true if the operation was successful, false otherwise.
*/
public static function delete_stale_subscriptions($userid = 0) {
global $DB;
// Get the expiry duration, in days.
$cutofftime = strtotime("-" . self::INACTIVE_SUBSCRIPTION_LIFESPAN_IN_DAYS . " days", time());
if (!empty($userid)) {
// Remove any stale subscriptions for the desired user only.
$success = $DB->delete_records_select('tool_monitor_subscriptions',
'userid = ? AND inactivedate < ? AND inactivedate <> 0',
array($userid, $cutofftime));
} else {
// Remove all stale subscriptions.
$success = $DB->delete_records_select('tool_monitor_subscriptions',
'inactivedate < ? AND inactivedate <> 0',
array($cutofftime));
}
return $success;
}
/**
* Check whether a subscription is active.
*
* @since 3.1.1
* @param \tool_monitor\subscription $subscription instance.
* @return bool true if the subscription is active, false otherwise.
*/
public static function subscription_is_active(subscription $subscription) {
return empty($subscription->inactivedate);
}
}
@@ -0,0 +1,274 @@
<?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/>.
namespace tool_monitor\task;
use tool_monitor\subscription;
use tool_monitor\subscription_manager;
/**
* Simple task class responsible for activating, deactivating and removing subscriptions.
*
* Activation/deactivation is managed by looking at the same access rules used to determine whether a user can
* subscribe to the rule in the first place.
*
* Removal occurs when a subscription has been inactive for a period of time exceeding the lifespan, as set by
* subscription_manager::get_inactive_subscription_lifespan().
*
* I.e.
* - Activation: If a user can subscribe currently, then an existing subscription should be made active.
* - Deactivation: If a user cannot subscribe currently, then an existing subscription should be made inactive.
* - Removal: If a user has a subscription that has been inactive for longer than the prescribed period, then
* delete the subscription entirely.
*
* @since 3.1.1
* @package tool_monitor
* @copyright 2016 Jake Dallimore <jrhdallimore@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class check_subscriptions extends \core\task\scheduled_task {
/** @var array 1d static cache, indexed by userid, storing whether or not the user has been fully set up.*/
protected $userssetupcache = array();
/** @var array 2d static cache, indexed by courseid and userid, storing whether a user can access the course with
* the 'tool/monitor:subscribe' capability.
*/
protected $courseaccesscache = array();
/**
* Get a descriptive name for this task.
*
* @since 3.1.1
* @return string name of the task.
*/
public function get_name() {
return get_string('taskchecksubscriptions', 'tool_monitor');
}
/**
* Checks all course-level rule subscriptions and activates/deactivates based on current course access.
*
* The ordering of checks within the task is important for optimisation purposes. The aim is to be able to make a decision
* about whether to activate/deactivate each subscription without making unnecessary checks. The ordering roughly follows the
* context model, starting with system and user checks and moving down to course and course-module only when necessary.
*
* For example, if the user is suspended, then any active subscription is made inactive right away. I.e. there is no need to
* check site-level, course-level or course-module-level permissions. Likewise, if a subscriptions is site-level, there is no
* need to check course-level and course-module-level permissions.
*
* The task performs the following checks, in this order:
* 1. Check for a suspended user, breaking if suspended.
* 2. Check for an incomplete (not set up) user, breaking if not fully set up.
* 3. Check for the required capability in the relevant context, breaking if the capability is not found.
* 4. Check whether the subscription is site-context, breaking if true.
* 5. Check whether the user has course access, breaking only if the subscription is not also course-module-level.
* 6. Check whether the user has course-module access.
*
* @since 3.1.1
*/
public function execute() {
global $DB;
if (!get_config('tool_monitor', 'enablemonitor')) {
return; // The tool is disabled. Nothing to do.
}
$toactivate = array(); // Store the ids of subscriptions to be activated upon completion.
$todeactivate = array(); // Store the ids of subscriptions to be deactivated upon completion.
// Resultset rows are ordered by userid and courseid to work nicely with get_fast_modinfo() caching.
$sql = "SELECT u.id AS userid, u.firstname AS userfirstname, u.lastname AS userlastname, u.suspended AS usersuspended,
u.email AS useremail, c.visible as coursevisible, c.cacherev as coursecacherev, s.courseid AS subcourseid,
s.userid AS subuserid, s.cmid AS subcmid, s.inactivedate AS subinactivedate, s.id AS subid
FROM {user} u
JOIN {tool_monitor_subscriptions} s ON (s.userid = u.id)
LEFT JOIN {course} c ON (c.id = s.courseid)
WHERE u.id = s.userid
ORDER BY s.userid, s.courseid";
$rs = $DB->get_recordset_sql($sql);
foreach ($rs as $row) {
// Create skeleton records from the result. This should be enough to use in subsequent access calls and avoids DB hits.
$sub = $this->get_subscription_from_rowdata($row);
$sub = new subscription($sub);
if (!isset($user) || $user->id != $sub->userid) {
$user= $this->get_user_from_rowdata($row);
}
if ((!isset($course) || $course->id != $sub->courseid) && !empty($sub->courseid)) {
$course = $this->get_course_from_rowdata($row);
}
// The user is suspended at site level, so deactivate any active subscriptions.
if ($user->suspended) {
if (subscription_manager::subscription_is_active($sub)) {
$todeactivate[] = $sub->id;
}
continue;
}
// Is the user fully set up? As per require_login on the subscriptions page.
if (!$this->is_user_setup($user)) {
if (subscription_manager::subscription_is_active($sub)) {
$todeactivate[] = $sub->id;
}
continue;
}
// Determine the context, based on the subscription course id.
$sitelevelsubscription = false;
if (empty($sub->courseid)) {
$context = \context_system::instance();
$sitelevelsubscription = true;
} else {
$context = \context_course::instance($sub->courseid);
}
// Check capability in the context.
if (!has_capability('tool/monitor:subscribe', $context, $user)) {
if (subscription_manager::subscription_is_active($sub)) {
$todeactivate[] = $sub->id;
}
continue;
}
// If the subscription is site-level, then we've run all the checks required to make an access decision.
if ($sitelevelsubscription) {
if (!subscription_manager::subscription_is_active($sub)) {
$toactivate[] = $sub->id;
}
continue;
}
// Check course access.
if (!$this->user_can_access_course($user, $course, 'tool/monitor:subscribe')) {
if (subscription_manager::subscription_is_active($sub)) {
$todeactivate[] = $sub->id;
}
continue;
}
// If the subscription has no course module relationship.
if (empty($sub->cmid)) {
if (!subscription_manager::subscription_is_active($sub)) {
$toactivate[] = $sub->id;
}
continue;
}
// Otherwise, check the course module info. We use the same checks as on the subscription page.
$modinfo = get_fast_modinfo($course, $sub->userid);
$cm = $modinfo->get_cm($sub->cmid);
if (!$cm || !$cm->uservisible || !$cm->available) {
if (subscription_manager::subscription_is_active($sub)) {
$todeactivate[] = $sub->id;
}
continue;
}
// The course module is available and visible, so make a decision.
if (!subscription_manager::subscription_is_active($sub)) {
$toactivate[] = $sub->id;
}
}
$rs->close();
// Activate/deactivate/delete relevant subscriptions.
subscription_manager::activate_subscriptions($toactivate);
subscription_manager::deactivate_subscriptions($todeactivate);
subscription_manager::delete_stale_subscriptions();
}
/**
* Determines whether a user is fully set up, using cached results where possible.
*
* @since 3.1.1
* @param \stdClass $user the user record.
* @return bool true if the user is fully set up, false otherwise.
*/
protected function is_user_setup($user) {
if (!isset($this->userssetupcache[$user->id])) {
$this->userssetupcache[$user->id] = !user_not_fully_set_up($user, true);
}
return $this->userssetupcache[$user->id];
}
/**
* Determines a user's access to a course with a given capability, using cached results where possible.
*
* @since 3.1.1
* @param \stdClass $user the user record.
* @param \stdClass $course the course record.
* @param string $capability the capability to check.
* @return bool true if the user can access the course with the specified capability, false otherwise.
*/
protected function user_can_access_course($user, $course, $capability) {
if (!isset($this->courseaccesscache[$course->id][$user->id][$capability])) {
$this->courseaccesscache[$course->id][$user->id][$capability] = can_access_course($course, $user, $capability, true);
}
return $this->courseaccesscache[$course->id][$user->id][$capability];
}
/**
* Returns a partial subscription record, created from properties of the supplied recordset row object.
* Intended to return a minimal record for specific use within this class and in subsequent access control calls only.
*
* @since 3.1.1
* @param \stdClass $rowdata the row object.
* @return \stdClass a partial subscription record.
*/
protected function get_subscription_from_rowdata($rowdata) {
$sub = new \stdClass();
$sub->id = $rowdata->subid;
$sub->userid = $rowdata->subuserid;
$sub->courseid = $rowdata->subcourseid;
$sub->cmid = $rowdata->subcmid;
$sub->inactivedate = $rowdata->subinactivedate;
return $sub;
}
/**
* Returns a partial course record, created from properties of the supplied recordset row object.
* Intended to return a minimal record for specific use within this class and in subsequent access control calls only.
*
* @since 3.1.1
* @param \stdClass $rowdata the row object.
* @return \stdClass a partial course record.
*/
protected function get_course_from_rowdata($rowdata) {
$course = new \stdClass();
$course->id = $rowdata->subcourseid;
$course->visible = $rowdata->coursevisible;
$course->cacherev = $rowdata->coursecacherev;
return $course;
}
/**
* Returns a partial user record, created from properties of the supplied recordset row object.
* Intended to return a minimal record for specific use within this class and in subsequent access control calls only.
*
* @since 3.1.1
* @param \stdClass $rowdata the row object.
* @return \stdClass a partial user record.
*/
protected function get_user_from_rowdata($rowdata) {
$user = new \stdClass();
$user->id = $rowdata->userid;
$user->firstname = $rowdata->userfirstname;
$user->lastname = $rowdata->userlastname;
$user->email = $rowdata->useremail;
$user->suspended = $rowdata->usersuspended;
return $user;
}
}
+1
View File
@@ -38,6 +38,7 @@
<FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" COMMENT="User id of the subscriber"/>
<FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" COMMENT="Timestamp of when this subscription was created"/>
<FIELD NAME="lastnotificationsent" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Timestamp of the time when a notification was last sent for this subscription."/>
<FIELD NAME="inactivedate" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
+9
View File
@@ -32,5 +32,14 @@ $tasks = array(
'day' => '*',
'dayofweek' => '*',
'month' => '*'
),
array(
'classname' => 'tool_monitor\task\check_subscriptions',
'blocking' => 0,
'minute' => 'R',
'hour' => 'R',
'day' => '*',
'dayofweek' => '*',
'month' => '*'
)
);
+18
View File
@@ -59,5 +59,23 @@ function xmldb_tool_monitor_upgrade($oldversion) {
// Moodle v3.0.0 release upgrade line.
// Put any upgrade step following this.
// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.
if ($oldversion < 2016052305) {
// Define field inactivedate to be added to tool_monitor_subscriptions.
$table = new xmldb_table('tool_monitor_subscriptions');
$field = new xmldb_field('inactivedate', XMLDB_TYPE_INTEGER, '10', null, true, null, 0, 'lastnotificationsent');
// Conditionally launch add field inactivedate.
if (!$dbman->field_exists($table, $field)) {
$dbman->add_field($table, $field);
}
// Monitor savepoint reached.
upgrade_plugin_savepoint(true, 2016052305, 'tool', 'monitor');
}
return true;
}
+1 -1
View File
@@ -24,7 +24,7 @@
require_once(__DIR__ . '/../../../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->dirroot . '/admin/tool/monitor/lib.php');
require_once($CFG->dirroot.'/'.$CFG->admin.'/tool/monitor/lib.php');
$courseid = optional_param('courseid', 0, PARAM_INT);
$action = optional_param('action', '', PARAM_ALPHA);
@@ -99,4 +99,5 @@ $string['subhelp'] = 'Subscription details';
$string['subhelp_help'] = 'This subscription listens for when the event \'{$a->eventname}\' has been triggered in \'{$a->moduleinstance}\' {$a->frequency} time(s) in {$a->minutes} minute(s).';
$string['subscribeto'] = 'Subscribe to rule "{$a}"';
$string['taskcleanevents'] = 'Removes any unnecessary event monitor events';
$string['taskchecksubscriptions'] = 'Activate/deactivate invalid rule subscriptions';
$string['unsubscribe'] = 'Unsubscribe';
@@ -384,7 +384,7 @@ class tool_monitor_eventobservers_testcase extends advanced_testcase {
// Now let us trigger 7 instances of the event.
$event = \mod_book\event\course_module_instance_list_viewed::create_from_course($course);
$event->trigger();
sleep(1); // Add a second delay, to prevent time collisions.
$this->waitForSecond(); // Add a second delay, to prevent time collisions.
}
$this->run_adhock_tasks();
$messages = $messagesink->get_messages();
@@ -0,0 +1,65 @@
<?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/>.
defined('MOODLE_INTERNAL') || exit();
/**
* Unit tests for the subscription class.
* @since 3.1.1
*
* @package tool_monitor
* @category test
* @copyright 2016 Jake Dallimore <jrhdallimore@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class tool_monitor_subscription_testcase extends advanced_testcase {
/**
* @var \tool_monitor\subscription $subscription object.
*/
private $subscription;
/**
* Test set up.
*/
public function setUp() {
$this->resetAfterTest(true);
// Create the mock subscription.
$sub = new stdClass();
$sub->id = 100;
$sub->name = 'My test rule';
$sub->courseid = 20;
$this->subscription = $this->getMock('\tool_monitor\subscription',null, array($sub));
}
/**
* Test for the magic __isset method.
*/
public function test_magic_isset() {
$this->assertEquals(true, isset($this->subscription->name));
$this->assertEquals(true, isset($this->subscription->courseid));
$this->assertEquals(false, isset($this->subscription->ruleid));
}
/**
* Test for the magic __get method.
*/
public function test_magic_get() {
$this->assertEquals(20, $this->subscription->courseid);
$this->setExpectedException('coding_exception');
$this->subscription->ruleid;
}
}
@@ -0,0 +1,364 @@
<?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/>.
defined('MOODLE_INTERNAL') || exit();
/**
* Unit tests for the tool_monitor clean events task.
* @since 3.1.1
*
* @package tool_monitor
* @category test
* @copyright 2016 Jake Dallimore <jrhdallimore@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class tool_monitor_task_check_subscriptions_testcase extends advanced_testcase {
private $course;
private $user;
private $rule;
private $subscription;
private $teacherrole;
private $studentrole;
/**
* Test set up.
*/
public function setUp() {
global $DB;
set_config('enablemonitor', 1, 'tool_monitor');
$this->resetAfterTest(true);
// All tests defined herein need a user, course, rule and subscription, so set these up.
$this->user = $this->getDataGenerator()->create_user();
$this->course = $this->getDataGenerator()->create_course();
$rule = new stdClass();
$rule->userid = 2; // Rule created by admin.
$rule->courseid = $this->course->id;
$rule->plugin = 'mod_book';
$rule->eventname = '\mod_book\event\course_module_viewed';
$rule->timewindow = 500;
$monitorgenerator = $this->getDataGenerator()->get_plugin_generator('tool_monitor');
$this->rule = $monitorgenerator->create_rule($rule);
$sub = new stdClass();
$sub->courseid = $this->course->id;
$sub->userid = $this->user->id;
$sub->ruleid = $this->rule->id;
$this->subscription = $monitorgenerator->create_subscription($sub);
// Also set up a student and a teacher role for use in some tests.
$this->teacherrole = $DB->get_record('role', array('shortname' => 'teacher'));
$this->studentrole = $DB->get_record('role', array('shortname' => 'student'));
}
/**
* Reloads the subscription object from the DB.
*
* @return void.
*/
private function reload_subscription() {
global $DB;
$sub = $DB->get_record('tool_monitor_subscriptions', array('id' => $this->subscription->id));
$this->subscription = new \tool_monitor\subscription($sub);
}
/**
* Test to confirm the task is named correctly.
*/
public function test_task_name() {
$task = new \tool_monitor\task\check_subscriptions();
$this->assertEquals(get_string('taskchecksubscriptions', 'tool_monitor'), $task->get_name());
}
/**
* Test to confirm that site level subscriptions are activated and deactivated according to system capabilities.
*/
public function test_site_level_subscription() {
// Create a site level subscription.
$monitorgenerator = $this->getDataGenerator()->get_plugin_generator('tool_monitor');
$sub = new stdClass();
$sub->userid = $this->user->id;
$sub->ruleid = $this->rule->id;
$this->subscription = $monitorgenerator->create_subscription($sub);
// Run the task.
$task = new \tool_monitor\task\check_subscriptions();
$task->execute();
// The subscription should be inactive as the user doesn't have the capability. Pass in the id only to refetch the data.
$this->reload_subscription();
$this->assertEquals(false, \tool_monitor\subscription_manager::subscription_is_active($this->subscription));
// Now, assign the user as a teacher role at system context.
$this->getDataGenerator()->role_assign($this->teacherrole->id, $this->user->id, context_system::instance());
// Run the task.
$task = new \tool_monitor\task\check_subscriptions();
$task->execute();
// The subscription should be active now. Pass in the id only to refetch the data.
$this->reload_subscription();
$this->assertEquals(true, \tool_monitor\subscription_manager::subscription_is_active($this->subscription));
}
/**
* Test to confirm that if the module is disabled, no changes are made to active subscriptions.
*/
public function test_module_disabled() {
set_config('enablemonitor', 0, 'tool_monitor');
// Subscription should be active to start with.
$this->assertEquals(true, \tool_monitor\subscription_manager::subscription_is_active($this->subscription));
// Run the task. Note, we never enrolled the user.
$task = new \tool_monitor\task\check_subscriptions();
$task->execute();
// The subscription should still be active. Pass in the id only to refetch the data.
$this->reload_subscription();
$this->assertEquals(true, \tool_monitor\subscription_manager::subscription_is_active($this->subscription));
}
/**
* Test to confirm an active, valid subscription stays active once the scheduled task is run.
*/
public function test_active_unaffected() {
// Enrol the user as a teacher. This role should have the required capability.
$this->getDataGenerator()->enrol_user($this->user->id, $this->course->id, $this->teacherrole->id);
// Subscription should be active to start with.
$this->assertEquals(true, \tool_monitor\subscription_manager::subscription_is_active($this->subscription));
// Run the task.
$task = new \tool_monitor\task\check_subscriptions();
$task->execute();
// The subscription should still be active. Pass in the id only to refetch the data.
$this->reload_subscription();
$this->assertEquals(true, \tool_monitor\subscription_manager::subscription_is_active($this->subscription));
}
/**
* Test to confirm that a subscription for a user without an enrolment to the course is made inactive.
*/
public function test_course_enrolment() {
// Subscription should be active until deactivated by the scheduled task. Remember, by default the test setup
// doesn't enrol the user, so the first run of the task should deactivate it.
$this->assertEquals(true, \tool_monitor\subscription_manager::subscription_is_active($this->subscription));
// Run the task.
$task = new \tool_monitor\task\check_subscriptions();
$task->execute();
// The subscription should NOT be active. Pass in the id only to refetch the data.
$this->reload_subscription();
$this->assertEquals(false, \tool_monitor\subscription_manager::subscription_is_active($this->subscription));
// Enrol the user.
$this->getDataGenerator()->enrol_user($this->user->id, $this->course->id, $this->teacherrole->id);
// Run the task.
$task = new \tool_monitor\task\check_subscriptions();
$task->execute();
// Subscription should now be active again.
$this->reload_subscription();
$this->assertEquals(true, \tool_monitor\subscription_manager::subscription_is_active($this->subscription));
}
/**
* Test to confirm that subscriptions for enrolled users without the required capability are made inactive.
*/
public function test_enrolled_user_with_no_capability() {
// Enrol the user. By default, students won't have the required capability.
$this->getDataGenerator()->enrol_user($this->user->id, $this->course->id, $this->studentrole->id);
// The subscription should be active to start with. Pass in the id only to refetch the data.
$this->assertEquals(true, \tool_monitor\subscription_manager::subscription_is_active($this->subscription));
// Run the task.
$task = new \tool_monitor\task\check_subscriptions();
$task->execute();
// The subscription should NOT be active. Pass in the id only to refetch the data.
$this->reload_subscription();
$this->assertEquals(false, \tool_monitor\subscription_manager::subscription_is_active($this->subscription));
}
/**
* Test to confirm that subscriptions for users who fail can_access_course(), are deactivated.
*/
public function test_can_access_course() {
// Enrol the user as a teacher. This role should have the required capability.
$this->getDataGenerator()->enrol_user($this->user->id, $this->course->id, $this->teacherrole->id);
// Strip the ability to see hidden courses, so we'll fail the check_subscriptions->user_can_access_course call.
$context = \context_course::instance($this->course->id);
assign_capability('moodle/course:viewhiddencourses', CAP_PROHIBIT, $this->teacherrole->id, $context);
// Subscription should be active to start with.
$this->assertEquals(true, \tool_monitor\subscription_manager::subscription_is_active($this->subscription));
// Hide the course.
course_change_visibility($this->course->id, false);
// Run the task.
$task = new \tool_monitor\task\check_subscriptions();
$task->execute();
// The subscription should be inactive. Pass in the id only to refetch the data.
$this->reload_subscription();
$this->assertEquals(false, \tool_monitor\subscription_manager::subscription_is_active($this->subscription));
}
/**
* Test to confirm that subscriptions for enrolled users who don't have CM access, are deactivated.
*/
public function test_cm_access() {
// Enrol the user as a student but grant to ability to subscribe. Students cannot view hidden activities.
$context = \context_course::instance($this->course->id);
assign_capability('tool/monitor:subscribe', CAP_ALLOW, $this->studentrole->id, $context);
$this->getDataGenerator()->enrol_user($this->user->id, $this->course->id, $this->studentrole->id);
// Generate a course module.
$book = $this->getDataGenerator()->create_module('book', array('course' => $this->course->id));
// And add a subscription to it.
$sub = new stdClass();
$sub->courseid = $this->course->id;
$sub->userid = $this->user->id;
$sub->ruleid = $this->rule->id;
$sub->cmid = $book->cmid;
$monitorgenerator = $this->getDataGenerator()->get_plugin_generator('tool_monitor');
$this->subscription = $monitorgenerator->create_subscription($sub);
// The subscription should be active to start with. Pass in the id only to refetch the data.
$this->assertEquals(true, \tool_monitor\subscription_manager::subscription_is_active($this->subscription));
// Run the task.
$task = new \tool_monitor\task\check_subscriptions();
$task->execute();
// The subscription should still be active. Pass in the id only to refetch the data.
$this->reload_subscription();
$this->assertEquals(true, \tool_monitor\subscription_manager::subscription_is_active($this->subscription));
// Make the course module invisible, which should in turn make the subscription inactive.
set_coursemodule_visible($book->cmid, false);
// Run the task.
$task = new \tool_monitor\task\check_subscriptions();
$task->execute();
// The subscription should NOT be active. Pass in the id only to refetch the data.
$this->reload_subscription();
$this->assertEquals(false, \tool_monitor\subscription_manager::subscription_is_active($this->subscription));
// Make the course module visible again.
set_coursemodule_visible($book->cmid, true);
// Run the task.
$task = new \tool_monitor\task\check_subscriptions();
$task->execute();
// The subscription should be active. Pass in the id only to refetch the data.
$this->reload_subscription();
$this->assertEquals(true, \tool_monitor\subscription_manager::subscription_is_active($this->subscription));
}
/**
* Test to confirm that long term inactive subscriptions are removed entirely.
*/
public function test_stale_subscription_removal() {
global $DB;
// Manually set the inactivedate to 1 day older than the limit allowed.
$daysold = 1 + \tool_monitor\subscription_manager::INACTIVE_SUBSCRIPTION_LIFESPAN_IN_DAYS;
$inactivedate = strtotime("-$daysold days", time());
$DB->set_field('tool_monitor_subscriptions', 'inactivedate', $inactivedate, array('id' => $this->subscription->id));
// Subscription should be inactive to start with.
$this->reload_subscription();
$this->assertEquals(false, \tool_monitor\subscription_manager::subscription_is_active($this->subscription));
// Run the task.
$task = new \tool_monitor\task\check_subscriptions();
$task->execute();
// Subscription should now not exist at all.
$this->assertEquals(false, $DB->record_exists('tool_monitor_subscriptions', array('id' => $this->subscription->id)));
}
/**
* Test to confirm that subscriptions for a partially set up user are deactivated.
*/
public function test_user_not_fully_set_up() {
global $DB;
// Enrol the user as a teacher.
$this->getDataGenerator()->enrol_user($this->user->id, $this->course->id, $this->teacherrole->id);
// The subscription should be active to start.
$this->assertEquals(true, \tool_monitor\subscription_manager::subscription_is_active($this->subscription));
// Unset the user's email address, so we fail the check_subscriptions->is_user_setup() call.
$DB->set_field('user', 'email', '', array('id' => $this->user->id));
// Run the task.
$task = new \tool_monitor\task\check_subscriptions();
$task->execute();
// The subscription should now be inactive.
$this->reload_subscription();
$this->assertEquals(false, \tool_monitor\subscription_manager::subscription_is_active($this->subscription));
}
/**
* Test to confirm that a suspended user's subscriptions are deactivated properly.
*/
public function test_suspended_user() {
global $DB;
// Enrol the user as a teacher. This role should have the required capability.
$this->getDataGenerator()->enrol_user($this->user->id, $this->course->id, $this->teacherrole->id);
// Subscription should be active to start with.
$this->assertEquals(true, \tool_monitor\subscription_manager::subscription_is_active($this->subscription));
// Suspend the user.
$DB->set_field('user', 'suspended', '1', array('id' => $this->user->id));
// Run the task.
$task = new \tool_monitor\task\check_subscriptions();
$task->execute();
// The subscription should now be inactive.
$this->reload_subscription();
$this->assertEquals(false, \tool_monitor\subscription_manager::subscription_is_active($this->subscription));
// Unsuspend the user.
$DB->set_field('user', 'suspended', '0', array('id' => $this->user->id));
// Run the task.
$task = new \tool_monitor\task\check_subscriptions();
$task->execute();
// The subscription should now be active again.
$this->reload_subscription();
$this->assertEquals(true, \tool_monitor\subscription_manager::subscription_is_active($this->subscription));
}
}
+1 -1
View File
@@ -26,6 +26,6 @@
defined('MOODLE_INTERNAL') || die;
$plugin->version = 2016052300; // The current plugin version (Date: YYYYMMDDXX).
$plugin->version = 2016052305; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2016051900; // Requires this Moodle version.
$plugin->component = 'tool_monitor'; // Full name of the plugin (used for diagnostics).
+1 -1
View File
@@ -121,7 +121,7 @@ echo $OUTPUT->box_end();
/// Rebuild course cache which might be incorrect now
echo $OUTPUT->notification('Rebuilding course cache...', 'notifysuccess');
rebuild_course_cache();
rebuild_course_cache(0, true);
echo $OUTPUT->notification('...finished', 'notifysuccess');
echo $OUTPUT->continue_button(new moodle_url('/admin/'));
+3 -2
View File
@@ -26,6 +26,7 @@
defined('MOODLE_INTERNAL') || die;
// profiling tool, added to development
if (extension_loaded('xhprof') && function_exists('xhprof_enable') && (!empty($CFG->profilingenabled) || !empty($CFG->earlyprofilingenabled))) {
$ADMIN->add('development', new admin_externalpage('toolprofiling', get_string('pluginname', 'tool_profiling'), "$CFG->wwwroot/$CFG->admin/tool/profiling/index.php", 'moodle/site:config'));
if ((extension_loaded('xhprof') || extension_loaded('tideways')) && (!empty($CFG->profilingenabled) || !empty($CFG->earlyprofilingenabled))) {
$ADMIN->add('development', new admin_externalpage('toolprofiling', get_string('pluginname', 'tool_profiling'),
"$CFG->wwwroot/$CFG->admin/tool/profiling/index.php", 'moodle/site:config'));
}
+6
View File
@@ -158,6 +158,12 @@ function tool_recyclebin_pre_course_module_delete($cm) {
* @param \stdClass $course The course record.
*/
function tool_recyclebin_pre_course_delete($course) {
// It is possible that the course deletion which triggered this hook
// was from an in progress course restore. In that case we do not want
// it in the recycle bin.
if (isset($course->deletesource) && $course->deletesource == 'restore') {
return;
}
// Delete all the items in the course recycle bin, regardless if it enabled or not.
// It may have been enabled, then disabled later on, so may still have content.
$coursebin = new \tool_recyclebin\course_bin($course->id);
@@ -38,6 +38,11 @@ class tool_recyclebin_category_bin_tests extends advanced_testcase {
*/
protected $course;
/**
* @var stdClass $coursebeingrestored
*/
protected $coursebeingrestored;
/**
* Setup for each test.
*/
@@ -57,10 +62,16 @@ class tool_recyclebin_category_bin_tests extends advanced_testcase {
public function test_pre_course_delete_hook() {
global $DB;
// This simulates a temporary course being cleaned up by a course restore.
$this->coursebeingrestored = $this->getDataGenerator()->create_course();
$this->coursebeingrestored->deletesource = 'restore';
// Should have nothing in the recycle bin.
$this->assertEquals(0, $DB->count_records('tool_recyclebin_category'));
delete_course($this->course, false);
// This should not be added to the recycle bin.
delete_course($this->coursebeingrestored, false);
// Check the course is now in the recycle bin.
$this->assertEquals(1, $DB->count_records('tool_recyclebin_category'));
+1 -1
View File
@@ -1 +1 @@
define(["jquery","core/ajax","core/log","core/notification","core/templates","core/config","core/str"],function(a,b,c,d,e,f,g){var h=function(a,b){var c="@template "+b,d=0,e=[];if(e=a.match(/{{!([\s\S]*?)}}/g),null!==e)for(d=0;d<e.length;d++){var f=e[d],g=f.indexOf(c);if(-1!==g){var h=g+c.length+1;return f=f.substr(h,f.length-2-h)}}return!1},i=function(b,f,i){g.get_string("templateselected","tool_templatelibrary",b).done(function(b){a('[data-region="displaytemplateheader"]').text(b)}).fail(d.exception);var j=h(f,b);j===!1&&(j=h(i,b)),j&&(f=j),a('[data-region="displaytemplatesource"]').text(f);var k=f.match(/Example context \(json\):([\s\S]*)/),l=!1;if(k){var m=k[1].trim();try{l=a.parseJSON(m)}catch(n){c.debug("Could not parse json example context for template."),c.debug(n)}}l?e.render(b,l).done(function(b,c){e.replaceNodeContents(a('[data-region="displaytemplateexample"]'),b,c)}).fail(d.exception):g.get_string("templatehasnoexample","tool_templatelibrary").done(function(b){a('[data-region="displaytemplateexample"]').text(b)}).fail(d.exception)},j=function(c){var e=c.split("/"),g=e.shift(),h=e.shift(),j=b.call([{methodname:"core_output_load_template",args:{component:g,template:h,themename:f.theme}},{methodname:"tool_templatelibrary_load_canonical_template",args:{component:g,template:h}}],!0,!1);a.when.apply(a,j).done(function(a,b){i(c,a,b)}).fail(d.exception)};return a('[data-region="list-templates"]').on("click","[data-templatename]",function(){var b=a(this).data("templatename");j(b)}),{}});
define(["jquery","core/ajax","core/log","core/notification","core/templates","core/config","core/str"],function(a,b,c,d,e,f,g){var h=function(a,b){if(!a)return!1;var c="@template "+b,d=0,e=[];if(e=a.match(/{{!([\s\S]*?)}}/g),null!==e)for(d=0;d<e.length;d++){var f=e[d],g=f.indexOf(c);if(-1!==g){var h=g+c.length+1;return f=f.substr(h,f.length-2-h)}}return!1},i=function(b,f,i){g.get_string("templateselected","tool_templatelibrary",b).done(function(b){a('[data-region="displaytemplateheader"]').text(b)}).fail(d.exception);var j=h(f,b);j===!1&&(j=h(i,b)),j&&(f=j),a('[data-region="displaytemplatesource"]').text(f);var k=f.match(/Example context \(json\):([\s\S]*)/),l=!1;if(k){var m=k[1].trim();try{l=a.parseJSON(m)}catch(n){c.debug("Could not parse json example context for template."),c.debug(n)}}l?e.render(b,l).done(function(b,c){e.replaceNodeContents(a('[data-region="displaytemplateexample"]'),b,c)}).fail(d.exception):g.get_string("templatehasnoexample","tool_templatelibrary").done(function(b){a('[data-region="displaytemplateexample"]').text(b)}).fail(d.exception)},j=function(c){var e=c.split("/"),g=e.shift(),h=e.shift(),j=b.call([{methodname:"core_output_load_template",args:{component:g,template:h,themename:f.theme}},{methodname:"tool_templatelibrary_load_canonical_template",args:{component:g,template:h}}],!0,!1);a.when.apply(a,j).done(function(a,b){i(c,a,b)}).fail(d.exception)};return a('[data-region="list-templates"]').on("click","[data-templatename]",function(b){var c=a(this).data("templatename");b.preventDefault(),j(c)}),{}});
+1 -1
View File
@@ -1 +1 @@
define(["jquery","core/ajax","core/log","core/notification","core/templates"],function(a,b,c,d,e){var f=function(b){e.render("tool_templatelibrary/search_results",{templates:b}).done(function(b,c){e.replaceNode(a('[data-region="searchresults"]'),b,c)}).fail(d.exception)},g=function(){var c=a('[data-field="component"]').val(),e=a('[data-field="search"]').val();b.call([{methodname:"tool_templatelibrary_list_templates",args:{component:c,search:e},done:f,fail:d.exception}],!0,!1)},h=null,i=function(a,b){null!==h&&window.clearTimeout(h),h=window.setTimeout(function(){a(),h=null},b)},j=function(){i(g,400)};return a('[data-region="list-templates"]').on("change",'[data-field="component"]',j),a('[data-region="list-templates"]').on("input",'[data-field="search"]',j),g(),{}});
define(["jquery","core/ajax","core/log","core/notification","core/templates","core/config"],function(a,b,c,d,e,f){var g=function(b){e.render("tool_templatelibrary/search_results",{templates:b}).done(function(b,c){e.replaceNode(a('[data-region="searchresults"]'),b,c)}).fail(d.exception)},h=function(c){var e=a('[data-field="component"]').val(),f=a('[data-field="search"]').val();b.call([{methodname:"tool_templatelibrary_list_templates",args:{component:e,search:f,themename:c},done:g,fail:d.exception}],!0,!1)},i=null,j=function(a,b){null!==i&&window.clearTimeout(i),i=window.setTimeout(function(){a(),i=null},b)},k=function(){j(h.bind(this,f.theme),400)};return a('[data-region="list-templates"]').on("change",'[data-field="component"]',k),a('[data-region="list-templates"]').on("input",'[data-field="search"]',k),h(f.theme),{}});
@@ -33,6 +33,9 @@ define(['jquery', 'core/ajax', 'core/log', 'core/notification', 'core/templates'
*/
var findDocsSection = function(templateSource, templateName) {
if (!templateSource) {
return false;
}
// Find the comment section marked with @template component/template.
var marker = "@template " + templateName,
i = 0,
@@ -141,8 +144,9 @@ define(['jquery', 'core/ajax', 'core/log', 'core/notification', 'core/templates'
};
// Add the event listeners.
$('[data-region="list-templates"]').on('click', '[data-templatename]', function() {
$('[data-region="list-templates"]').on('click', '[data-templatename]', function(e) {
var templatename = $(this).data('templatename');
e.preventDefault();
loadTemplate(templatename);
});
+6 -7
View File
@@ -21,8 +21,8 @@
* @copyright 2015 Damyon Wiese <damyon@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define(['jquery', 'core/ajax', 'core/log', 'core/notification', 'core/templates'],
function($, ajax, log, notification, templates) {
define(['jquery', 'core/ajax', 'core/log', 'core/notification', 'core/templates', 'core/config'],
function($, ajax, log, notification, templates, config) {
/**
* The ajax call has returned with a new list of templates.
@@ -42,15 +42,14 @@ define(['jquery', 'core/ajax', 'core/log', 'core/notification', 'core/templates'
*
* @method refreshSearch
*/
var refreshSearch = function() {
var refreshSearch = function(themename) {
var componentStr = $('[data-field="component"]').val();
var searchStr = $('[data-field="search"]').val();
// Trigger the search.
ajax.call([
{ methodname: 'tool_templatelibrary_list_templates',
args: { component: componentStr, search: searchStr },
args: { component: componentStr, search: searchStr, themename: themename },
done: reloadListTemplate,
fail: notification.exception }
], true, false);
@@ -78,12 +77,12 @@ define(['jquery', 'core/ajax', 'core/log', 'core/notification', 'core/templates'
};
var changeHandler = function() {
queueRefresh(refreshSearch, 400);
queueRefresh(refreshSearch.bind(this, config.theme), 400);
};
// Add change handlers to refresh the list.
$('[data-region="list-templates"]').on('change', '[data-field="component"]', changeHandler);
$('[data-region="list-templates"]').on('input', '[data-field="search"]', changeHandler);
refreshSearch();
refreshSearch(config.theme);
return {};
});
+22 -9
View File
@@ -47,7 +47,12 @@ class api {
* @return array[string] Where each template is in the form "component/templatename".
*/
public static function list_templates($component = '', $search = '', $themename = '') {
global $CFG;
global $CFG, $PAGE;
if (empty($themename)) {
$themename = $PAGE->theme->name;
}
$themeconfig = \theme_config::load($themename);
$templatedirs = array();
$results = array();
@@ -77,6 +82,9 @@ class api {
foreach ($plugintypes as $type => $dir) {
$plugins = core_component::get_plugin_list_with_file($type, 'templates', false);
foreach ($plugins as $plugin => $dir) {
if ($type == 'theme' && $plugin != $themename && !in_array($plugin, $themeconfig->parents)) {
continue;
}
if (!empty($dir) && is_dir($dir)) {
$pluginname = $type . '_' . $plugin;
$dirs = mustache_template_finder::get_template_directories_for_component($pluginname, $themename);
@@ -111,25 +119,30 @@ class api {
*
* @param string $component The component that holds the template.
* @param string $template The name of the template.
* @return string the template
* @return string the template or false if template doesn't exist.
*/
public static function load_canonical_template($component, $template) {
// Get the list of possible template directories.
$dirs = mustache_template_finder::get_template_directories_for_component($component);
$filename = false;
$themedir = core_component::get_plugin_types()['theme'];
foreach ($dirs as $dir) {
// Skip theme dirs - we only want the original plugin/core template.
if (strpos($dir, "/theme/") === false) {
$candidate = $dir . $template . '.mustache';
if (file_exists($candidate)) {
$filename = $candidate;
break;
}
if (strpos($dir, $themedir) === 0) {
continue;
}
$candidate = $dir . $template . '.mustache';
if (file_exists($candidate)) {
$filename = $candidate;
break;
}
}
if ($filename === false) {
throw new moodle_exception('filenotfound', 'error');
// There are occasions where we don't have a core template.
return false;
}
$templatestr = file_get_contents($filename);
@@ -59,7 +59,13 @@ class external extends external_api {
VALUE_DEFAULT,
''
);
$params = array('component' => $component, 'search' => $search);
$themename = new external_value(
PARAM_COMPONENT,
'The current theme',
VALUE_DEFAULT,
''
);
$params = array('component' => $component, 'search' => $search, 'themename' => $themename);
return new external_function_parameters($params);
}
@@ -67,16 +73,18 @@ class external extends external_api {
* Loads the list of templates.
* @param string $component Limit the search to a component.
* @param string $search The search string.
* @param string $themename The name of theme
* @return array[string]
*/
public static function list_templates($component, $search) {
public static function list_templates($component, $search, $themename = '') {
$params = self::validate_parameters(self::list_templates_parameters(),
array(
'component' => $component,
'search' => $search,
'themename' => $themename,
));
return api::list_templates($component, $search);
return api::list_templates($component, $search, $themename);
}
/**
@@ -107,7 +115,7 @@ class external extends external_api {
*
* @param string $component The component that holds the template.
* @param string $template The name of the template.
* @return string the template
* @return string the template, false if template doesn't exist.
*/
public static function load_canonical_template($component, $template) {
$params = self::validate_parameters(self::load_canonical_template_parameters(),
+5 -5
View File
@@ -582,6 +582,11 @@ class tool_uploadcourse_course {
}
}
// Course start date.
if (!empty($coursedata['startdate'])) {
$coursedata['startdate'] = strtotime($coursedata['startdate']);
}
// Ultimate check mode vs. existence.
switch ($mode) {
case tool_uploadcourse_processor::MODE_CREATE_NEW:
@@ -631,11 +636,6 @@ class tool_uploadcourse_course {
$this->do = self::DO_CREATE;
}
// Course start date.
if (!empty($coursedata['startdate'])) {
$coursedata['startdate'] = strtotime($coursedata['startdate']);
}
// Add role renaming.
$errors = array();
$rolenames = tool_uploadcourse_helper::get_role_names($this->rawdata, $errors);
@@ -420,7 +420,7 @@ class tool_uploadcourse_course_testcase extends advanced_testcase {
'fullname' => 'Fullname',
'category' => '1',
'visible' => '0',
'startdate' => '8 June 1990',
'startdate' => 644803200,
'idnumber' => '123abc',
'summary' => 'Summary',
'format' => 'weeks',
@@ -447,7 +447,7 @@ class tool_uploadcourse_course_testcase extends advanced_testcase {
$this->assertEquals($defaultdata['fullname'], $course->fullname);
$this->assertEquals($defaultdata['category'], $course->category);
$this->assertEquals($defaultdata['visible'], $course->visible);
$this->assertEquals(mktime(0, 0, 0, 6, 8, 1990), $course->startdate);
$this->assertEquals($defaultdata['startdate'], $course->startdate);
$this->assertEquals($defaultdata['idnumber'], $course->idnumber);
$this->assertEquals($defaultdata['summary'], $course->summary);
$this->assertEquals($defaultdata['format'], $course->format);
@@ -473,7 +473,7 @@ class tool_uploadcourse_course_testcase extends advanced_testcase {
'fullname' => 'Fullname 2',
'category' => $cat->id,
'visible' => '1',
'startdate' => '11 June 1984',
'startdate' => 455760000,
'idnumber' => 'changedid',
'summary' => 'Summary 2',
'format' => 'topics',
@@ -500,7 +500,7 @@ class tool_uploadcourse_course_testcase extends advanced_testcase {
$this->assertEquals($defaultdata['fullname'], $course->fullname);
$this->assertEquals($defaultdata['category'], $course->category);
$this->assertEquals($defaultdata['visible'], $course->visible);
$this->assertEquals(mktime(0, 0, 0, 6, 11, 1984), $course->startdate);
$this->assertEquals($defaultdata['startdate'], $course->startdate);
$this->assertEquals($defaultdata['idnumber'], $course->idnumber);
$this->assertEquals($defaultdata['summary'], $course->summary);
$this->assertEquals($defaultdata['format'], $course->format);
+3
View File
@@ -52,5 +52,8 @@ function xmldb_auth_cas_upgrade($oldversion) {
// Moodle v3.0.0 release upgrade line.
// Put any upgrade step following this.
// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+26 -11
View File
@@ -302,20 +302,27 @@ class auth_plugin_db extends auth_plugin_base {
// Find obsolete users.
if (count($userlist)) {
list($notin_sql, $params) = $DB->get_in_or_equal($userlist, SQL_PARAMS_NAMED, 'u', false);
$params['authtype'] = $this->authtype;
$sql = "SELECT u.*
$remove_users = array();
// All the drivers can cope with chunks of 10,000. See line 4491 of lib/dml/tests/dml_est.php
$userlistchunks = array_chunk($userlist , 10000);
foreach($userlistchunks as $userlistchunk) {
list($notin_sql, $params) = $DB->get_in_or_equal($userlistchunk, SQL_PARAMS_NAMED, 'u', false);
$params['authtype'] = $this->authtype;
$sql = "SELECT u.id, u.username
FROM {user} u
WHERE u.auth=:authtype AND u.deleted=0 AND u.mnethostid=:mnethostid $suspendselect AND u.username $notin_sql";
$params['mnethostid'] = $CFG->mnet_localhost_id;
$remove_users = $remove_users + $DB->get_records_sql($sql, $params);
}
} else {
$sql = "SELECT u.*
$sql = "SELECT u.id, u.username
FROM {user} u
WHERE u.auth=:authtype AND u.deleted=0 AND u.mnethostid=:mnethostid $suspendselect";
$params = array();
$params['authtype'] = $this->authtype;
$params['mnethostid'] = $CFG->mnet_localhost_id;
$remove_users = $DB->get_records_sql($sql, $params);
}
$params['mnethostid'] = $CFG->mnet_localhost_id;
$remove_users = $DB->get_records_sql($sql, $params);
if (!empty($remove_users)) {
$trace->output(get_string('auth_dbuserstoremove','auth_db', count($remove_users)));
@@ -358,12 +365,20 @@ class auth_plugin_db extends auth_plugin_base {
// Only go ahead if we actually have fields to update locally.
if (!empty($updatekeys)) {
list($in_sql, $params) = $DB->get_in_or_equal($userlist, SQL_PARAMS_NAMED, 'u', true);
$params['authtype'] = $this->authtype;
$sql = "SELECT u.id, u.username
$update_users = array();
// All the drivers can cope with chunks of 10,000. See line 4491 of lib/dml/tests/dml_est.php
$userlistchunks = array_chunk($userlist , 10000);
foreach($userlistchunks as $userlistchunk) {
list($in_sql, $params) = $DB->get_in_or_equal($userlistchunk, SQL_PARAMS_NAMED, 'u', true);
$params['authtype'] = $this->authtype;
$params['mnethostid'] = $CFG->mnet_localhost_id;
$sql = "SELECT u.id, u.username
FROM {user} u
WHERE u.auth=:authtype AND u.deleted=0 AND u.username {$in_sql}";
if ($update_users = $DB->get_records_sql($sql, $params)) {
WHERE u.auth = :authtype AND u.deleted = 0 AND u.mnethostid = :mnethostid AND u.username {$in_sql}";
$update_users = $update_users + $DB->get_records_sql($sql, $params);
}
if ($update_users) {
$trace->output("User entries to update: ".count($update_users));
foreach ($update_users as $user) {
+1 -1
View File
@@ -1771,7 +1771,7 @@ class auth_plugin_ldap extends auth_plugin_base {
unset_cache_flag($this->pluginconfig.'/ntlmsess', $key);
// Redirection
if (user_not_fully_set_up($USER)) {
if (user_not_fully_set_up($USER, true)) {
$urltogo = $CFG->wwwroot.'/user/edit.php';
// We don't delete $SESSION->wantsurl yet, so we get there later
} else if (isset($SESSION->wantsurl) and (strpos($SESSION->wantsurl, $CFG->wwwroot) === 0)) {
+3
View File
@@ -52,5 +52,8 @@ function xmldb_auth_ldap_upgrade($oldversion) {
// Moodle v3.0.0 release upgrade line.
// Put any upgrade step following this.
// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+3
View File
@@ -40,5 +40,8 @@ function xmldb_auth_manual_upgrade($oldversion) {
// Moodle v3.0.0 release upgrade line.
// Put any upgrade step following this.
// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+1 -1
View File
@@ -263,7 +263,7 @@ class auth_plugin_mnet extends auth_plugin_base {
exit;
}
if (user_not_fully_set_up($remoteuser)) {
if (user_not_fully_set_up($remoteuser, false)) {
print_error('notenoughidpinfo', 'mnet');
exit;
}
+3
View File
@@ -40,5 +40,8 @@ function xmldb_auth_mnet_upgrade($oldversion) {
// Moodle v3.0.0 release upgrade line.
// Put any upgrade step following this.
// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+1 -1
View File
@@ -54,7 +54,7 @@
&& $user = authenticate_user_login($frm->username, $frm->password)) {
complete_user_login($user);
if (user_not_fully_set_up($USER)) {
if (user_not_fully_set_up($USER, true)) {
$urltogo = $CFG->wwwroot.'/user/edit.php?id='.$USER->id.'&amp;course='.SITEID;
// We don't delete $SESSION->wantsurl yet, so we get there later
+7 -2
View File
@@ -34,6 +34,10 @@ defined('MOODLE_INTERNAL') || die();
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
abstract class tree_node {
/** @var int Counter to be used in {@link tree_node::unique_sql_parameter()}. */
protected static $uniquesqlparametercounter = 1;
/**
* Determines whether this particular item is currently available
* according to the availability criteria.
@@ -242,10 +246,11 @@ abstract class tree_node {
* @return SQL code for the parameter, e.g. ':pr1234'
*/
protected static function unique_sql_parameter(array &$params, $value) {
static $count = 1;
// Note we intentionally do not use self:: here.
$count = tree_node::$uniquesqlparametercounter++;
$unique = 'usp' . $count;
$params[$unique] = $value;
$count++;
return ':' . $unique;
}
}
+57
View File
@@ -675,6 +675,63 @@ class tree_testcase extends \advanced_testcase {
json_encode(tree::get_root_json(array($child, $child), tree::OP_AND, array(true, false))));
}
/**
* Tests the behaviour of the counter in unique_sql_parameter().
*
* There was a problem with static counters used to implement a sequence of
* parameter placeholders (MDL-53481). As always with static variables, it
* is a bit tricky to unit test the behaviour reliably as it depends on the
* actual tests executed and also their order.
*
* To minimise risk of false expected behaviour, this test method should be
* first one where {@link core_availability\tree::get_user_list_sql()} is
* used. We also use higher number of condition instances to increase the
* risk of the counter collision, should there remain a problem.
*/
public function test_unique_sql_parameter_behaviour() {
global $DB;
$this->resetAfterTest();
$generator = $this->getDataGenerator();
// Create a test course with multiple groupings and groups and a student in each of them.
$course = $generator->create_course();
$user = $generator->create_user();
$studentroleid = $DB->get_field('role', 'id', array('shortname' => 'student'));
$generator->enrol_user($user->id, $course->id, $studentroleid);
// The total number of groupings and groups must not be greater than 61.
// There is a limit in MySQL on the max number of joined tables.
$groups = [];
for ($i = 0; $i < 25; $i++) {
$group = $generator->create_group(array('courseid' => $course->id));
groups_add_member($group, $user);
$groups[] = $group;
}
$groupings = [];
for ($i = 0; $i < 25; $i++) {
$groupings[] = $generator->create_grouping(array('courseid' => $course->id));
}
foreach ($groupings as $grouping) {
foreach ($groups as $group) {
groups_assign_grouping($grouping->id, $group->id);
}
}
$info = new \core_availability\mock_info($course);
// Make a huge tree with 'AND' of all groups and groupings conditions.
$conditions = [];
foreach ($groups as $group) {
$conditions[] = \availability_group\condition::get_json($group->id);
}
foreach ($groupings as $groupingid) {
$conditions[] = \availability_grouping\condition::get_json($grouping->id);
}
shuffle($conditions);
$tree = new tree(tree::get_root_json($conditions));
list($sql, $params) = $tree->get_user_list_sql(false, $info, false);
// This must not throw exception.
$DB->fix_sql_params($sql, $params);
}
/**
* Tests get_user_list_sql.
*/
+1 -1
View File
@@ -381,7 +381,7 @@ class cc2moodle {
if (!empty($format['defaultblocks'])) {
$blocknames = $format['defaultblocks'];
} else {
if (!empty($CFG->defaultblocks)) {
if (isset($CFG->defaultblocks)) {
$blocknames = $CFG->defaultblocks;
} else {
$blocknames = 'participants,activity_modules,search_forums,course_list:news_items,calendar_upcoming,recent_activity';
-1
View File
@@ -145,7 +145,6 @@ if ($backup->get_stage() == backup_ui::STAGE_FINAL) {
if (!empty($precheckresults['errors'])) { // If errors are found, terminate the import.
fulldelete($tempdestination);
echo $OUTPUT->header();
echo $renderer->precheck_notices($precheckresults);
echo $OUTPUT->continue_button(new moodle_url('/course/view.php', array('id'=>$course->id)));
echo $OUTPUT->footer();
+8 -4
View File
@@ -950,8 +950,11 @@ class backup_gradebook_structure_step extends backup_structure_step {
$grade_setting = new backup_nested_element('grade_setting', 'id', array(
'name', 'value'));
$gradebook_attributes = new backup_nested_element('attributes', null, array('calculations_freeze'));
// Build the tree
$gradebook->add_child($gradebook_attributes);
$gradebook->add_child($grade_categories);
$grade_categories->add_child($grade_category);
@@ -966,14 +969,15 @@ class backup_gradebook_structure_step extends backup_structure_step {
$gradebook->add_child($grade_settings);
$grade_settings->add_child($grade_setting);
// Define sources
// Add attribute with gradebook calculation freeze date if needed.
$attributes = new stdClass();
$gradebookcalculationfreeze = get_config('core', 'gradebook_calculations_freeze_' . $this->get_courseid());
if ($gradebookcalculationfreeze) {
$gradebook->add_attributes(array('calculations_freeze'));
$gradebook->get_attribute('calculations_freeze')->set_value($gradebookcalculationfreeze);
$attributes->calculations_freeze = $gradebookcalculationfreeze;
}
// Define sources
$gradebook_attributes->set_source_array([$attributes]);
//Include manual, category and the course grade item
$grade_items_sql ="SELECT * FROM {grade_items}
@@ -181,7 +181,7 @@ abstract class restore_qtype_plugin extends restore_plugin {
$info = new stdClass();
$info->filequestionid = $oldquestionid;
$info->dbquestionid = $newquestionid;
$info->answer = $data->answertext;
$info->answer = s($data->answertext);
throw new restore_step_exception('error_question_answers_missing_in_db', $info);
}
$newitemid = $this->questionanswercache[$data->answertext];
+96 -2
View File
@@ -121,6 +121,21 @@ class restore_gradebook_structure_step extends restore_structure_step {
return false;
}
// Identify the backup we're dealing with.
$backuprelease = floatval($this->get_task()->get_info()->backup_release); // The major version: 2.9, 3.0, ...
$backupbuild = 0;
preg_match('/(\d{8})/', $this->get_task()->get_info()->moodle_release, $matches);
if (!empty($matches[1])) {
$backupbuild = (int) $matches[1]; // The date of Moodle build at the time of the backup.
}
// On older versions the freeze value has to be converted.
// We do this from here as it is happening right before the file is read.
// This only targets the backup files that can contain the legacy freeze.
if ($backupbuild > 20150618 && ($backuprelease < 3.0 || $backupbuild < 20160527)) {
$this->rewrite_step_backup_file_for_legacy_freeze($fullpath);
}
// Arrived here, execute the step
return true;
}
@@ -129,7 +144,7 @@ class restore_gradebook_structure_step extends restore_structure_step {
$paths = array();
$userinfo = $this->task->get_setting_value('users');
$paths[] = new restore_path_element('gradebook', '/gradebook');
$paths[] = new restore_path_element('attributes', '/gradebook/attributes');
$paths[] = new restore_path_element('grade_category', '/gradebook/grade_categories/grade_category');
$paths[] = new restore_path_element('grade_item', '/gradebook/grade_items/grade_item');
if ($userinfo) {
@@ -141,7 +156,7 @@ class restore_gradebook_structure_step extends restore_structure_step {
return $paths;
}
protected function process_gradebook($data) {
protected function process_attributes($data) {
// For non-merge restore types:
// Unset 'gradebook_calculations_freeze_' in the course and replace with the one from the backup.
$target = $this->get_task()->get_target();
@@ -581,6 +596,85 @@ class restore_gradebook_structure_step extends restore_structure_step {
}
}
}
/**
* Rewrite step definition to handle the legacy freeze attribute.
*
* In previous backups the calculations_freeze property was stored as an attribute of the
* top level node <gradebook>. The backup API, however, do not process grandparent nodes.
* It only processes definitive children, and their parent attributes.
*
* We had:
*
* <gradebook calculations_freeze="20160511">
* <grade_categories>
* <grade_category id="10">
* <depth>1</depth>
* ...
* </grade_category>
* </grade_categories>
* ...
* </gradebook>
*
* And this method will convert it to:
*
* <gradebook >
* <attributes>
* <calculations_freeze>20160511</calculations_freeze>
* </attributes>
* <grade_categories>
* <grade_category id="10">
* <depth>1</depth>
* ...
* </grade_category>
* </grade_categories>
* ...
* </gradebook>
*
* Note that we cannot just load the XML file in memory as it could potentially be huge.
* We can also completely ignore if the node <attributes> is already in the backup
* file as it never existed before.
*
* @param string $filepath The absolute path to the XML file.
* @return void
*/
protected function rewrite_step_backup_file_for_legacy_freeze($filepath) {
$foundnode = false;
$newfile = make_request_directory(true) . DIRECTORY_SEPARATOR . 'file.xml';
$fr = fopen($filepath, 'r');
$fw = fopen($newfile, 'w');
if ($fr && $fw) {
while (($line = fgets($fr, 4096)) !== false) {
if (!$foundnode && strpos($line, '<gradebook ') === 0) {
$foundnode = true;
$matches = array();
$pattern = '@calculations_freeze=.([0-9]+).@';
if (preg_match($pattern, $line, $matches)) {
$freeze = $matches[1];
$line = preg_replace($pattern, '', $line);
$line .= " <attributes>\n <calculations_freeze>$freeze</calculations_freeze>\n </attributes>\n";
}
}
fputs($fw, $line);
}
if (!feof($fr)) {
throw new restore_step_exception('Error while attempting to rewrite the gradebook step file.');
}
fclose($fr);
fclose($fw);
if (!rename($newfile, $filepath)) {
throw new restore_step_exception('Error while attempting to rename the gradebook step file.');
}
} else {
if ($fr) {
fclose($fr);
}
if ($fw) {
fclose($fw);
}
}
}
}
/**
@@ -0,0 +1,10 @@
<gradebook >
<attributes>
<calculations_freeze>20160511</calculations_freeze>
</attributes>
<grade_categories>
<grade_category id="10">
<depth>1</depth>
</grade_category>
</grade_categories>
</gradebook>
@@ -0,0 +1,7 @@
<gradebook calculations_freeze="20160511">
<grade_categories>
<grade_category id="10">
<depth>1</depth>
</grade_category>
</grade_categories>
</gradebook>
@@ -0,0 +1,10 @@
<gradebook some_other_value="false" >
<attributes>
<calculations_freeze>20160511</calculations_freeze>
</attributes>
<grade_categories>
<grade_category id="10">
<depth>1</depth>
</grade_category>
</grade_categories>
</gradebook>
@@ -0,0 +1,7 @@
<gradebook some_other_value="false" calculations_freeze="20160511">
<grade_categories>
<grade_category id="10">
<depth>1</depth>
</grade_category>
</grade_categories>
</gradebook>
@@ -0,0 +1,10 @@
<gradebook some_other_value="false" and_another_value="42">
<attributes>
<calculations_freeze>20160511</calculations_freeze>
</attributes>
<grade_categories>
<grade_category id="10">
<depth>1</depth>
</grade_category>
</grade_categories>
</gradebook>
@@ -0,0 +1,7 @@
<gradebook some_other_value="false" calculations_freeze="20160511" and_another_value="42">
<grade_categories>
<grade_category id="10">
<depth>1</depth>
</grade_category>
</grade_categories>
</gradebook>
@@ -0,0 +1,7 @@
<gradebookplugin some_other_value="false" calculations_freeze="20160511" and_another_value="42">
<grade_categories>
<grade_category id="10">
<depth>1</depth>
</grade_category>
</grade_categories>
</gradebookplugin>
@@ -0,0 +1,7 @@
<gradebookplugin some_other_value="false" calculations_freeze="20160511" and_another_value="42">
<grade_categories>
<grade_category id="10">
<depth>1</depth>
</grade_category>
</grade_categories>
</gradebookplugin>
@@ -0,0 +1,92 @@
<?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/>.
/**
* Test for restore_stepslib.
*
* @package core_backup
* @copyright 2016 Andrew Nicols <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
global $CFG;
require_once($CFG->dirroot . '/backup/util/includes/backup_includes.php');
require_once($CFG->dirroot . '/backup/util/includes/restore_includes.php');
require_once($CFG->libdir . '/completionlib.php');
/**
* Test for restore_stepslib.
*
* @package core_backup
* @copyright 2016 Andrew Nicols <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class core_backup_restore_gradebook_structure_step_testcase extends advanced_testcase {
/**
* Provide tests for rewrite_step_backup_file_for_legacy_freeze based upon fixtures.
*
* @return array
*/
public function rewrite_step_backup_file_for_legacy_freeze_provider() {
$fixturesdir = realpath(__DIR__ . '/fixtures/rewrite_step_backup_file_for_legacy_freeze/');
$tests = [];
$iterator = new \RecursiveIteratorIterator(
new \RecursiveDirectoryIterator($fixturesdir),
\RecursiveIteratorIterator::LEAVES_ONLY);
foreach ($iterator as $sourcefile) {
$pattern = '/\.test$/';
if (!preg_match($pattern, $sourcefile)) {
continue;
}
$expectfile = preg_replace($pattern, '.expectation', $sourcefile);
$test = array($sourcefile, $expectfile);
$tests[basename($sourcefile)] = $test;
}
return $tests;
}
/**
* @dataProvider rewrite_step_backup_file_for_legacy_freeze_provider
* @param string $source The source file to test
* @param string $expected The expected result of the transformation
*/
public function test_rewrite_step_backup_file_for_legacy_freeze($source, $expected) {
$restore = $this->getMockBuilder('\restore_gradebook_structure_step')
->setMethods(null)
->disableOriginalConstructor()
->getMock()
;
// Copy the file somewhere as the rewrite_step_backup_file_for_legacy_freeze will write the file.
$dir = make_request_directory(true);
$filepath = $dir . DIRECTORY_SEPARATOR . 'file.xml';
copy($source, $filepath);
$rc = new \ReflectionClass('\restore_gradebook_structure_step');
$rcm = $rc->getMethod('rewrite_step_backup_file_for_legacy_freeze');
$rcm->setAccessible(true);
$rcm->invoke($restore, $filepath);
// Check the result.
$this->assertFileEquals($expected, $filepath);
}
}
+6 -2
View File
@@ -93,7 +93,9 @@ if ($action == 'choosebackupfile') {
// If it's some weird other kind of file then use old code.
$filename = restore_controller::get_tempdir_name($courseid, $USER->id);
$pathname = $tmpdir . '/' . $filename;
$fileinfo->copy_to_pathname($pathname);
if (!$fileinfo->copy_to_pathname($pathname)) {
throw new restore_ui_exception('errorcopyingbackupfile', null, $pathname);
}
$restore_url = new moodle_url('/backup/restore.php', array(
'contextid' => $contextid, 'filename' => $filename));
}
@@ -115,7 +117,9 @@ $data = $form->get_data();
if ($data && has_capability('moodle/restore:uploadfile', $context)) {
$filename = restore_controller::get_tempdir_name($courseid, $USER->id);
$pathname = $tmpdir . '/' . $filename;
$form->save_file('backupfile', $pathname);
if (!$form->save_file('backupfile', $pathname)) {
throw new restore_ui_exception('errorcopyingbackupfile', null, $pathname);
}
$restore_url = new moodle_url('/backup/restore.php', array('contextid'=>$contextid, 'filename'=>$filename));
redirect($restore_url);
die;
@@ -105,6 +105,12 @@ abstract class backup_controller_dbops extends backup_dbops {
throw new backup_dbops_exception('backup_controller_dbops_nonexisting');
}
$controller = unserialize(base64_decode($controllerrec->controller));
if (!is_object($controller)) {
// The controller field of the table did not contain a serialized object.
// It is made empty after it has been used successfully, it is likely that
// the user has pressed the browser back button at some point.
throw new backup_dbops_exception('backup_controller_dbops_loading_invalid_controller');
}
// Check checksum is ok. Sounds silly but it isn't ;-)
if (!$controller->is_checksum_correct($controllerrec->checksum)) {
throw new backup_dbops_exception('backup_controller_dbops_loading_checksum_mismatch');
@@ -95,6 +95,12 @@ abstract class restore_controller_dbops extends restore_dbops {
throw new backup_dbops_exception('restore_controller_dbops_nonexisting');
}
$controller = unserialize(base64_decode($controllerrec->controller));
if (!is_object($controller)) {
// The controller field of the table did not contain a serialized object.
// It is made empty after it has been used successfully, it is likely that
// the user has pressed the browser back button at some point.
throw new backup_dbops_exception('restore_controller_dbops_loading_invalid_controller');
}
// Check checksum is ok. Sounds silly but it isn't ;-)
if (!$controller->is_checksum_correct($controllerrec->checksum)) {
throw new backup_dbops_exception('restore_controller_dbops_loading_checksum_mismatch');
+1 -1
View File
@@ -795,7 +795,7 @@ abstract class restore_dbops {
// Prepare the query
list($stamp_sql, $stamp_params) = $DB->get_in_or_equal($stamps);
list($context_sql, $context_params) = $DB->get_in_or_equal($contexts);
$sql = "SELECT contextid
$sql = "SELECT DISTINCT contextid
FROM {question_categories}
WHERE stamp $stamp_sql
AND contextid $context_sql";
+2 -1
View File
@@ -95,7 +95,8 @@ class backup_logger_testcase extends basic_testcase {
$lo3 = new mock_base_logger3(backup::LOG_ERROR);
$lo1->set_next($lo2);
$lo2->set_next($lo3);
$this->assertFalse($lo1->process('test', backup::LOG_ERROR));
$msg = 13;
$this->assertFalse($lo1->process($msg, backup::LOG_ERROR));
// Test checksum correct
$lo1 = new mock_base_logger1(backup::LOG_ERROR);
+4 -2
View File
@@ -231,9 +231,11 @@ class restore_ui extends base_ui {
* Delete course which is created by restore process
*/
public function cleanup() {
global $DB;
$courseid = $this->controller->get_courseid();
if ($this->is_temporary_course_created($courseid)) {
delete_course($courseid, false);
if ($this->is_temporary_course_created($courseid) && $course = $DB->get_record('course', array('id' => $courseid))) {
$course->deletesource = 'restore';
delete_course($course, false);
}
}
+1 -1
View File
@@ -48,7 +48,7 @@ class award_criteria_activity extends award_criteria {
$this->course = $DB->get_record_sql('SELECT c.id, c.enablecompletion, c.cacherev, c.startdate
FROM {badge} b INNER JOIN {course} c ON b.courseid = c.id
WHERE b.id = :badgeid ', array('badgeid' => $this->badgeid));
WHERE b.id = :badgeid ', array('badgeid' => $this->badgeid), MUST_EXIST);
$this->courseid = $this->course->id;
}
+2 -2
View File
@@ -50,7 +50,7 @@ class award_criteria_course extends award_criteria {
$this->course = $DB->get_record_sql('SELECT c.id, c.enablecompletion, c.cacherev, c.startdate
FROM {badge} b INNER JOIN {course} c ON b.courseid = c.id
WHERE b.id = :badgeid ', array('badgeid' => $this->badgeid));
WHERE b.id = :badgeid ', array('badgeid' => $this->badgeid), MUST_EXIST);
$this->courseid = $this->course->id;
}
@@ -95,7 +95,7 @@ class award_criteria_course extends award_criteria {
* @return string
*/
public function get_details($short = '') {
global $DB;
global $DB, $OUTPUT;
$param = reset($this->params);
$course = $DB->get_record('course', array('id' => $param['course']));

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