Compare commits

...

675 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7) 0ec02c2a67 Moodle release 3.9.10 2021-09-12 12:37:18 +02:00
Eloy Lafuente (stronk7) 8a709503ac weekly release 3.9.9+ 2021-09-11 12:12:28 +02:00
Eloy Lafuente (stronk7) 2c7f5745c6 Merge branch 'install_39_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_39_STABLE 2021-09-11 12:12:27 +02:00
Shamim Rezaie 9a18af46d7 MDL-71240 filter_tex: Add allowlist for filter_tex_sanitize_formula 2021-09-10 18:10:52 +02:00
Jun Pataleta e09160b6db Merge branch 'MDL-72494_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2021-09-10 23:09:22 +08:00
Mikel Martín 884a9b9706 MDL-72494 theme_boost: Use 'scroll-margin-top' for anchor links
Current anchor link offset fix is not working with 'display:flex' elements

Note this is a backport of MDL-71152 exclusively to 39_STABLE because
the original issue already has been applied to 310, 311 and master.

And seems to workaround a bug in Chrome 93 that is hitting Moodle.
2021-09-10 15:31:26 +02:00
AMOS bot 753b2fb53e Automatically generated installer lang files 2021-09-09 00:07:41 +00:00
AMOS bot 7806835569 Automatically generated installer lang files 2021-09-07 00:07:43 +00:00
Paul Holden a937101b06 MDL-71726 course: respect user access when exporting participants.
We should ensure that users being exported are enrolled on the
course being exported from. In courses where the current user can't
access all groups we should ensure that users being exported belong
to the same groups as them.
2021-09-03 17:07:40 +02:00
Sujith Haridasan 8596b6a299 MDL-71160 auth_db: Use strict comaprison
Use strict comparison to avoid type juggling.

Signed-off-by: Sujith Haridasan <sujith@moodle.com>
2021-09-03 17:07:40 +02:00
Paul Holden b5c8188961 MDL-71976 auth_shibboleth: consistent session parsing during logout. 2021-09-03 17:07:40 +02:00
Shamim Rezaie ed3ee9dd5c MDL-71240 filter_tex: Sanitize the whole latex document
LaTeX documents have a preamble section and admins can use a \newcommand
statement to define new commands there (or to give an alias to another
command). This commit makes sure no blocked command can escape
sanitization by being used in a new seemingly harmless command that is
defined in the LaTeX preamble.
2021-09-03 17:07:40 +02:00
Shamim Rezaie 87aaffc3d1 MDL-71240 filter_tex: Support paranoid mode for openin_any in latex 2021-09-03 17:07:40 +02:00
Huong Nguyen 4fae57fc97 MDL-71797 quiz: Improve the checks when fetching user's attempts 2021-09-03 17:07:40 +02:00
Eloy Lafuente (stronk7) 9b9237fde1 Merge branch 'MDL-72478-39' of git://github.com/sarjona/moodle into MOODLE_39_STABLE 2021-09-03 17:03:32 +02:00
Sara Arjona 6f3450ef1e MDL-72478 calendar: Fix PHPUnit failure with offset
Before PHP 8.0.10, the time is lost when datetime->modify() is used
with weekdays. However, with PHP 8.0.10, the time is kept.
In consequence, the test_yearly_every_20th_monday_forever method
started failing.
For fixing it, the offset has been removed and the time has been set
to 00:00, so the behaviour will be the same regardless the PHP
version.
2021-09-03 09:35:11 +02:00
Sara Arjona 089f5bb0ec weekly release 3.9.9+ 2021-09-02 11:51:29 +02:00
Jun Pataleta 0391a4afc7 Merge branch 'MDL-72440_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2021-09-02 09:52:20 +08:00
Eloy Lafuente (stronk7) 0b26fce0b6 MDL-72440 js: reconcile npm installed stuff
When npm-shrinkwrap.json was regenerated few days ago by MDL-72014
running audit-fix on it, it seems that some checksums in the "lodash"
package were missing.

Now they are properly set and that's leading to npm-shrinkwrap.json
changes when people runs npm install (note npm ci is the recommended
way to install all the dev dependencies).

So, just reconcile the file to include the new checksums.
2021-08-31 11:22:16 +02:00
Andrew Nicols 361070ef5d weekly release 3.9.9+ 2021-08-27 12:00:30 +08:00
Andrew Nicols 81cb18a67c Merge branch 'install_39_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_39_STABLE 2021-08-27 12:00:29 +08:00
Heena Agheda f4b92ca799 MDL-72187 logstore: record log store's visibility change 2021-08-26 12:57:38 +08:00
sam marshall e563d32ca2 MDL-72152 Behat: No way to test key shortcuts with letter keys
Extends the existing step 'And I press the Shift Left key' so that
it supports letter/other keys: 'And I press the Ctrl C key'.
2021-08-26 11:37:27 +08:00
Andrew Nicols 2575add511 Merge branch 'MDL-72312_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2021-08-26 11:28:34 +08:00
AMOS bot 61b3c4b453 Automatically generated installer lang files 2021-08-26 00:07:45 +00:00
Andrew Nicols d82d2bd6d6 Merge branch 'MDL-72014_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2021-08-24 09:17:17 +08:00
Eloy Lafuente (stronk7) a7a8db38aa Merge branch 'MDL-71055-39' of git://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2021-08-23 23:22:51 +02:00
Eloy Lafuente (stronk7) a4e45e8159 MDL-72312 environment: Add new optional custom check for igbinary
This optional environmental check will look if:

- the site is running php72.
- the site has igbinary extension enabled.
- the igbinary extension version is a buggy one >=3.2.2 <= 3.2.4
- the bug is reproducible.

And will warn if all the conditions are met.
2021-08-23 15:50:18 +02:00
Eloy Lafuente (stronk7) 814c80da13 MDL-72312 GHA: Force use of igbinary working version
And also remove memcached and redis that have dependencies on it.

Versions 3.2.2 - 3.2.4 have a bug returning
arrays with index messed up. This affects
key() and next() operations when reading
information serialised with igbinary.

Notably Moodle's MUC uses igbinary when
available and was leading to some wrong
operations and test failures.

Once a fixed version is used by GHA this
can be reverted. See MDL-72399.

Note this only affects to php72, newer php
versions are not affected.
2021-08-23 15:49:59 +02:00
Andrew Nicols f7ffb41db4 MDL-71055 behat: Update core settings to use generator
These changes have only been applied to settings which were already
using settings names and values, but which were still using the UI.
2021-08-23 12:47:22 +08:00
AMOS bot c9efe1b1ac Automatically generated installer lang files 2021-08-18 00:07:41 +00:00
AMOS bot 82c845d8d3 Automatically generated installer lang files 2021-08-14 00:07:43 +00:00
Eloy Lafuente (stronk7) 30da75a460 MDL-72014 nodejs: audit fix to solve some security reports
Simply run npm audit fix that updates these main packages:

- xmldom 0.6.0
- grunt 1.4.1
- gherkin-lint 4.2.2

(and also a bunch of dependencies)
2021-08-12 20:07:10 +02:00
Ilya Tregubov fdb7aa8035 weekly release 3.9.9+ 2021-08-12 16:50:21 +02:00
Ilya Tregubov 4e14e2631c Merge branch 'install_39_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_39_STABLE 2021-08-12 16:50:20 +02:00
Eloy Lafuente (stronk7) 2ae147c9af Merge branch 'MDL-72265_39' of https://github.com/timhunt/moodle into MOODLE_39_STABLE 2021-08-12 00:06:21 +02:00
AMOS bot 6cacc0a4a3 Automatically generated installer lang files 2021-08-06 00:07:47 +00:00
Víctor Déniz c66c1a04b5 weekly release 3.9.9+ 2021-08-05 16:27:35 +01:00
Víctor Déniz 06001d9c9d Merge branch 'install_39_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_39_STABLE 2021-08-05 16:27:34 +01:00
Tim Hunt 9f01ded64e MDL-72265 backup: fix checking of override capabilites on restore
Thanks to Peter Dias <peter@moodle.com> for his help with the unit test.
2021-08-05 15:50:31 +01:00
Víctor Déniz 7bd088e443 Merge branch 'MDL-72262-39' of git://github.com/ilyatregubov/moodle into MOODLE_39_STABLE 2021-08-04 12:44:23 +01:00
Ilya Tregubov f67020d1c2 MDL-72262 behat: Make alias shorter to fix Oracle failures. 2021-08-02 08:26:50 +02:00
AMOS bot 2bc1e50886 Automatically generated installer lang files 2021-07-31 00:07:46 +00:00
Jun Pataleta a2fe75a270 Moodle release 3.9.9 2021-07-29 10:01:07 +08:00
Ilya Tregubov 6b632fef09 weekly release 3.9.8+ 2021-07-28 16:48:25 +02:00
Ilya Tregubov bc3e140d8b Merge branch 'install_39_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_39_STABLE 2021-07-28 16:48:25 +02:00
Jun Pataleta b53f12d8c9 Merge branch 'MDL-72203-39' of git://github.com/mickhawkins/moodle into MOODLE_39_STABLE 2021-07-28 11:27:48 +08:00
AMOS bot f9c700eb9f Automatically generated installer lang files 2021-07-28 00:07:44 +00:00
Michael Hawkins 0d3495e6b2 MDL-72203 curl: Improve redirect unit testing and update upgrade.txt
lib/upgrade.txt was updated to reflect the fact that all cURL redirects
will be emulated.
2021-07-27 23:27:02 +08:00
David Mudrák 72eac30148 MDL-72203 curl: Remove duplicate unit tests for emulated redirects
Before, we had each redirect test duplicated: one for the native
redirects via native cURL, second for our emulated implementation. Now
all redirects are always emulated so there is no need to have them
tested twice.
2021-07-27 23:22:21 +08:00
David Mudrák e19f451723 MDL-72203 curl: Check each URL in redirect chain to see if it is blocked
The security problem here was that only the first and the last URL in
the redirect chain was checked by the security helper. This patch forces
the curl wrapper to always emulate cURL redirects and check every
redirect URL in the chain before actually visiting it.
2021-07-27 23:22:21 +08:00
David Mudrák db0073291b MDL-72203 curl: Warn if someone actually started to use $maxredirects
The new parameter of curl_security_helper::url_is_blocked() introduced
in MDL-71916 became part of the API. Even if we reverted it quickly,
someone can use a released Moodle version that has that parameter in
place. For that reason and also to avoid potential troubles in the
future (e.g. when yet another argument would be added to this method),
we need to make it clear that the second parameter of this method should
never be used again.

Poor $maxredirects, you did not live long with us. Oh well.
2021-07-27 23:22:21 +08:00
David Mudrák 984e3fc510 MDL-72203 curl: Revert original fix of redirects to blocked URLs
This reverts the original fix introduced in MDL-71916. It introduced an
extra native cURL call inside curl_security_helper to check if the given
URL triggers a redirect to a blocked URL or not.

Shortly after the release, a couple of regressions were reported as a
result of the integrated solution. It was agreed to revert the fix and
progress with implementing an alternative approach.
2021-07-27 23:22:21 +08:00
Ilya Tregubov 698142b1f5 Merge branch 'MDL-72179-39' of git://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2021-07-27 12:39:02 +02:00
Andrew Nicols 8669b0ebb7 MDL-72179 behat: Make use of page resolvers 2021-07-24 18:56:38 +08:00
Andrew Nicols 2204ea8afe MDL-72179 behat: Add page resolvers for activity roles/perms 2021-07-23 20:44:26 +08:00
Andrew Nicols 142e12bee7 MDL-72179 behat: Add page resolver for activity names 2021-07-23 20:32:44 +08:00
Andrew Nicols 2bdebbf6e7 MDL-72179 behat: Add activity editing page resolution 2021-07-23 20:32:15 +08:00
Andrew Nicols f47ec5d0a9 MDL-72179 behat: Fix page resolvers to remove ambiguity
The simple pattern matches were conflicting in some situations. To make
this backwards compatable we need to convert it to a Regex pattern match
instead, and provide the quoted and unquoted variants.
2021-07-23 20:31:45 +08:00
Andrew Nicols 52da2d6eaa MDL-72179 behat: Correct course category page resolving
There were two issues here:
* I am on the [categoryname] category page page (duplicated page)
* the wrong URL was being used

Since an incorrect URL was used I felt it safe to rename the step from
'category page page' to 'category page'.
2021-07-23 20:28:15 +08:00
Andrew Nicols 78b0f6e204 MDL-72179 behat: Lowercase all page instance resolvers 2021-07-23 20:28:14 +08:00
Andrew Nicols 7030fa5972 MDL-72179 behat: Improve core page resolvers
This commit makes the following improvements to core page resolverss:
* allows for mixed case naming (course, Course, etc.)
* allows fields other than the idnumber to be specified:
** course: idnumber, shortname, fullname
** course category: idnumber, name

Whilst some of these fields are not unique, they will typically be
unique in most test scenarios. Where they are not then the idnumber
should be used in preference.
2021-07-23 20:28:10 +08:00
Ilya Tregubov 2bd53efc1b weekly release 3.9.8+ 2021-07-23 11:31:05 +02:00
Ilya Tregubov 9ccb3a2af9 Merge branch 'install_39_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_39_STABLE 2021-07-23 11:31:04 +02:00
AMOS bot 3354f46fd6 Automatically generated installer lang files 2021-07-22 00:07:52 +00:00
Ilya Tregubov 9fb1e3d300 Merge branch 'MDL-72125-39' of git://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2021-07-21 08:02:52 +02:00
Andrew Nicols e4b11bf852 MDL-72125 mod_assign: Use assign submission data generators 2021-07-21 07:37:59 +08:00
Andrew Nicols 28cf3f9119 MDL-72125 mod_assign: Add data generator for assign submissions 2021-07-20 21:38:47 +08:00
Andrew Nicols 1a885a1756 MDL-72125 testing: Make global $CFG available when including generators
This will remove the requirement to add the global $CFG call to the top
of generator scripts.
2021-07-20 21:38:47 +08:00
Andrew Nicols 753035e090 MDL-72125 behat: Add get_activity_id() behat generators helper 2021-07-20 21:38:46 +08:00
Andrew Nicols cb98541563 MDL-72125 testing: Set a default idnumber when creating activities
The activity generator currently requires an idnumber when creating
activities, but this is not a requirement when creating the same
activity through the UI. The requirement comes because we want to
provide a way to refer to activities in subsequent steps.

This commit modifies the behaviour such that the generator uses the name
of the activity as the default idnumber.

This has two  main benefits:
1. it simplfies generation of activities; and
2. it makes the language used when writing behat tests much more natural.

With this change, steps will refer to the activity by its idnumber/title
in all cases, rather than sometimes by an idnumber which bears no
relevance to the title.
2021-07-20 21:38:46 +08:00
Andrew Nicols 2729301721 MDL-72125 testing: Add helper to run generators as a user 2021-07-20 21:38:46 +08:00
abgreeve 54a2d7df22 weekly release 3.9.8+ 2021-07-16 10:16:44 +08:00
abgreeve 59f97a627f Merge branch 'install_39_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_39_STABLE 2021-07-16 10:16:43 +08:00
AMOS bot 362c67f84d Automatically generated installer lang files 2021-07-16 00:07:46 +00:00
Eloy Lafuente (stronk7) cbe5ec5a51 Merge branch 'MDL-72139-39' of git://github.com/cescobedo/moodle into MOODLE_39_STABLE 2021-07-14 14:50:10 +02:00
cescobedo 201eff4d98 MDL-72139 core_message: Fix encoding UTF-8 in prevent unclosed tags 2021-07-14 07:41:33 +02:00
Sara Arjona 22e52ebb55 Merge branch 'MDL-71782_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2021-07-13 16:44:53 +02:00
Jun Pataleta 493d3c218e Merge branch 'MDL-72036-39' of git://github.com/sarjona/moodle into MOODLE_39_STABLE 2021-07-13 16:04:57 +08:00
Sara Arjona 97ff875c83 MDL-72036 atto_h5p: Random error with external URL
After a major upgrade was done in h5p.com, some random errors appeared
in the "H5P options are ignored for H5P URLs" scenario.
They have been fixed replacing the URL for different (which should
load quicker). As we're checking external content, no other improvement
can be done on the Moodle site.
2021-07-13 08:37:57 +02:00
AMOS bot 8a5601722d Automatically generated installer lang files 2021-07-11 00:07:43 +00:00
Eloy Lafuente (stronk7) 68aa19ba73 Moodle release 3.9.8 2021-07-10 18:55:57 +02:00
Eloy Lafuente (stronk7) c8d12c3217 MDL-71782 behat: Ensure page after saving changes is there
A similar approach was followed @ MDL-67935, although the
case doesn't seem to be the same.

In any case, it's curious that all local execution are
100% passing and only CIs fail so often. Just guessing if,
maybe, there is some Chrome version factor around (we
are running older, sticky, versions @ CIs.
2021-07-10 15:51:07 +02:00
AMOS bot f9d08701fb Automatically generated installer lang files 2021-07-09 00:07:52 +00:00
Eloy Lafuente (stronk7) 324e1fbb78 weekly release 3.9.7+ 2021-07-08 23:44:00 +02:00
Eloy Lafuente (stronk7) b58a4e8da4 Merge branch 'install_39_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_39_STABLE 2021-07-08 23:43:58 +02:00
Jun Pataleta e7c0ddb942 Merge branch 'MDL-71919-39-fix' of https://github.com/cescobedo/moodle into MOODLE_39_STABLE 2021-07-08 23:34:54 +02:00
Jun Pataleta e9d63ac29c Merge branch 'MDL-70594_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2021-07-08 23:34:54 +02:00
cescobedo fce440eeed MDL-71919 core_message: Fix tests in message_send 2021-07-08 23:34:54 +02:00
Huong Nguyen 5fae2fc7a1 MDL-71922 file: Enhance endless recursion requests protection 2021-07-08 23:34:54 +02:00
cescobedo 913eb31830 MDL-71919 core_message: Fix unclosed html tags in email notification 2021-07-08 23:34:54 +02:00
Paul Holden 68fbcaf303 MDL-71957 auth_shibboleth: safer session retrieval during logout. 2021-07-08 23:34:54 +02:00
Dongsheng Cai 20403e0e43 MDL-71978 core_calendar: only allow owner to edit user subscriptions 2021-07-08 23:34:54 +02:00
Adrian Greeve 2740e06920 Merge branch 'MDL-71887-39' of https://github.com/snake/moodle into MOODLE_39_STABLE 2021-07-08 23:34:53 +02:00
Mihail Geshoski a84b51046a MDL-58393 core: Remove firstname argument from emailconfirmation string 2021-07-08 23:34:53 +02:00
Sujith Haridasan a19092e71c MDL-71241 course: Validate and sanitize sort arguments
Signed-off-by: Sujith Haridasan <sujith@moodle.com>
2021-07-08 23:34:39 +02:00
Mihail Geshoski b41a748a98 MDL-71242 core_course: Fix failing unit test 2021-07-08 23:34:39 +02:00
Mihail Geshoski cd96cb300e MDL-71242 core_course: Test the validation of the sort value
Adds new unit test, test_course_get_recent_courses_sort_validation(),
which is reponsible for testing the validation of the sort value in
course_get_recent_courses().
2021-07-08 23:34:39 +02:00
Mihail Geshoski e3c031023f MDL-71242 core_course: Update test_course_get_recent_courses() unit test
Adds additional assertions in test_course_get_recent_courses() test to
ensure that the sort funcionality works as expected.
2021-07-08 23:34:39 +02:00
Mihail Geshoski c5b4da7257 MDL-71242 core_course: Validate the value of the sort argument
This change validates the value of the sort argument in
course_get_recent_courses().
2021-07-08 23:34:26 +02:00
Claude Vervoort 7edc33a8ce MDL-71887 mod_lti: repost when no cookie due to crosssite request 2021-07-07 14:19:00 +08:00
Michael Hawkins 61e9318339 MDL-71916 lib: Check cURL redirects for blocked URLs before following 2021-07-06 23:45:24 +02:00
cescobedo f254b2b88f MDL-71917 core_message: Use $USER in WS delete_message_for_all_users 2021-07-06 13:32:08 +08:00
Paul Holden 264fe69743 MDL-71981 user: escape identity fields if writer supports HTML. 2021-07-06 09:29:44 +08:00
Paul Holden 80e2f8473e MDL-71981 dataformat: indicate HTML support in writer callback. 2021-07-06 09:29:44 +08:00
Eloy Lafuente (stronk7) b9b5f4b489 MDL-70594 environment: Apply agreed changes
- PostgreSQL 10 required.
- Exif PHP extension recommended.
2021-07-01 22:42:30 +02:00
Eloy Lafuente (stronk7) dc871f251e MDL-70594 environment: 4.0 base information
This is a direct copy of the 3.11 branch to have
the changes under control in next commits.
2021-07-01 22:42:30 +02:00
AMOS bot f972485484 Automatically generated installer lang files 2021-06-23 00:07:48 +00:00
AMOS bot 1f9488ccb5 Automatically generated installer lang files 2021-06-19 00:07:49 +00:00
Víctor Déniz 1d8512bc0e weekly release 3.9.7+ 2021-06-17 14:55:05 +01:00
Víctor Déniz b751583087 Merge branch 'install_39_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_39_STABLE 2021-06-17 14:55:04 +01:00
Andrew Nicols 94b897a176 Merge branch 'MDL-71939_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2021-06-16 13:14:34 +08:00
Jun Pataleta 4c6b771c2f MDL-71939 mod_h5pactivity: Increase window size during test
The addition of the activity information moves the h5p content down
out of the window view on Firefox which causes the Check button to be
unclickable. This patch increases the window size to ensure that the
check button is visible and clickable.

Credits to Eloy <stronk7@moodle.org> for the thorough investigation
of the root cause of this issue :)

This is a backport of MDL-71876 that is a backport of MDL-71337
2021-06-15 23:34:32 +02:00
Andrew Nicols b8122e1de3 Merge branch 'MDL-71804_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2021-06-15 11:28:45 +08:00
AMOS bot a9eae7edf4 Automatically generated installer lang files 2021-06-10 00:07:42 +00:00
Eloy Lafuente (stronk7) a7a9150b62 MDL-71804 travis: Bump to bionic 2021-05-29 10:26:34 +02:00
AMOS bot c283ed04e0 Automatically generated installer lang files 2021-05-29 00:07:42 +00:00
AMOS bot f65e706662 Automatically generated installer lang files 2021-05-27 00:07:43 +00:00
AMOS bot 49e1731fbe Automatically generated installer lang files 2021-05-24 00:07:43 +00:00
AMOS bot cd320b32b5 Automatically generated installer lang files 2021-05-23 00:07:40 +00:00
Sara Arjona 8dea153c6b weekly release 3.9.7+ 2021-05-20 11:09:11 +02:00
Sara Arjona ae9fea0b47 Merge branch 'install_39_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_39_STABLE 2021-05-20 11:09:10 +02:00
Jun Pataleta dc9258574d Merge branch 'MDL-71157-39' of git://github.com/sarjona/moodle into MOODLE_39_STABLE 2021-05-20 12:29:36 +08:00
Eloy Lafuente (stronk7) 5b94aaed06 Merge branch 'MDL-67935-39' of git://github.com/sarjona/moodle into MOODLE_39_STABLE 2021-05-19 22:50:53 +02:00
Sara Arjona a099c8d921 MDL-71157 block_myoverview: remove wait from behat
The step "And I wait until ".block_myoverview
[data-control='next']" "css_element" exists" is not correct
because this [data-control='next'] element exists before and
after the step so, in some cases, it might cause the following
step will start earlier than expected.
As pending JS has been added, this wait steps are not required
any more.
2021-05-19 12:38:28 +02:00
Andrew Nicols 36a3c41b8b MDL-71157 core: Pending JS in paged content bars 2021-05-19 12:38:27 +02:00
AMOS bot d7208f8dd0 Automatically generated installer lang files 2021-05-18 00:07:55 +00:00
Sara Arjona df9c7f755d MDL-67935 tool_lp: fix random errors with login/logout 2021-05-14 10:53:25 +02:00
AMOS bot a76583296b Automatically generated installer lang files 2021-05-14 00:07:50 +00:00
Sara Arjona b56affcfe6 weekly release 3.9.7+ 2021-05-11 12:42:36 +02:00
Sara Arjona 4799f8b7c4 Merge branch 'install_39_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_39_STABLE 2021-05-11 12:42:35 +02:00
AMOS bot 62758b8224 Automatically generated installer lang files 2021-05-11 00:07:51 +00:00
Víctor Déniz cf6aeae427 Merge branch 'MDL-71060-39' of https://github.com/NashTechOpenUniversity/moodle into MOODLE_39_STABLE 2021-05-10 23:43:30 +01:00
Thong Bui 8ea5b30a5d MDL-71060 Questions: Duplicates 'Current category' text. 2021-05-10 00:25:38 +07:00
Eloy Lafuente (stronk7) 270f52bf55 Moodle release 3.9.7 2021-05-08 16:40:39 +02:00
Eloy Lafuente (stronk7) 1affa30299 weekly release 3.9.6+ 2021-05-07 16:54:47 +02:00
Eloy Lafuente (stronk7) f61b2edde0 NOBUG: Fixed SVG browser compatibility 2021-05-07 16:54:46 +02:00
Eloy Lafuente (stronk7) d1b2674eea Merge branch 'install_39_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_39_STABLE 2021-05-07 16:54:46 +02:00
abgreeve 849f392f3b Merge branch 'MDL-68747-39' of https://github.com/dcai/moodle into MOODLE_39_STABLE 2021-05-07 11:46:50 +08:00
Mathew May 2c73122c60 MDL-70622 mod_lti: Tighten redirect param typing 2021-05-07 11:46:50 +08:00
Adam Olley 3b6104d6dc MDL-70622 mod_lti: Prevent xss on lti 1.3 authentication script
Without this, people can craft URLs that other users might use not realising
what they do - and as a XSS vulnerability, it could do any number of things the
clicking-user has access to do on the site.

Change-Id: I82adc71e8706d8929011b4b24523d5b62b8ccea1
2021-05-07 11:46:41 +08:00
Jun Pataleta be2eb84be9 Merge branch 'MDL-71395-39-2' of git://github.com/marinaglancy/moodle into MOODLE_39_STABLE 2021-05-07 10:30:52 +08:00
abgreeve 711b1a5ae9 Merge branch 'MDL-70181_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2021-05-07 10:22:50 +08:00
Víctor Déniz df136f7535 Merge branch 'MDL-71303-39' of https://github.com/StudiUM/moodle into MOODLE_39_STABLE 2021-05-06 23:34:49 +01:00
Eloy Lafuente (stronk7) 6c996b1570 Merge branch 'MDL-70049-39_count_submissions' of https://github.com/agrowe/moodle into MOODLE_39_STABLE 2021-05-06 23:27:31 +02:00
Eloy Lafuente (stronk7) f01179355c Merge branch 'MDL-70772-39' of git://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-05-06 23:20:20 +02:00
Eloy Lafuente (stronk7) 414102ed74 Merge branch 'MDL-71313_39' of https://github.com/timhunt/moodle into MOODLE_39_STABLE 2021-05-06 23:15:18 +02:00
Eloy Lafuente (stronk7) 24cd545eb8 Merge branch 'MDL-71343-m39' of https://github.com/rjnl/moodle into MOODLE_39_STABLE 2021-05-06 23:07:54 +02:00
Sara Arjona bcf349ed45 MDL-70110 mod_assign: make phpunit test DB order agnostic 2021-05-06 19:38:57 +02:00
Sara Arjona ae221af121 Merge branch 'MDL-71491-39' of git://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-05-06 18:42:41 +02:00
Marina Glancy 4f87b28436 MDL-71395 core: fix bug in google lib wrapper
because of changes in PHP8 the '' == 0 is no longer true and the error in the google api wrapper was discovered
2021-05-06 18:38:42 +02:00
Sara Arjona b3a66b1484 Merge branch 'MDL-71420_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2021-05-06 17:58:40 +02:00
Víctor Déniz 52b5aa5a18 Merge branch 'MDL-71402-39' of git://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-05-06 16:47:12 +01:00
Marina Glancy de6a44d7d0 MDL-71395 block_tag_youtube: sometimes exception may have empty message 2021-05-06 17:41:47 +02:00
Paul Holden 21941c6c2a MDL-71491 repository_flickr: return more file data.
See also 643b0cca.
2021-05-06 16:37:19 +01:00
Sara Arjona 54da1506a1 Merge branch 'MDL-71268-39' of git://github.com/lucaboesch/moodle into MOODLE_39_STABLE 2021-05-06 17:11:45 +02:00
Paul Holden 7f3a1dff28 MDL-71402 availability: fix group restriction button in mod form.
* The button to "Add group/grouping access restriction" under
   common module settings should only be present if corresponding
   availability plugins are enabled; and
 * Prevent the same button behaving as a submit button, which
   intercepted the user hitting return in the form and added a
   restriction without deliberate action taken by the user.
2021-05-06 14:20:29 +01:00
Sara Arjona 818182879a Merge branch 'MDL-70110-39' of https://github.com/septatrix/moodle into MOODLE_39_STABLE 2021-05-06 13:16:20 +02:00
Víctor Déniz e995073997 Merge branch 'MDL-71434-39' of git://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-05-06 11:15:29 +01:00
Sara Arjona bc47266a65 Merge branch 'MDL-71390-39' of git://github.com/marinaglancy/moodle into MOODLE_39_STABLE 2021-05-06 08:05:26 +02:00
Adrian Greeve 799e988f80 Merge branch 'MDL-70786-39' of git://github.com/lucaboesch/moodle into MOODLE_39_STABLE 2021-05-06 10:04:26 +08:00
AMOS bot 9bae0ce6a7 Automatically generated installer lang files 2021-05-06 00:07:53 +00:00
Eloy Lafuente (stronk7) d6a633d7a8 MDL-71420 environment: Lower sodium requirement to recommended 2021-05-05 23:06:22 +02:00
Sara Arjona 16dff14e56 Merge branch 'MDL-71517-39' of https://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-05-05 12:18:03 +02:00
Sara Arjona c0d26fff0d Merge branch 'MDL-71187-39' of git://github.com/lucaboesch/moodle into MOODLE_39_STABLE 2021-05-05 12:14:23 +02:00
Víctor Déniz 3698f34fc3 Merge branch 'MDL-71460-39' of git://github.com/peterRd/moodle into MOODLE_39_STABLE 2021-05-05 10:45:53 +01:00
Paul Holden e52ec9edd4 MDL-71517 mod_data: remove invalid form custom data access.
On PHP7.4, trying to access array offsets of NULL triggers a notice.
2021-05-05 10:18:18 +01:00
Luca Bösch 63b4929729 MDL-71187 quizaccess_seb: Change "Launch Safe Exam Browser" to a href.
In order to allow for correct seb:// or sebs:// calls without browser
warnings of insecure links, it is not possible to send a get request
with an attached cmid parameter to the unknown seb:// or sebs://
URL via a form button.
We've got to use a <a href> link outside a form to circumvent
browsers warning of an insecure link and call Safe Exam Browser
correctly.
2021-05-05 10:54:24 +02:00
Leon Stringer 3afbffe6a0 MDL-70181 database: Quote database object names
Table names and database name now enclosed in backticks.
admin/cli/mysql_collation.php failed if $CFG->prefix was blank with
MySQL 8.0 because table 'groups' conflicted with a new reserved word.

Note that this quotes both mysql_collation.php and mysql_compressed_rows.php
but only the former was mal-functioning.

The case of mysql_compressed_rows.php is a little bit special because
not all tables are processed, only those having big rows. And the groups
table is not one of them. In any case, better add the quotes there for
any future case.

Also, when testing this patch https://tracker.moodle.org/browse/MDL-71512
was discovered and will need to be fixed to make core 100% compliant
with MySQL 8.0 and MariaDB 10.6 and up.
2021-05-05 10:16:59 +02:00
Peter Dias 1dd574efd8 MDL-71460 hub: Use checkboxes instead of dropdowns
Change the yes/no dropdowns to a checkbox. Defaults to unchecked.
2021-05-05 10:28:02 +08:00
Víctor Déniz a426320c54 Merge branch 'MDL-70864-39-zip_packer_windows' of git://github.com/mudrd8mz/moodle into MOODLE_39_STABLE 2021-05-05 00:04:07 +01:00
Eloy Lafuente (stronk7) 3dea860e64 Merge branch 'MDL-71425-39-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_39_STABLE 2021-05-04 23:40:20 +02:00
Paul Holden 69f3e0753e MDL-71359 mod_forum: empty forums shouldn't export anything. 2021-05-04 17:23:49 +02:00
Sara Arjona 690bad040a MDL-71408 h5plib_v124: Add required changes after lib upgrade
- The mbstring extension is required since Moodle 3.9 onwards so
the upgrading steps have been removed because they are not
required any more.
- The pull-request for fixing some minor PHP7.4 problems has been
integrated so this patch is not required.
2021-05-04 17:23:49 +02:00
Sara Arjona 22c30c160e MDL-71408 h5plib_v124: Upgrade H5P core library to 1.24.02 2021-05-04 17:23:49 +02:00
Huong Nguyen b28b6066b4 MDL-70720 Quiz: Improve capability checks when fetching users' best grades 2021-05-04 17:23:49 +02:00
Shamim Rezaie c4e993d546 MDL-69028 repository: Put a rate limit on draft file uploads 2021-05-04 17:23:49 +02:00
Paul Holden 5b7d2a1992 MDL-71130 quiz_grading: escape user idnumber on display. 2021-05-04 17:23:49 +02:00
David Mudrák 23846c5450 MDL-70804 mnet: Use proper DML method to get records from the table
This improves the code and avoids the risk of SQL injection through the
malicious XML-RPC request from the MNet peer.
2021-05-04 17:23:49 +02:00
Sara Arjona b6d65c77cf Merge branch 'MDL-71274-39' of git://github.com/aanabit/moodle into MOODLE_39_STABLE 2021-05-04 17:10:55 +02:00
David Mudrák f77ec5e7fd MDL-71425 lang: Fix reworded strings in tests 2021-05-04 16:59:21 +02:00
Helen Foster 9031cf789d MDL-71425 lang: Import fixed English strings (en_fix) 2021-05-04 16:59:04 +02:00
Luca Bösch 010aa5ee16 MDL-70786 report_loglive: respect fullname setting. 2021-05-04 14:30:33 +02:00
Luca Bösch 2014c08636 MDL-70786 report_log: respect fullname setting. 2021-05-04 14:30:33 +02:00
Luca Bösch f5531458aa MDL-70786 report_completion: respect fullname setting. 2021-05-04 14:30:33 +02:00
Luca Bösch a6e2d950e7 MDL-70786 report_competency: respect fullname setting. 2021-05-04 14:30:33 +02:00
Luca Bösch dddc4cc410 MDL-70786 report_progress: respect fullname setting. 2021-05-04 14:30:33 +02:00
Luca Bösch 2e16fca0f1 MDL-71268 graphics: Use new Moodle logo for RSS feeds by Moodle 2021-05-04 14:14:10 +02:00
Sara Arjona 30d1832f45 weekly release 3.9.6+ 2021-05-04 13:27:53 +02:00
Sara Arjona 24c44b38be Merge branch 'install_39_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_39_STABLE 2021-05-04 13:27:52 +02:00
Adrian Greeve d848c604dd Merge branch 'MDL-66673-MOODLE_39_STABLE' of https://github.com/ScottVerbeek/moodle into MOODLE_39_STABLE 2021-05-04 15:47:08 +08:00
AMOS bot 9a4034f3bf Automatically generated installer lang files 2021-05-04 00:07:53 +00:00
Paul Holden 4c1d448b5b MDL-71463 dml: escape square brackets for SQL Server LIKE operator. 2021-05-03 19:01:24 +02:00
David Mudrák f92e83fe36 MDL-70864 files: Fix zip_packer extracting files with trailing dots
File and folder names cannot end with dots on Windows. So replace the
trailing dots with underscore consistently with how some other zip tools
(such as 7-zip) handle this case.
2021-05-03 18:15:44 +02:00
Marina Glancy d500b5c62d MDL-71390 core: raise max_input_vars requirement for Moodle 3.11 2021-05-03 13:29:52 +02:00
Adrian Greeve 65fad5f93f Merge branch 'MDL-71440-39' of git://github.com/mihailges/moodle into MOODLE_39_STABLE 2021-05-03 16:04:05 +08:00
Mihail Geshoski 7ea8dc7112 MDL-71440 mod_assign: New capability for viewing the submission summary
Creates a new capability mod/assign:viewownsubmissionsummary which will
be required in order to display the submission summary to the user in
the assignment page.
2021-05-03 15:33:55 +08:00
Jake Dallimore 276476233d Merge branch 'MDL-52724-39' of git://github.com/merrill-oakland/moodle into MOODLE_39_STABLE 2021-05-03 13:25:51 +08:00
Víctor Déniz a565c5d93d Merge branch 'MDL-69956-39' of https://github.com/dcai/moodle into MOODLE_39_STABLE 2021-05-01 13:43:55 +01:00
Víctor Déniz a72e1f1e0d weekly release 3.9.6+ 2021-04-30 12:54:26 +01:00
Rajneel Totaram 2d86d87012 MDL-71343 core_h5p: Convert all line-endings to UNIX format 2021-04-30 23:32:05 +12:00
Andrew Nicols 27ea958dfe MDL-71343 core_h5p: Add unit test for helper::parse_js_array
Signed-off-by: Rajneel Totaram <rjnlfj@yahoo.com>
2021-04-30 23:31:37 +12:00
Dongsheng Cai 2410df1fd2 MDL-69956 forum: throw exception when advanced grading is not ready 2021-04-30 14:59:42 +10:00
Adrian Greeve ccb1a3b39f Merge branch 'MDL-71481-39' of git://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-04-30 11:20:17 +08:00
Jun Pataleta ce2058c4c2 Merge branch 'MDL-70947-39' of git://github.com/HuongNV13/moodle into MOODLE_39_STABLE 2021-04-30 10:34:30 +08:00
Sara Arjona b7fb146cca Merge branch 'MDL-60331-39_take3' of git://github.com/lucaboesch/moodle into MOODLE_39_STABLE 2021-04-29 17:50:06 +02:00
Amaia Anabitarte 2695a394fe MDL-71274 analytics: Don't generate insight for hidden courses
Hidden courses can be used for training
but we do not want to generate insights for them
because students do not have access to hidden courses.
This was fixed in MDL-66806 for "Students at risk" model.
Fixed for "Students who have not accessed the course recently" in this issue.
2021-04-29 11:14:12 +02:00
Paul Holden 05e9ae07cd MDL-71481 repository_flickr_public: return more file data.
A HTTP HEAD request is required to get the image filesize.
The remaining data can be obtained from existing calls to
the Flickr API.
2021-04-29 09:49:24 +01:00
Sara Arjona c14603ecd1 Merge branch 'MDL-71016-39' of git://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-04-29 09:21:58 +02:00
Jun Pataleta 5d2d5bc542 Merge branch 'MDL-70863-39' of git://github.com/jleyva/moodle into MOODLE_39_STABLE 2021-04-29 15:05:22 +08:00
Andrew Nicols 3d92acac8a Merge branch 'MDL-56609_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2021-04-29 09:42:14 +08:00
Víctor Déniz ac115326f9 Merge branch 'MDL-71200-39' of git://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-04-28 20:57:59 +01:00
Paul Holden cb94a54412 MDL-71016 gradeexport_xml: ensure user/grade idnumbers are encoded. 2021-04-28 19:04:03 +01:00
Luca Bösch 0c2e30809a MDL-60331 questions: prevent double escaping question categories. 2021-04-28 17:59:59 +02:00
Sara Arjona a6c9132e73 Merge branch 'MDL-70979-39' of git://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-04-28 13:06:30 +02:00
Sara Arjona 323276969f Merge branch 'MDL-71127-39' of git://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-04-28 12:58:35 +02:00
Sara Arjona 18a99edcb9 Merge branch 'MDL-70763-39' of git://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-04-28 12:31:13 +02:00
Septatrix 9d6fff9671 MDL-70110 assign: add group submission attemptnumber test 2021-04-28 11:49:53 +02:00
Sara Arjona c4dad5b5e6 Merge branch 'MDL-71244-39' of git://github.com/lucaboesch/moodle into MOODLE_39_STABLE 2021-04-28 09:17:46 +02:00
Andrew Nicols 9c4204c96b Merge branch 'MDL-71168-39' of git://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-04-28 10:50:33 +08:00
Andrew Nicols 15da5ba48e MDL-70909 mod_h5pactivity: Whitespace fix 2021-04-28 10:34:00 +08:00
Andrew Nicols c7e65064b1 Merge branch 'MDL-70909-39' of git://github.com/ferranrecio/moodle into MOODLE_39_STABLE 2021-04-28 10:33:54 +08:00
Andrew Nicols 32702452e7 Merge branch 'MDL-71386-39' of git://github.com/NoelDeMartin/moodle into MOODLE_39_STABLE 2021-04-28 10:16:02 +08:00
Eloy Lafuente (stronk7) 2e1151bbb3 MDL-56609 phpunit: Fix bogus expectation on DST changes day
Current test works ok every day of the year but the day of
DST begin changes (last Sunday of March currently).

That day, 01:00 Europe/London simply doesn't exist, because
the time is moved forward by 60 minutes.

Hence the expectation for the next cron execution is not 1 "normal"
day (24h) but 1 less hour.

Note this only happens for the current test on DST begins, the
opposite change (DST ends), happening the last Sunday of October
is not affected, because, at all effects, 01:00 is a perfectly normal
and existing hour.
2021-04-27 18:31:05 +02:00
Luca Bösch 2e7cc5e17c MDL-71244 enrol_manual: Add bootstrap classes to buttons 2021-04-27 17:24:51 +02:00
Ferran Recio 513ac0c086 MDL-70909 mod_h5pactivity: fix reports on freeze context 2021-04-27 15:44:25 +02:00
Ferran Recio 9f7752d6bc MDL-70909 behat: context freeze and not freeze steps 2021-04-27 15:44:25 +02:00
Ferran Recio 79071cdd87 MDL-70909 core: add cannotmatchanyrows to capabilities join 2021-04-27 15:44:25 +02:00
Sara Arjona 69962f36d7 weekly release 3.9.6+ 2021-04-27 15:14:56 +02:00
Víctor Déniz 76ef9c5d1a Merge branch 'MDL-65687-39' of git://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-04-27 01:13:36 +01:00
Víctor Déniz b67b742e40 Merge branch 'MDL-71003-39' of git://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-04-27 00:38:48 +01:00
Sara Arjona eece2df651 Merge branch 'MDL-70917-39' of git://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-04-26 15:18:17 +02:00
Sara Arjona 61ef211525 Merge branch 'MDL-71416-39' of git://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-04-26 12:35:56 +02:00
Eloy Lafuente (stronk7) 535fcef31e Merge branch 'MDL-70446-m39' of https://github.com/sammarshallou/moodle into MOODLE_39_STABLE 2021-04-26 10:45:26 +02:00
Paul Holden 817757c088 MDL-71434 mod_data: add form control class to template textarea. 2021-04-25 18:35:05 +01:00
Tim Schroeder 054d5c0f04 MDL-70110 assign: fixed ws get_submissions for groups 2021-04-24 12:12:01 +02:00
Paul Holden adcd50bea0 MDL-71416 report_log: user context header should show users name.
Co-Authored-By: Luca Bösch <luca.boesch@bfh.ch>
2021-04-23 20:24:39 +01:00
Sara Arjona 3018a35249 weekly release 3.9.6+ 2021-04-23 10:47:01 +02:00
Jun Pataleta 1d217301ad Merge branch 'MDL-71171_39' of git://github.com/mdjnelson/moodle into MOODLE_39_STABLE 2021-04-23 12:40:29 +08:00
Mark Nelson 4dc6c7a79d MDL-71171 customfield_text: ensure we set defaults properly 2021-04-23 12:37:49 +08:00
Andrew Nicols 6d6a39e34d Merge branch 'MOODLE_39_STABLE-MDL-71376' of https://github.com/rjnl/moodle into MOODLE_39_STABLE 2021-04-23 11:53:36 +08:00
Andrew Nicols 1b169c82be Merge branch 'MDL-70970-39' of git://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-04-23 11:39:52 +08:00
ScottVerbeek 91376cdb69 MDL-66673 groups: Stop notice when messaging system is disabled 2021-04-23 08:55:09 +10:00
Sara Arjona 3f5477f8a0 Merge branch 'MDL-71136_39' of https://github.com/TomoTsuyuki/moodle into MOODLE_39_STABLE 2021-04-22 13:56:55 +02:00
Sara Arjona 2166e3e681 Merge branch 'MDL-71400-39' of git://github.com/mihailges/moodle into MOODLE_39_STABLE 2021-04-22 13:16:44 +02:00
Jun Pataleta 9e3b15f31e Merge branch 'MDL-71170_39' of git://github.com/mdjnelson/moodle into MOODLE_39_STABLE 2021-04-22 18:54:41 +08:00
Noel De Martin dfe187a59d MDL-71386 behat: Support for 3.9.5+ mobile app 2021-04-22 12:16:25 +02:00
Paul Holden 45725c2408 MDL-71200 mod_folder: ensure "Download folder" option is backed up. 2021-04-22 10:29:04 +01:00
Paul Holden 8aea2ef66b MDL-70979 search: validate external user search parameters.
Clean return value in unit test for same.
2021-04-22 10:23:10 +01:00
Mihail Geshoski f065061f08 MDL-71400 assignfeedback_offline: Fix message after worksheet upload 2021-04-22 13:08:59 +08:00
Jun Pataleta 92df285f49 Merge branch 'MDL-71156-39' of git://github.com/lameze/moodle into MOODLE_39_STABLE 2021-04-22 11:53:53 +08:00
Simey Lameze c72839d6d0 MDL-71156 core: machinery to recover orphaned calendar events
The machinery to fix orphaned calendar events that were broken by MDL-67494.

The solution consists of:

1) Upgrade step that checks if this site has executed the problematic upgrade steps and
   if positive, it will schedule a new run for calendar_fix_orphaned_events adhoc task.

2) Adhoc task that will self-spawn calling the recovery machinery, running until
   all the orphaned calendar events are fixed. It also sets the maximum runtime of
   60 seconds. It is also possible to override that number by specifing the desired
   number setting the ->calendareventsmaxseconds in your config.php

3) CLI script that will look for all the calendar events which userids
   where broken by a wrong upgrade step, affecting to Moodle 3.9.5
   and up.

   It performs checks to both:
     a) Detect if the site was affected (ran the wrong upgrade step).
     b) Look for orphaned calendar events, categorising them as:
       - standard: site / category / course / group / user events
       - subscription: events created via subscriptions.
       - action: normal action events, created to show common important dates.
       - override: user and group override events, particular, that some activities support.
       - custom: other events, not being any of the above, common or particular.

   By specifying it (--fix) try to recover as many broken events (missing userid) as
   possible. Standard, subscription, action, override events in core are fully supported but
   override or custom events should be fixed by each plugin as far as there isn't any standard
   API (plugin-wise) to launch a rebuild of the calendar events.

4) Unit tests and helper functions to generate calendar events. We have decided to
   keep the tests simple, testing only true and false and not using data generators because
   the code is purely to recover the calendar events and won't turn into an API or something
   and also due to the urgency of this issue.
   The helpers have been created in calendar/tests/helpers.php since there are no data generators
   for calendar.
2021-04-22 10:45:27 +08:00
Andrew Nicols f33b8bb576 Merge branch 'MDL-70412-39' of git://github.com/aanabit/moodle into MOODLE_39_STABLE 2021-04-22 10:07:40 +08:00
Sara Arjona 7ccf8f2fe4 Merge branch 'MDL-64336-m39' of https://github.com/NeillM/moodle into MOODLE_39_STABLE 2021-04-21 17:15:23 +02:00
Sara Arjona 0997a89e39 Merge branch 'MDL-62244_39_label_view' of https://github.com/sheesania/moodle into MOODLE_39_STABLE 2021-04-20 17:45:12 +02:00
Sara Arjona f63aed03b8 weekly release 3.9.6+ 2021-04-20 15:51:17 +02:00
Sara Arjona cf3215cff4 Merge branch 'install_39_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_39_STABLE 2021-04-20 15:51:16 +02:00
Paul Holden d26512cb63 MDL-70970 quizaccess_seb: consistent property array sorting by key.
In PHP8.0 using `ksort` was producing incorrect results by sorting
keys differing only in case in the wrong order. This change makes
sorting consistent between PHP versions.

Co-Authored-By: Tim Hunt <T.J.Hunt@open.ac.uk>
2021-04-20 14:36:22 +01:00
Rajneel Totaram b4ccc75a03 MDL-71376 mod_quiz: fix undefined object reference 2021-04-20 20:14:53 +12:00
Jun Pataleta 49f994fb03 Merge branch 'MDL-71364_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2021-04-20 09:23:14 +08:00
AMOS bot ebd1eb3726 Automatically generated installer lang files 2021-04-20 00:07:48 +00:00
Víctor Déniz 88d21b999c Merge branch 'MDL-71087-39' of https://github.com/NashTechOpenUniversity/moodle into MOODLE_39_STABLE 2021-04-19 23:45:29 +01:00
Eloy Lafuente (stronk7) 946cbedf54 Merge branch 'MDL-69256-39' of git://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2021-04-20 00:05:14 +02:00
Víctor Déniz 6ec958e639 Merge branch 'MOODLE_39_STABLE_fix_gradeimport_csv' of https://github.com/intrajp/moodle into MOODLE_39_STABLE 2021-04-19 22:49:51 +01:00
Dongsheng Cai 737682c750 MDL-68747 mod_quiz: force LTR for quiz grading overview chart 2021-04-19 21:06:31 +10:00
Sara Arjona 138e5b9996 Merge branch 'MDL-71365_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2021-04-19 10:18:46 +02:00
Paul Holden f3f7f28015 MDL-71127 mod_quiz: fix thrown exception for invalid question columns. 2021-04-19 09:07:24 +01:00
Paul Holden 2bada93f17 MDL-71168 report_participation: fix select all users checkbox. 2021-04-19 09:05:06 +01:00
Sara Arjona a5d64155ad Merge branch 'MDL-66475-39' of git://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-04-19 09:49:29 +02:00
Sara Arjona e511a7fdc4 Merge branch 'MDL-65553-39' of git://github.com/aanabit/moodle into MOODLE_39_STABLE 2021-04-19 08:53:51 +02:00
AMOS bot 767c610be1 Automatically generated installer lang files 2021-04-18 00:07:44 +00:00
Eloy Lafuente (stronk7) c0f4d9e170 MDL-71365 grunt: fix ignores missing LF @ EOF 2021-04-18 00:42:52 +02:00
Eloy Lafuente (stronk7) e4c7028c20 MDL-71364 behat: fix randomness causes by "now" advancing
Some recent tests do set a date time element
to ##now## or tomorrow and, immediately after that
the look if, effectively, ##now## and #tomorrow#
have been set (with minutes resolution).

Problem is that, between the field is set and the field
is verified, it can happen that the time advances to
next minute (from H:M:59 to H:M+1:00) and then the
assertion fails.

To avoid this, we could have lowered the resolution to be
hours... but that doesn't solve the problem just makes it
to happen less often.

So, instead of that... we are setting the 2 now and tomorrow
cases to be "today noon" and "tomorrow noon" (12:00:00) so
we ensure they won't be ever in the risk of jumping of minute.
2021-04-17 12:34:03 +02:00
Eloy Lafuente (stronk7) 375ec1c034 Merge branch 'MDL-70099-39' of git://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-04-17 09:40:45 +02:00
Sara Arjona 1c3b9af49a weekly release 3.9.6+ 2021-04-16 17:03:31 +02:00
Sara Arjona d4d2ef9119 Merge branch 'install_39_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_39_STABLE 2021-04-16 17:03:30 +02:00
Andrew Nicols fdcc9383b1 Merge branch 'MDL-60490-missing_close_div-39' of https://github.com/leonstr/moodle into MOODLE_39_STABLE 2021-04-16 11:55:01 +08:00
Andrew Nicols d1d57dc12d Merge branch 'MDL-69415-39' of git://github.com/sarjona/moodle into MOODLE_39_STABLE 2021-04-16 11:27:42 +08:00
Amaia Anabitarte 27a6bf394d MDL-70412 groups: Improving create_group data generator
Increasing the size of the name for generated groups
to ensure we don't have problems with ordering.
2021-04-15 16:57:23 +02:00
Amaia Anabitarte 5e4aab248f MDL-65553 core_analytics: Don't allow to flag predictions several times
Even if a prediction is hidden from the report once is flagged,
it can be flagged several times if the user visits detailed view via URL.
We remove the checkbox to select a prediction and flag it
once it has already been flagged.
2021-04-15 16:39:09 +02:00
Jake Dallimore c32142cf80 Merge branch 'MDL-71338-39' of git://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-04-15 14:43:28 +08:00
Jake Dallimore ea90581cb1 Merge branch 'MDL-71119-39' of git://github.com/sarjona/moodle into MOODLE_39_STABLE 2021-04-15 08:33:03 +08:00
AMOS bot 505366bed8 Automatically generated installer lang files 2021-04-15 00:07:59 +00:00
Paul Holden a6a5130a65 MDL-71338 tool_usertours: correct Content-Type on tour export.
Replace existing code with standard file serving mechanism, in
turn correcting the previously incorrect Content-Type header.
2021-04-14 21:12:03 +01:00
sam marshall a53238a07b MDL-70446 search_solr: File indexing can fail due to multipart upload
Due to Solr bug SOLR-15039, uploading files for indexing can fail if
it uses multipart upload. This changes it to use direct binary upload.

Unfortunately, the direct binary version in PHP curl only supports a
string, so we have to load the file into memory. I added extra code to
restrict the size of files indexed to (memory limit - 100MB), which is
usually 284MB unless configured differently because cron runs under
MEMORY_EXTRA.
2021-04-14 13:19:08 +01:00
Eloy Lafuente (stronk7) e085678bf2 Merge branch 'MDL-70616-39-fix' of https://github.com/izendegi/moodle into MOODLE_39_STABLE 2021-04-14 12:45:31 +02:00
Iñigo Zendegi ad3ac443a9 MDL-70616 gradingform_rubric: Filters not applied to rubric name 2021-04-14 11:48:58 +02:00
Sara Arjona 81da134c2c MDL-71119 core_badges: Add more information to errors
Some errors raised when calling external services were ignored.
Displaying this information helps to debug and find the real reasons
why some action, like connecting to an external backpack, can't be
done.
2021-04-14 11:04:28 +02:00
Sara Arjona dc4a36c3b1 MDL-71119 core_badges: Use basicauth and remove urlencode
Basic authorization header is required to get token. Besides, client
id and secret shouldn't call urlencode.
2021-04-14 11:04:28 +02:00
Sara Arjona 946120eeee MDL-71119 core_badges: Initialise scopes param in backpack-connect.php
The scopes parameter should be passed when creating the OAuth2 badges
client. As it is an optional parameter, when it's empty, it will
be initilised with the supported scopes for the backpack issuer.

It will happen, for instance, when a call is done to oauth2callback.php
because, as defined in RFC6749, OAuth2 authorization response only
supports code and state.
2021-04-14 11:04:28 +02:00
Paul Holden 82d35db47a MDL-70772 mod_forum: check for valid usernode before making active. 2021-04-14 09:20:26 +01:00
Andrew Nicols 83c3d04702 Merge branch 'MDL-71154_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2021-04-14 12:11:46 +08:00
AMOS bot 16736110d8 Automatically generated installer lang files 2021-04-14 00:07:53 +00:00
Eloy Lafuente (stronk7) 22f1a27aa3 MDL-71154 ci: Prevent upstream branches and tags to be built
Both for travis and GHA:

- master and MOODLE_XXX_STABLE branches
- any vX.Y.Z tag

won't lead to a build anymore.
2021-04-13 16:55:54 +02:00
Eloy Lafuente (stronk7) 30e6bf75dd weekly release 3.9.6+ 2021-04-13 10:26:35 +02:00
Eloy Lafuente (stronk7) 9c4a0b8490 Merge branch 'install_39_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_39_STABLE 2021-04-13 10:26:34 +02:00
Eloy Lafuente (stronk7) da03cf8972 Merge branch 'MDL-71059-39' of git://github.com/abias/moodle into MOODLE_39_STABLE 2021-04-13 00:42:42 +02:00
Tim Hunt 0b3e3d7c54 MDL-71313 repositories: warn if get_instances context is wrong type 2021-04-12 20:32:07 +01:00
Sara Arjona 1b8ced636c Merge branch 'MDL-68716-39' of git://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-04-12 17:24:52 +02:00
Sara Arjona 2c73fbfc3d Merge branch 'MDL-71264_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2021-04-12 16:40:25 +02:00
Sara Arjona 5e3c934691 Merge branch 'MDL-70595-39' of git://github.com/mickhawkins/moodle into MOODLE_39_STABLE 2021-04-12 16:01:49 +02:00
Sara Arjona df3efafbcf Merge branch 'MDL-71107-39' of git://github.com/aanabit/moodle into MOODLE_39_STABLE 2021-04-12 12:41:24 +02:00
Eloy Lafuente (stronk7) e2f2de4885 Merge branch 'MDL-69102-39' of https://github.com/martygilbert/moodle into MOODLE_39_STABLE 2021-04-12 00:02:14 +02:00
Eloy Lafuente (stronk7) 5279159083 MDL-69102 phpunit: Add test to cover ALL cohort criteria
That way we can check that the expectations are
working ok for every database. Previously only the
ANY case was being tested.

Also, convert them to course badges and check, via
review_all_criteria() that the SQL structures returned
by award_criteria_cohort->get_completed_criteria_sql()
doesn't fail and return the expected counters.
2021-04-10 12:37:52 -04:00
Issam Taboubi 8392586599 MDL-71303 core: HTML not escaped in block skip link 2021-04-09 17:34:25 -04:00
AMOS bot 26a0581c1b Automatically generated installer lang files 2021-04-09 00:07:54 +00:00
Eric Merrill 6037a3dde0 MDL-52724 editor_atto: Scrub atto html for invalid ol, ul, and li tags
Try to correct broken ul/ol/li tags, as they have an outsized impact
on course layout. Uses basic regex and loops to track open and closed
tags.

Also adds a deep clean option to the HTML cleaner, that runs less
frequent, more intensive cleanings. This is because normally _cleanHTML
gets called after each keystroke, which could cause problems with
large content on weak systems.

Behat changes are a fix for setting multiline strings in Atto, and
creating a multiline match step.
2021-04-08 15:37:24 -04:00
Eloy Lafuente (stronk7) 471d1a4b6d Merge branch 'MDL-70802-39' of git://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2021-04-08 18:38:58 +02:00
Víctor Déniz 3db93ec2a2 Merge branch 'MDL-71116-39' of git://github.com/sarjona/moodle into MOODLE_39_STABLE 2021-04-08 01:06:30 +01:00
Amaia Anabitarte ff6ac0b2fd MDL-71107 core_contentbank: Behat test. Authoring when copying a course 2021-04-07 10:03:37 +02:00
Amaia Anabitarte 57d5be04f8 MDL-71107 core_contentbank: Fill content author when copying a course
'usercreated' and 'usermodified' fields can not be always mapped.
We are filling those fields with 'old' users when working on the same
site, or with current user when working on a different instance.
2021-04-07 10:03:37 +02:00
Alex Rowe c9d3c97e74 MDL-70049 assign: count_submissions_need_grading call when can't grade 2021-04-07 08:56:10 +10:00
Eloy Lafuente (stronk7) a772325afc Merge branch 'MDL-70959-39' of git://github.com/junpataleta/moodle into MOODLE_39_STABLE 2021-04-06 22:29:58 +02:00
Eloy Lafuente (stronk7) 4c1c1aa6c6 Merge branch 'MDL-68635-39' of https://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-04-06 22:23:50 +02:00
Víctor Déniz 05e79651b6 Merge branch 'MDL-71128-39' of git://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-04-06 19:51:32 +01:00
Michael Hawkins a8c569c368 MDL-70595 core: Updated security.txt expiry 2021-04-06 13:14:01 +08:00
AMOS bot 12afd60ba2 Automatically generated installer lang files 2021-04-06 00:08:03 +00:00
Paul Holden c4fb2a2141 MDL-70099 enrol: increase accuracy of current enrolments by date.
By rounding the current time it was possible that the most recently
created user enrolments (e.g. self enrolments) were being excluded.

This would manifest itself in a user being enrolled on a course,
but it not appearing under "My courses" navigation or on their own
Dashboard until the rounded time had caught up with the current
time.
2021-04-05 19:32:07 +01:00
Paul Holden 97d63b6272 MDL-71003 user: fix alignment of autocomplete participant filters. 2021-04-04 23:21:33 +01:00
Paul Holden 39944aee16 MDL-70917 tool_behat: fix profile/replace option comparison.
The `isset` call always returned true for the 'replace' option,
because even if not specified it receives a non-null value. The
`strpos` call now does a strict equality check rather than
greater-than-or-equal (which always returns true).
2021-04-04 23:18:44 +01:00
Paul Holden 3284f1fe7e MDL-70763 core: export preferences for correct user.
Ensure we are using the ID of the given user rather than falling
back to that of the current user during privacy export.
2021-04-04 23:15:51 +01:00
Paul Holden a96ad13616 MDL-70763 quiz_overview: export preferences for correct user. 2021-04-04 23:15:51 +01:00
Paul Holden 3c872b34c6 MDL-70763 gradereport_grader: export preferences for correct user. 2021-04-04 23:15:51 +01:00
Paul Holden 4699142c9b MDL-66475 task: fix random timing failures in logger cleanup test. 2021-04-04 23:12:27 +01:00
AMOS bot 613e7f8a88 Automatically generated installer lang files 2021-04-04 00:08:01 +00:00
Eloy Lafuente (stronk7) b240173b66 MDL-71264 behat: Change date(time) element update order
This includes 2 change to the order date(time) elements are filled,
each one addressing one type of problem, where current order is
problematic and can lead to unexpected dates.

1) Changing date, when current month only has X days and target
   month has more than X days. Example, being 1 April, change
   the date to 31 May.
     This is solved by changing the order of introduction
     from current D => M => Y to Y => M => D.
2) Changing date, when target month only has X days and current
   month has more that X days. Example, being 31 March, change
   the date to 28 Feb.
     This is solved by always setting the D to 1, before the
     Y => M => D sequence commented @ 1) begins.
2021-04-03 18:09:47 +02:00
Eloy Lafuente (stronk7) 74730a2d63 MDL-71264 behat: New feature covering all day/month/year date changes
Because of the order that dates and datetimes are filled by behat
sometimes there are some intermediate results that are impossible
and then the form (javascript) automatically reacts and fixes the
date, ultimate leading to a different date that the one we wanted
to set with Behat.

This is noticeable when switching between months (with some day
being the last day of the month) and the 2 months have a different
number of days. For example April date => March date (or the opposite).

This test covers all the critical changes (day, month and year),
back and forth. All times are Perth/Australia.
2021-04-03 11:00:04 +02:00
Huong Nguyen 0273fc7731 MDL-70947 File upload: Upload protection
Interacts badly with double-submit protection, and not all uploads protected
2021-04-02 15:27:29 +07:00
AMOS bot eecb28b386 Automatically generated installer lang files 2021-04-02 00:07:46 +00:00
Marty Gilbert 88f81cf8d1 MDL-69102 badge: Fixes broken WHERE clause
When buildilng the 'WHERE' clause, the SQL generated
a query that selected any user who was a member of the
**last** group, not all of the groups.

I believe the query has to be re-worked so that it only
returns users who are in ALL of the groups. This can
be done by a GROUP BY and HAVING.
2021-04-01 14:51:27 -04:00
Alison Blomenberg fe177d5dec MDL-62244 Resource: label view redirects to label, not course 2021-04-01 11:53:53 -06:00
Leon Stringer d80644a986 MDL-60490 tool_lp: Missing div close
Mustache template had opening <div> with missing </div>.
2021-04-01 12:17:24 +01:00
AMOS bot bfe2779cea Automatically generated installer lang files 2021-04-01 00:07:48 +00:00
Juan Leyva 39916b12fd MDL-70863 mod_forum: Allow NULL in timecreated 2021-03-31 17:51:20 +02:00
Neill Magill b861c1dec7 MDL-64336 assign: Add missing PHP doc 2021-03-31 08:46:28 +01:00
Neill Magill 808a335c90 MDL-64336 assign: Teachers should be able to see all submissions
Before this change a teacher would be able to see users listed if:

* They have an active enrolment and can submit
* They have an an inactive enrolment for a role that can submit

After this change they will additonally be able to see users listed:

* That have an active enrolment and have submitted
* That have an inactive enrolment and have submitted

This means that if an assignment has it's context frozen all users
that have made some form of submission will still be listed.

It will also apply if the submission capability is removed from a
user.

If a user's enrolment is deleted they will not be listed.

The submission and grading counts have also been updated so
they will reflect the new rules.
2021-03-31 08:46:17 +01:00
Neill Magill 3b55f2847a MDL-64336 assign: Submissions should be visible while frozen
Before this change if a student visited an assignment that is
frozen they would only see the title and description even if
they had made a submission to it.

After the change they will be able to see the status of their
submission and any feedback and grades they have recived.

It will also make the Moodle app recognise that submission
should not happen because the assignment is frozen.

Tests based on ones created by Andrew Nicols
2021-03-31 08:46:06 +01:00
Víctor Déniz a2e4730a35 weekly release 3.9.6+ 2021-03-30 15:37:38 +01:00
Víctor Déniz 7c2b6ed44f Merge branch 'install_39_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_39_STABLE 2021-03-30 15:37:37 +01:00
Paul Holden 3c4d30bcf4 MDL-65687 message: increase confirmation dialog zindex.
Make sure that confirmation dialogs (such as block/unblock user,
delete conversation) are shown with prominence in the messaging
drawer.
2021-03-30 10:50:57 +01:00
Tomo Tsuyuki c34c6a75df MDL-71136 backup: Fix moodle_exception path. 2021-03-30 10:55:38 +11:00
Paul Holden 0464ae85ca MDL-68635 tool_cohortroles: observe user initial table filter. 2021-03-29 14:12:01 +01:00
Paul Holden 3211454a2a MDL-68716 mod_forum: extra column sorting options in privacy export.
Accounts for extra sort options that were added in bc23cbaf.
2021-03-29 14:05:27 +01:00
Eloy Lafuente (stronk7) 06bebd6820 Merge branch 'MDL-70963-39' of git://github.com/sarjona/moodle into MOODLE_39_STABLE 2021-03-29 12:40:07 +02:00
Andrew Nicols 3f0cc3d712 Merge branch 'MDL-71004_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2021-03-29 11:54:53 +08:00
AMOS bot f71bfc90b1 Automatically generated installer lang files 2021-03-29 00:07:45 +00:00
AMOS bot ae29d57085 Automatically generated installer lang files 2021-03-28 00:07:43 +00:00
Víctor Déniz a2cf272e00 Merge branch 'MDL-70537-m39' of https://github.com/sammarshallou/moodle into MOODLE_39_STABLE 2021-03-26 20:16:22 +00:00
Sara Arjona 4736877c43 MDL-70963 core_badges: Use expected JSON format for OBv2.1
This patch adds some changes to guarantee that OpenBadges 2.1 (OBv2.1)
will return always the same JSON format that OBv2.0 (because the only
difference between both versions it's the BadgeConnect API).
2021-03-26 09:02:41 +01:00
Shintaro Fujiwara aa6c15c975 MDL-69304 gradeimport_csv: Validate if the user id is numerical. 2021-03-26 04:26:51 +09:00
Víctor Déniz d7d8a654f3 Merge branch 'MDL-71194-39' of git://github.com/NoelDeMartin/moodle into MOODLE_39_STABLE 2021-03-25 15:15:26 +00:00
Noel De Martin 2794943d3c MDL-71194 behat: Fix app tests 2021-03-25 13:50:27 +01:00
Andrew Nicols 8c62673dc5 Merge branch 'MDL-70980-39' of git://github.com/ferranrecio/moodle into MOODLE_39_STABLE 2021-03-25 08:07:54 +08:00
AMOS bot f7a80e3f2b Automatically generated installer lang files 2021-03-25 00:07:53 +00:00
Eloy Lafuente (stronk7) 773e7cd612 Moodle release 3.9.6 2021-03-24 20:12:40 +01:00
Eloy Lafuente (stronk7) 8f23a60ba8 MDL-71004 git: Ignore moodle-plugin-ci.phar in any directory 2021-03-24 20:10:38 +01:00
Víctor Déniz ce059497ac weekly release 3.9.5+ 2021-03-24 14:20:57 +00:00
Eloy Lafuente (stronk7) 6c712c9caf Merge branch 'MDL-71182-39-2' of git://github.com/lameze/moodle into MOODLE_39_STABLE 2021-03-24 10:51:13 +01:00
Simey Lameze 6cfed9eebb MDL-71182 calendar: add logic for category events in get_context
This commit adds the missing logic for category events in
get_context() method. Without this fix, users will get errors
if they have category events with userid set to 0.
2021-03-24 17:35:09 +08:00
Andrew Nicols 2370d0c629 MDL-70802 javascript: Normalise component consistently in templates 2021-03-24 11:18:33 +08:00
Simey Lameze 7cae4c7570 MDL-71182 calendar: Revert "Merge branch 'MDL-67494-39' of git://github.com/lameze/moodle into MOODLE_39_STABLE"
This reverts commit c0c9be6d03, reversing
changes made to 226a690c0d.
2021-03-24 09:31:36 +08:00
Víctor Déniz 86f6671fe6 Merge branch 'MDL-71022-39' of git://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-03-23 23:02:22 +00:00
Thinh Pham 91a40ccce5 MDL-70727 Behat: function scrollIntoView not working in the app 2021-03-23 17:59:27 +00:00
Thinh Pham 20c93ebb6f MDL-71087 File picker: Focus lost after 'Create folder' 2021-03-23 10:44:25 +07:00
Andrew Nicols 62ee8fd5c8 Merge branch 'MDL-71039-39' of git://github.com/marinaglancy/moodle into MOODLE_39_STABLE 2021-03-23 11:18:52 +08:00
Andrew Nicols 35c6838f14 Merge branch 'MDL-69036-39' of git://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-03-23 09:56:57 +08:00
Andrew Nicols 596e7c7b0c Merge branch 'MDL-67870-39' of git://github.com/mihailges/moodle into MOODLE_39_STABLE 2021-03-23 09:25:04 +08:00
Andrew Nicols 1720bef450 MDL-69256 tests: Fix random slow test failures in completion cron 2021-03-23 08:08:37 +08:00
Mark Nelson c197d3f14b MDL-71170 customfield_text: use correct error string 2021-03-22 21:57:02 +08:00
Sara Arjona 42934afbed MDL-69415 core_h5p: prepend H5P libraries in autoloader
Core and mod_hvp are using the same namespace for some H5P
libraries. This is causing some random errors.
In order to get the expected behaviour in Moodle core, this patch
prepends H5P libraries in order to guarantee they are loaded first.
Plugins using same libraries will need to use a different namespace
if they overlap and a different version of these libraries should
be used.
2021-03-22 12:41:08 +01:00
Ferran Recio a97de58aa7 MDL-70980 mod_h5pactivity: fix review mode 2021-03-22 10:58:04 +01:00
Mihail Geshoski 47d87f7243 MDL-67870 backup: Skip value change if setting is locked by hierarchy
The given condition in the if statement did not take into account cases
when the setting is locked by hierarchy. Settings which are locked by
hierarchy should should keep their current values which were inherited
from the parent.
2021-03-22 15:33:57 +08:00
Chris Brown 56f849dcc6 MDL-71139 trademark: Improve the trademark messaging 2021-03-22 12:00:44 +08:00
Sara Arjona 3784dcc912 MDL-71116 core_badges: Backpack URLs with more than 50 chars
Backpack URLs (web and API) can have up to 255. However, the form
for creating/editing them, doesn't allow URLs with more than 50
characters. This patch align limitation to DB value (255).
2021-03-19 15:09:12 +01:00
Eloy Lafuente (stronk7) 2ad3d1a7f1 weekly release 3.9.5+ 2021-03-19 14:06:29 +01:00
Eloy Lafuente (stronk7) 3265a02f6c Merge branch 'install_39_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_39_STABLE 2021-03-19 14:06:28 +01:00
Jun Pataleta 6bc25f23fd MDL-70959 completion: Fix completion_info::get_data() unit tests
* Fixed inverted $sameuser test data.
* Fixed caching expectation check. Caching only relies on whether the
user accessing the completion data is the same user or not.
* Fixed checking for the caching of other modules. Should have been
checking cm ID and not instance ID.
* Additional test case when whole course parameter is passed as
true, but the requesting user is different from the target user.
2021-03-19 11:52:23 +08:00
Jun Pataleta 42631c3e34 MDL-70959 completion: Fix unit tests for get_data()
The unit tests for completion_info::get_data() does not make a lot of
sense with mocking being incorrectly used and the actual functionality
is not being properly tested. I have rewritten the test to use actual
cm_info instances and data providers for better coverage.
2021-03-19 11:52:23 +08:00
Jun Pataleta 4e75827d72 MDL-70959 completion: Documentation improvements
* Fix typo in $cm parameter's type in PHPDoc
* Improve the comment to better explain the logic why fetching the
completion data for the whole course can only be done when caching is
used.
Even if $wholecourse is set to true, there's no point in fetching the
completion data for all the course modules unless we're caching the
results.
2021-03-19 11:52:23 +08:00
sam marshall 6b06a36646 MDL-70537 Availability: Avoid recursive calls to $cm->name
These recursive calls didn't work in PHP 7.3 and below, but in PHP
7.4 they also cause a fatal error which means if you have invalid
availability data, the whole page might die.
2021-03-18 15:56:55 +00:00
sangnguyen bbf96cb595 MDL-70992 Folder: Unnecessary tab stops to the left of files 2021-03-18 12:24:23 +08:00
Adrian Greeve 918d45dfbd Merge branch 'MDL-70924-39' of git://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-03-18 11:51:20 +08:00
Adrian Greeve 35b29cf219 Merge branch 'MDL-71048-39' of https://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-03-18 11:08:55 +08:00
Adrian Greeve 6f5266c717 Merge branch 'MDL-70977-39' of git://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-03-18 10:26:16 +08:00
Adrian Greeve 841fd94499 Merge branch 'MDL-71068-protectusername-confirmed-MOODLE_39_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_39_STABLE 2021-03-18 09:26:13 +08:00
AMOS bot 3c8abccaaa Automatically generated installer lang files 2021-03-18 00:07:45 +00:00
Brendan Heywood 23cc13e8ef MDL-71068 login: Fix edge cases with $CFG->protectusernames 2021-03-17 17:40:01 +11:00
Paul Holden b665e5aa33 MDL-71128 mod_quiz: escape question idnumber on display. 2021-03-16 20:28:50 +00:00
Sara Arjona 5fc3b83497 Merge branch 'MDL-44613-integration-39' of git://github.com/mihailges/moodle into MOODLE_39_STABLE 2021-03-16 08:27:09 +01:00
Mihail Geshoski 56fdffa68e MDL-44613 mod_assign: Fix behat failure in classic
The link to the calendar page is missing in the navigation block in
classic which causes a behat failure in the 'Set availibility dates
for an assignment' feature. The fix includes adding the calendar block
to the Course page which can be used to navigate to the calendar page.
2021-03-16 11:57:26 +08:00
Adrian Greeve 2b442c2fb7 Merge branch 'MDL-70780-39' of git://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2021-03-16 11:26:22 +08:00
Sara Arjona 7215c71486 Merge branch 'MDL-44613-39-1' of git://github.com/mihailges/moodle into MOODLE_39_STABLE 2021-03-15 15:54:05 +01:00
Paul Holden 9b3a8f7bd1 MDL-70977 mod_forum: fix empty equality check updating post content.
Using the external method for updating posts, the check for empty
subject/message content wasn't correct (disallowed the string '0'),
in addition to being impossible to set a posts message format
property to FORMAT_MOODLE (integer 0).
2021-03-15 12:49:12 +00:00
Paul Holden 51b2acfae3 MDL-70924 course: ensure required fields present when getting courses. 2021-03-15 12:46:58 +00:00
Mihail Geshoski 5dbf93200a MDL-44613 mod_assign: Automate testing of the assignment availability 2021-03-15 20:05:25 +08:00
Mihail Geshoski 4b987e5f7a MDL-44613 tool_behat: Update datetime format usages to strftime
Updates all existing datetime format usages to strftime in the
'time to timestamp' transformation in tool_behat behat tests.
2021-03-15 20:05:25 +08:00
Mihail Geshoski 337704e555 MDL-44613 core_message: Update datetime format usages to strftime
Updates all existing datetime format usages to strftime in the
'time to timestamp' transformation in core_message behat tests.
2021-03-15 20:05:25 +08:00
Mihail Geshoski 9f01cf6122 MDL-44613 behat: strftime format in time to timestamp transformation
Modifies the 'string time to timestamp' behat trasformation to use
userdate() instead of date(). The userdate() method is generally used
throught Moodle for constructing formatted date strings and this change
will provide more consistency and prevent any potential behat failures.
Therefore, if the date format is defined in the given trasformation, it
has to be strftime compatible. Example:
'I should see "##tomorrow noon##%A, %d %B %Y, %I:%M %p##"'
2021-03-15 20:05:25 +08:00
Adrian Greeve 8872202049 Merge branch 'MDL-70306-39' of git://github.com/peterRd/moodle into MOODLE_39_STABLE 2021-03-15 11:13:47 +08:00
Peter Dias 855b9e504b MDL-70306 auth: Update the thirdpartylib.xml 2021-03-15 11:10:34 +08:00
AMOS bot f253fa7f7e Automatically generated installer lang files 2021-03-13 00:07:46 +00:00
Sara Arjona 8ee6f49384 weekly release 3.9.5+ 2021-03-11 17:18:47 +01:00
Sara Arjona f4f6534b40 Merge branch 'install_39_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_39_STABLE 2021-03-11 17:18:47 +01:00
Adrian Greeve 1d70790168 Merge branch 'MDL-66025-39' of git://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-03-11 11:38:07 +08:00
Adrian Greeve 17a5e73a9b Merge branch 'MDL-71026-39' of git://github.com/ilyatregubov/moodle into MOODLE_39_STABLE 2021-03-11 11:01:52 +08:00
Eloy Lafuente (stronk7) 5987bed350 Merge branch 'MDL-70726-3.9' of https://github.com/NashTechOpenUniversity/moodle into MOODLE_39_STABLE 2021-03-11 00:12:19 +01:00
Eloy Lafuente (stronk7) b6d0dec01e Merge branch 'MDL-70789-39' of git://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-03-10 23:50:22 +01:00
Eloy Lafuente (stronk7) c0d519b426 Merge branch 'MDL-70759_39' of https://github.com/ffhs/moodle into MOODLE_39_STABLE 2021-03-10 23:42:25 +01:00
Eloy Lafuente (stronk7) 05c66fcebd Merge branch 'MDL-70967-39' of git://github.com/marinaglancy/moodle into MOODLE_39_STABLE 2021-03-10 23:35:33 +01:00
AMOS bot 5c545ca2ff Automatically generated installer lang files 2021-03-10 00:07:39 +00:00
Paul Holden 4037bdd825 MDL-69036 theme_boost: consistent table row hovering for links.
When hovering over table rows with the `dimmed_text` class we
should consistently set the text/link colour.

Co-Authored-By: Mikel Martín <mikel@moodle.com>
2021-03-09 16:22:48 +00:00
Andrew Nicols c211e62465 MDL-70780 customfield: Address random behat fails
A number of behat fails have been creeping in with the customfield code
as behat is moving onto the next step before the current step finishes.

This change introduces some additional pending JS tracking to prevent
this.
2021-03-09 07:52:24 +08:00
AMOS bot ff27bc6c5a Automatically generated installer lang files 2021-03-07 00:07:42 +00:00
Eloy Lafuente (stronk7) 02a2e649e9 Moodle release 3.9.5 2021-03-06 18:03:54 +01:00
AMOS bot 8dcc813d0b Automatically generated installer lang files 2021-03-06 00:07:46 +00:00
Sara Arjona 329a5109b8 weekly release 3.9.4+ 2021-03-05 16:01:38 +01:00
Sara Arjona 108bfe3f52 Merge branch 'install_39_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_39_STABLE 2021-03-05 16:01:38 +01:00
Alexander Bias bab8ea6608 MDL-71059 repository_contentbank: set default returntype
The content bank was designed for making easier to reuse content.
So "Link to the file" should be the default option when using the
contentbank repository, in order to let teachers modify their
content in the content bank and update automatically it everywhere
is used.
2021-03-05 14:20:38 +01:00
Sara Arjona 4501c37045 MDL-70759 core_h5p: add renderer to let personalize styles
This is a backport of MDL-69087

Existing mod_hvp pluging has a renderer to let Moodle instances
alter styles, Javascript, semantics (fields in the editor) and
content: https://github.com/h5p/moodle-mod_hvp/blob/stable/renderer.php

The approach for core_h5p is exactly the same, to let people
to reuse their existing code.
2021-03-05 14:07:18 +01:00
Ilya Tregubov b0679c1103 MDL-69680 lib: Fix behat test backup_and_restore.feature 2021-03-04 22:51:41 +01:00
Paul Holden b8322f7dd1 MDL-71048 lang: fix null equality check of lang string args. 2021-03-04 19:43:54 +00:00
Marina Glancy a2221d6d8d MDL-71039 core_form: support valuehtmlcallback in autocomplete inline 2021-03-04 13:39:56 +01:00
Ilya Tregubov 472fdf0603 MDL-69680 lib: Replace deprecated jQuery functions 2021-03-04 12:47:44 +08:00
Ilya Tregubov a5edc8cb89 MDL-69680 lib: Update jQuery version in Moodle files 2021-03-04 12:47:44 +08:00
Ilya Tregubov c2cddf3c25 MDL-69680 lib: Upgrade jQuery lib to 3.5.1 2021-03-04 12:47:44 +08:00
Eloy Lafuente (stronk7) 8d748b3401 Merge branch 'MDL-70424-auth-avoid-changes-MOODLE_39_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_39_STABLE 2021-03-04 00:32:34 +01:00
Brendan Heywood 6feb10dd53 MDL-70424 auth: Avoid random changes to $CFG->auth 2021-03-04 09:31:51 +11:00
Ilya Tregubov ff431a76cd MDL-70767 feedback: Prevent xss in feedback answer text. 2021-03-03 23:09:26 +01:00
Sara Arjona e49f38f6d2 Merge branch 'MDL-68721-39' of git://github.com/ferranrecio/moodle into MOODLE_39_STABLE 2021-03-03 17:51:41 +01:00
Ferran Recio 7381719f54 MDL-68721 mod_h5pactivity: report acceptance tests 2021-03-03 17:23:27 +01:00
Paul Holden ddb31238a1 MDL-65552 block_activity_results: correct Behat tests for idnumbers.
Teachers can see user idnumber fields only when they are configured
identity fields. Students cannot.
2021-03-03 23:14:37 +08:00
Marina Glancy 009b90a43b MDL-65552 user: escape idnumber and email in table_sql 2021-03-03 23:14:37 +08:00
Paul Holden 7afca3b34a MDL-65552 user: escape idnumber field on output.
This commit also corrects parameter definition of the field to
match core_user.
2021-03-03 23:14:37 +08:00
Sara Arjona 882734c99f Merge branch 'MDL-70125_39-3' of git://github.com/mdjnelson/moodle into MOODLE_39_STABLE 2021-03-03 15:47:45 +01:00
Sara Arjona c0c9be6d03 Merge branch 'MDL-67494-39' of git://github.com/lameze/moodle into MOODLE_39_STABLE 2021-03-03 11:51:18 +01:00
Sara Arjona 226a690c0d Merge branch 'MDL-67119-39' of git://github.com/aanabit/moodle into MOODLE_39_STABLE 2021-03-03 11:11:47 +01:00
Ilya Tregubov f702707ef7 MDL-71026 user: Fix incorrect get_string call. 2021-03-03 11:44:30 +02:00
Jun Pataleta d1bec1e23b Merge branch 'MDL-70987-39' of git://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2021-03-03 16:41:56 +08:00
Simey Lameze 497c016518 MDL-67494 calendar: user_delete_user should delete all user events 2021-03-03 16:32:58 +08:00
Simey Lameze 078f59faf8 MDL-67494 calendar: privacy provider should not delete shared events 2021-03-03 16:32:58 +08:00
Simey Lameze df4f869af7 MDL-67494 calendar: shared subscriptions should not set userid to 0 2021-03-03 16:32:58 +08:00
Simey Lameze 0a4092bc27 MDL-67494 calendar: only user overrides should retain userid 2021-03-03 16:32:58 +08:00
Simey Lameze 31a7410a90 MDL-67494 calendar: set userid to zero for shared events 2021-03-03 16:32:58 +08:00
Simey Lameze 793289f905 MDL-67494 calendar: step to set userid 0 to all shared events 2021-03-03 16:32:56 +08:00
Simey Lameze cd009c0c51 MDL-67494 calendar: add logic for category events in get_context 2021-03-03 16:27:08 +08:00
Jun Pataleta 60900a8066 Merge branch 'MDL-71009_39' of https://github.com/timhunt/moodle into MOODLE_39_STABLE 2021-03-03 16:22:29 +08:00
Sara Arjona dde73f5fb5 Merge branch 'MDL-69097-390' of https://github.com/inigozendegi/moodle into MOODLE_39_STABLE 2021-03-03 09:07:04 +01:00
Jun Pataleta 44fe2370b7 Merge branch 'MDL-70995-39' of https://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-03-03 15:05:07 +08:00
Jun Pataleta 5d09a5f6b0 Merge branch 'MDL-69883-39' of https://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-03-03 14:33:43 +08:00
Andrew Nicols 3944872103 Merge branch 'MDL-70268-39-2' of git://github.com/peterRd/moodle into MOODLE_39_STABLE 2021-03-03 12:22:11 +08:00
Peter Dias 5db25124ef MDL-70268 core: Update the oauthlib to exclude scope if none provided 2021-03-03 12:06:37 +08:00
AMOS bot b17f7fd443 Automatically generated installer lang files 2021-03-03 00:07:40 +00:00
Paul Holden 787485d9eb MDL-70822 enrol: respect capability to view other users profile.
When retrieving courses of another user via web services, we should
respect the capability to view that users profile in a given course.
2021-03-02 23:37:35 +01:00
Sander Wind 299fb2f158 MDL-70668 auth: Fix secret validation during user confirmation
Co-authored-by: Michael Hawkins <michaelh@moodle.com>
2021-03-02 23:37:35 +01:00
Eloy Lafuente (stronk7) 71f444e82d Merge branch 'MDL-70340-39' of git://github.com/jleyva/moodle into MOODLE_39_STABLE 2021-03-02 23:33:25 +01:00
Víctor Déniz 1e0f448b3e Merge branch 'MDL-70676-39' of git://github.com/ilyatregubov/moodle into MOODLE_39_STABLE
Fixed mod/workshop/db/upgrade.php: \xmldb_field::getNotNull()
does not verify if the column is nullable in the database.
2021-03-02 18:43:37 +00:00
Peter Dias d1a71ec909 MDL-59293 block_onlineusers: Update behat tests 2021-03-02 16:13:12 +00:00
Peter Dias 9c4f2a55b6 MDL-59293 block_onlineusers: Check whether current user can view online users
- Removed block from site admin.
- Blocked guest from viewuserlist cap
2021-03-02 16:13:12 +00:00
Ilya Tregubov a0ec66dc6b MDL-70676 workshop: Allow empty grades. 2021-03-02 13:43:48 +02:00
Sara Arjona b08b4a2bdc Merge branch 'MDL-67515-39' of git://github.com/vmdef/moodle into MOODLE_39_STABLE 2021-03-02 11:21:39 +01:00
Jun Pataleta 0d355a0e8d Merge branch 'MDL-70457_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2021-03-02 17:38:28 +08:00
Víctor Déniz 382250e60e Merge branch 'MDL-70172-39' of git://github.com/rezaies/moodle into MOODLE_39_STABLE 2021-03-02 09:17:18 +00:00
Paul Holden 71bb7f306e MDL-71022 gradereport_history: prevent double escaping of users.
The user identity fields are already escaped by the AJAX endpoint
that returns them, we don't need to do it again at the client.
2021-03-02 09:14:42 +00:00
Víctor Déniz 6864463dc4 MDL-67515 tool_customlang: Ignore invalid component strings
After uninstalling a plugin, the translated strings remain in
tool_customlang table, throwing an exception when trying to localise
any strings. Currently there is no mechanism to
clean up customlang tables and files during the uninstall process,
so with this patch the invalid components will be ignored.
2021-03-02 09:09:25 +00:00
AMOS bot b5db1d43f6 Automatically generated installer lang files 2021-03-02 00:07:39 +00:00
Eloy Lafuente (stronk7) c50c1fd745 Merge branch 'MDL-67974-39' of git://github.com/sarjona/moodle into MOODLE_39_STABLE 2021-03-01 22:33:48 +01:00
Shamim Rezaie 9aad72e85b MDL-70172 output: pages with main logo should have a first-level header 2021-03-02 05:42:23 +11:00
Shamim Rezaie 2e4198ab76 MDL-70172 output: Fix empty links
The approach taken is inline with font-awesome documentation:
https://fontawesome.com/how-to-use/on-the-web/other-topics/accessibility
2021-03-02 05:42:23 +11:00
Eloy Lafuente (stronk7) dc6da3f20e Merge branch 'MDL-70912-39' of git://github.com/sarjona/moodle into MOODLE_39_STABLE 2021-03-01 16:47:59 +01:00
Sara Arjona 52777e6a56 Merge branch 'MDL-68735_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2021-03-01 16:17:48 +01:00
Eloy Lafuente (stronk7) 4b53207d34 Merge branch 'MDL-70913-39' of git://github.com/sarjona/moodle into MOODLE_39_STABLE 2021-03-01 14:32:07 +01:00
Sara Arjona 6d0a928b64 MDL-70913 core_badges: Use and update properly sortorder
Sortorder field in badge_external_backpack was updated with a wrong
value. This patch fixes this behaviour and adds sortorder as
sorting criteria for displaying the list of site backpacks.
2021-03-01 13:12:20 +01:00
Amaia Anabitarte 616935475b MDL-70726 behat: Fixing existing fail tests
Some of the current behat tests were wrong but not failing because of the bug in 'should not exist' step.
Once the bug is fixed, we must fix also wrong behats.
2021-03-01 16:09:20 +07:00
Thong Bui 8d6cbcb248 MDL-70726 behat: should_not_exist function does not work correctly 2021-03-01 16:09:20 +07:00
Eloy Lafuente (stronk7) 35d42cc6a7 Merge branch 'MDL-70931-39-xmldbeol' of git://github.com/mudrd8mz/moodle into MOODLE_39_STABLE 2021-03-01 10:01:22 +01:00
Eloy Lafuente (stronk7) 6030e5ce3d Merge branch 'MDL-70941-39' of git://github.com/dravek/moodle into MOODLE_39_STABLE 2021-03-01 09:54:25 +01:00
Eloy Lafuente (stronk7) 1d0b0ebb15 Merge branch 'MDL-70910-39' of git://github.com/dravek/moodle into MOODLE_39_STABLE 2021-03-01 09:50:23 +01:00
Eloy Lafuente (stronk7) 2a2d658d84 Merge branch 'MDL-70964-39-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_39_STABLE 2021-03-01 09:34:18 +01:00
AMOS bot 1e1c3622e3 Automatically generated installer lang files 2021-03-01 00:07:42 +00:00
AMOS bot 68242c6a84 Automatically generated installer lang files 2021-02-28 00:07:38 +00:00
AMOS bot eae9427f8f Automatically generated installer lang files 2021-02-27 00:07:46 +00:00
Tim Hunt f906c7cadc MDL-71009 question bank: escape idnumbers when displayed 2021-02-26 12:48:28 +00:00
Eloy Lafuente (stronk7) c302886845 MDL-68735 env: Moodle 3.8.x, 3.9.x and 3.10.x do not support PHP 8.0 2021-02-26 13:08:11 +01:00
David Matamoros 3afaa0d81c MDL-70941 contentbank: fix empty equality check when renaming content 2021-02-26 12:08:41 +01:00
David Matamoros ba69ad868a MDL-70910 contentbank: fix for using contentid not validated 2021-02-26 12:02:50 +01:00
Eloy Lafuente (stronk7) bc509f6d8c MDL-70457 forms: php74 fix for the (not used in core) date element
Curly brackets to access by index to strings or arrays is
deprecated since php74.
2021-02-26 11:55:37 +01:00
Amaia Anabitarte 120b877cb6 MDL-67119 core_analytics: Analyse users once per course
User's activity in a course should be analysed only once
no matter the number of enrolments the user has in that course.
2021-02-26 11:48:09 +01:00
Jun Pataleta f32754319e weekly release 3.9.4+ 2021-02-26 13:42:49 +08:00
Jun Pataleta 3e91d27f5e Merge branch 'install_39_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_39_STABLE 2021-02-26 13:42:49 +08:00
David Mudrák d6adfa6446 MDL-70964 lang: Use the fixed strings in tests 2021-02-25 19:28:14 +01:00
Helen Foster 58bdf28392 MDL-70964 lang: Import fixed English strings (en_fix) 2021-02-25 16:37:34 +01:00
Jun Pataleta bde3b82720 Merge branch 'MDL-70169-39' of git://github.com/lameze/moodle into MOODLE_39_STABLE 2021-02-25 12:28:46 +08:00
AMOS bot 7111921105 Automatically generated installer lang files 2021-02-25 00:07:42 +00:00
Paul Holden 67e1e3107a MDL-69883 message: fix lazy loading of conversations.
Set max-height on each container section rather than the container
itself, so that each can respond to the scrollBottom event within
the lazy loading module (which handles the overflow itself).
2021-02-24 22:01:40 +00:00
Paul Holden fac00d7e8c MDL-70995 user: format group names in course participants filter. 2021-02-24 19:26:12 +00:00
Iñigo Zendegi bbbb211c71 MDL-69097 mod_forum: Apply filters to whole forum grading 2021-02-24 17:12:56 +01:00
Víctor Déniz 54beada930 Merge branch 'MDL-51111-muc-reset-MOODLE_39_STABLE' of https://github.com/brendanheywood/moodle into MOODLE_39_STABLE 2021-02-24 14:08:41 +00:00
Brendan Heywood af3e51fa82 MDL-51111 cache: Don't lock and write the config file if unchanged 2021-02-24 12:47:34 +11:00
Andrew Nicols 78adf434d4 MDL-70987 core_form: Use correct id for elementid during validation
The id of the formid was being passed instead of the elementid.
2021-02-24 09:06:48 +08:00
Sara Arjona cc7bc38cc1 MDL-67974 core_badges: Recovered expired stamp
Expired stamp icon displayed over the badge images has been added
again to CSS (it was lost at any point).
2021-02-23 15:33:06 +01:00
Sara Arjona 4c4c74c13b MDL-67974 core_badges: Badge expiry date when hover
Text displayed for expired badges when the user hovers over the
warning (!) icon has been fixed in the "Issued badge information"
page.
2021-02-23 15:33:06 +01:00
Eloy Lafuente (stronk7) cb13db88a3 Merge branch 'MDL-43697' of https://github.com/praxisdigital/moodle into MOODLE_39_STABLE 2021-02-22 23:10:28 +01:00
Marina Glancy 31b1a9601f MDL-70967 enrol_meta: fix error in unittest 2021-02-22 18:06:49 +01:00
Mark Nelson 1e10d9328e MDL-70125 core_grade: do not change overridden status during regrading 2021-02-22 19:36:38 +08:00
AMOS bot cf3b76b980 Automatically generated installer lang files 2021-02-22 00:07:41 +00:00
Andrew Nicols f1f578cd7a Merge branch 'MDL-70879_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE 2021-02-22 07:51:56 +08:00
Daniel Kristian Steffensen 8b16724fef MDL-43697 backup: Archived badges are restored during course restore 2021-02-19 15:49:33 +01:00
Eloy Lafuente (stronk7) ecdd8bf487 MDL-70879 behat: Bump to Behat 3.8.x 2021-02-19 14:49:23 +01:00
Víctor Déniz 713b28c2a5 weekly release 3.9.4+ 2021-02-19 12:39:11 +00:00
Víctor Déniz c2d1a1eb60 Merge branch 'install_39_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_39_STABLE 2021-02-19 12:39:09 +00:00
AMOS bot d76dddea87 Automatically generated installer lang files 2021-02-19 00:07:54 +00:00
Jun Pataleta 28fca52bd4 Merge branch 'MDL-47410-39' of git://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2021-02-18 11:29:51 +08:00
Andrew Nicols 4d3c0a9d82 MDL-47410 behat: Perform exact match for date_time selectors 2021-02-18 11:29:20 +08:00
David Mudrák 5334972a73 MDL-70931 xmldb: Generate install.xml files with EOL and EOF
As discussed in MDLSITE-6397, all Moodle code files should end with
single Unix-style end of line character. Files created and edited
through the XMLDB editor should follow this rule, too.
2021-02-17 21:06:09 +01:00
Víctor Déniz d62a536a2c Merge branch 'MOODLE_39_MDL-70752' of https://github.com/golenkovm/moodle into MOODLE_39_STABLE 2021-02-17 16:57:49 +00:00
Eloy Lafuente (stronk7) 240d414aba Merge branch 'MDL-70552-39' of git://github.com/ilyatregubov/moodle into MOODLE_39_STABLE 2021-02-17 10:26:57 +01:00
Ilya Tregubov 8d4930ab11 MDL-70552 core_message: Show popup for teachers when anonymous
user completed feedback.
2021-02-17 08:43:35 +02:00
Andrew Nicols 41cf8a2f42 Merge branch 'MDL-47410-39' of git://github.com/mihailges/moodle into MOODLE_39_STABLE 2021-02-17 09:41:59 +08:00
AMOS bot 80223d703c Automatically generated installer lang files 2021-02-17 00:07:49 +00:00
Andrew Nicols 0782c3c18d Merge branch 'MDL-70264-39' of git://github.com/sarjona/moodle into MOODLE_39_STABLE 2021-02-17 07:27:13 +08:00
Eloy Lafuente (stronk7) cf1546a472 Merge branch 'MDL-69562_39' of https://github.com/dvdcastro/moodle into MOODLE_39_STABLE 2021-02-16 22:39:49 +01:00
Eloy Lafuente (stronk7) 6d1ec7c38d Merge branch 'MDL-70525_39' of https://github.com/TomoTsuyuki/moodle into MOODLE_39_STABLE 2021-02-16 19:56:38 +01:00
Sara Arjona 379d21c8cb MDL-70912 mod_data: Add filepicker to the H5P Atto button
The filepicker wasn't displayed fot the H5P Atto button when a text
area database field was created because some options were missing
in the textarea field class.
2021-02-16 18:17:41 +01:00
AMOS bot d2f7b36caa Automatically generated installer lang files 2021-02-16 00:07:45 +00:00
Paul Holden b70b06bc61 MDL-66025 user: require message content in bulk action.
Also import missing 'core/notification' dependency.
2021-02-14 20:10:38 +00:00
AMOS bot 96f41c3d99 Automatically generated installer lang files 2021-02-13 00:07:54 +00:00
Simey Lameze 8eb4a14e44 MDL-70169 login: fix accessibility issues 2021-02-12 13:14:51 +08:00
Paul Holden f8811d5661 MDL-70789 theme_boost: fix double click on drawer hiding content.
If the drawer toggle button was clicked in quick succession to close
and then re-open, then the delayed Aria.hide method would be called
which hid the drawer content when it finished opening.
2021-02-11 21:49:14 +00:00
Sara Arjona a3f78dbd7a MDL-70264 badges: remove badges/oauth2callback.php
File badges/oauth2callback.php has been removed and now badges
API will use admin/oauth2callback.php because it makes no sense having
it twice.

Credits go to Andrew Nicols for raising it!
2021-02-11 16:58:55 +01:00
Sara Arjona 1d17c73e9e weekly release 3.9.4+ 2021-02-11 14:54:44 +01:00
Sara Arjona b21076309d Merge branch 'install_39_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_39_STABLE 2021-02-11 14:54:42 +01:00
Mihail Geshoski c34c00a762 MDL-47410 mod_assign: Update mod_assign behat tests
Updates the mod_assign behat tests to utilize the ability to
conviniently populate the datetime selector fields.
2021-02-11 12:15:45 +08:00
Mihail Geshoski 3d87e93f02 MDL-47410 behat: Support selection from the datetime selector element
Adds behat support for selecting date and time from a datetime selector
element. The passed values should represent a textual date and time
description wrapped in '##' (e.g. '##first day of January 2020 08:00##',
'##1 Jan 2020 10:30##'). Also, the value 'disabled' is valid and can be
used to disable the datetime selector element.
2021-02-11 12:15:45 +08:00
Mihail Geshoski 76f2dc1f14 MDL-47410 tool_licensemanager: Update tool_licensemanager behat tests
Updates the tool_licensemanager behat tests to utilize the ability to
conviniently populate the date selector fields.
2021-02-11 12:15:45 +08:00
Mihail Geshoski 77e578a91a MDL-47410 behat: Support date selection from the date selector element
Adds behat support for selecting a date from the date selector element.
The passed values should represent a textual date description wrapped
in '##' (e.g. '##first day of January 2020##', '##1 Jan 2020##'). Also,
the value 'disabled' is valid and can be used to disable the date
selector element.
2021-02-11 12:15:44 +08:00
Mihail Geshoski eb0e5a1297 MDL-47410 behat: Create custom selector for the date and datetime fields
Creates a custom field selector to locate the requested date or datetime
form fields.
2021-02-11 12:11:18 +08:00
Mihail Geshoski 8844095259 MDL-47410 behat: Move logic from guess_type() to a separate method
Moves the logic from guess_type() to a separate protected method
get_field_instance_for_element(). This would be quite useful for
form field classes as they can now use this method when there is
a need to determine the type of a given node element.
2021-02-11 12:11:18 +08:00
Mihail Geshoski 4b58966938 MDL-47410 behat: Use data-fieldtype attribute to guess the field type
The data-fieldtype attribute (if present) should be also utilized in
guess_field_type() and match the behavior in get_field_node_type().
2021-02-11 12:11:18 +08:00
Mihail Geshoski 69ec780e95 MDL-47410 form: Add data-fieldtype attribute to checkbox inline element
Includes the data-fieldtype attribute to the checkbox inline form
element. This element does not extend the parent inline element
template due to its specific nature and therefore this attribute was
missing.
2021-02-11 12:11:18 +08:00
Adrian Greeve e539a0aa30 Merge branch 'MDL-70513_39' of https://github.com/timhunt/moodle into MOODLE_39_STABLE 2021-02-11 10:05:29 +08:00
Adrian Greeve 7116f5fde8 Merge branch 'MDL-69867-39_display_grade_with_scale' of git://github.com/moffe42/moodle into MOODLE_39_STABLE 2021-02-11 09:25:19 +08:00
AMOS bot aba0e6b70d Automatically generated installer lang files 2021-02-11 00:07:45 +00:00
Sara Arjona 37136525d9 Merge branch 'MDL-70732-39' of git://github.com/aanabit/moodle into MOODLE_39_STABLE 2021-02-10 17:20:43 +01:00
Sara Arjona 8e6d2ba38d Merge branch 'MDL-70796_39' of https://github.com/timhunt/moodle into MOODLE_39_STABLE 2021-02-10 16:50:20 +01:00
Sara Arjona f418bf8c96 Merge branch 'MDL-69101_39' of https://github.com/timhunt/moodle into MOODLE_39_STABLE 2021-02-10 15:12:12 +01:00
Sara Arjona 8a40250c49 Merge branch 'MDL-70631-39-unzip' of git://github.com/mudrd8mz/moodle into MOODLE_39_STABLE 2021-02-10 12:38:24 +01:00
Sara Arjona e516a662c5 Merge branch 'MDL-70736_MOODLE_39_STABLE' of https://github.com/TomoTsuyuki/moodle into MOODLE_39_STABLE 2021-02-10 08:28:32 +01:00
Jacob Christiansen 4adfbf3cba MDL-69867 mod_assign: Display current grade with scale value
When using workflow we show the current grade with its scale value
instead of the internal index
2021-02-10 08:10:55 +01:00
John Yao ecafdc45d0 MDL-65390 accessibility: correct focus after "Show more" clicked 2021-02-09 15:11:37 +01:00
Sara Arjona 499bf7df7d Merge branch 'MDL-70173-39' of git://github.com/rezaies/moodle into MOODLE_39_STABLE 2021-02-09 08:29:34 +01:00
Sara Arjona 378725c05f Merge branch 'MDL-70377_39' of https://github.com/mkassaei/moodle into MOODLE_39_STABLE 2021-02-09 08:23:43 +01:00
Shamim Rezaie e3142ca2e2 MDL-70173 core: Use a meaningful first level header 2021-02-09 16:33:44 +11:00
Shamim Rezaie 23ed4c4440 MDL-70173 theme_boost: Fix empty link issue on the "Go to top" button
On behat, we have to use a more specific test step if we are looking
for a "Go" button on a modal. The reason is that the html of the modal
content is put after the html of the "Go to top" button, so behat
may find the "Go to top" button if we just look for "Go".
2021-02-09 16:33:44 +11:00
Shamim Rezaie 4ac8ae1be7 MDL-70173 theme_boost: Increase the size of notification counter
WAVE considers any text with the size of 10px or below really small.
Increasing the font size of the navbar counter by 1px should not make a
big negative impact on the design, but improves accessibility.
2021-02-09 16:33:44 +11:00
Shamim Rezaie 254aa09f40 MDL-70173 output: All pages should have a heading
In MDL-63040, it was decided that the page header for the dashboad page
should be removed.
However, Based on Success Criteria 1.3.1 and 2.4.6 from the WebAIM's
WCAG 2 Checklist, all pages should have an <h1> element.
So I put an sr-only heading on the dashboard and all other pages, where
no page header is shown.
2021-02-09 16:33:44 +11:00
Shamim Rezaie d27c60a90a MDL-70173 dashboard: ARIA role presentation conflicted the empty alt
The markup <img role="presentation" alt="alt text"> is contradictory.

According to https://www.w3.org/TR/2017/WD-wai-aria-practices-1.1-20170628/examples/presentation/PresentationRoleExamples.html
 It is recommended that authors instead use empty alt text (alt="")
 where they use role="presentation".
2021-02-09 16:33:43 +11:00
Shamim Rezaie 5fae9c213d MDL-70173 message: Fix empty link 2021-02-09 16:33:43 +11:00
Shamim Rezaie e7a160da9a MDL-70173 output: use an empty alt to hide user pic from screen readers
There is no need to use WAI-ARIA to hide images from screen readers.
See https://www.w3.org/WAI/tutorials/images/decorative/
2021-02-09 16:33:43 +11:00
Tomo Tsuyuki ac1402d552 MDL-70525 tool_profiling: Cannot import profiling file
Change type from int to integer to be able to have big numbers
2021-02-09 10:17:56 +11:00
Mahmoud Kassaei 2c5adf1c5b MDL-70377 qtype_essay: When reviewing an attempt as a teacher
In the Response history table, Action Saved: does not display the value
of $a in the language string.
2021-02-08 17:08:17 +00:00
Andrew Nicols 4d54712518 Merge branch 'MDL-70614-39' of git://github.com/paulholden/moodle into MOODLE_39_STABLE 2021-02-08 10:47:23 +08:00
Andrew Nicols 853cbc5973 Merge branch 'MDL-70725-39' of git://github.com/sarjona/moodle into MOODLE_39_STABLE 2021-02-08 10:30:51 +08:00
AMOS bot 630325a4e4 Automatically generated installer lang files 2021-02-06 00:07:46 +00:00
Tim Hunt 842e7aa041 MDL-70796 count_words: match the count from LibraOffice & MS Word 2021-02-05 15:27:15 +00:00
Amaia Anabitarte 46916975a2 MDL-70732 behat: Adding second parameter to ExpectationException() 2021-02-05 11:01:44 +01:00
Sara Arjona 8fc5c6214a weekly release 3.9.4+ 2021-02-04 14:56:17 +01:00
Sara Arjona 263419e10d Merge branch 'install_39_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_39_STABLE 2021-02-04 14:56:15 +01:00
Mikhail Golenkov f4024153e1 MDL-70752 restore: Fix remote file recovery 2021-02-04 19:23:23 +11:00
Tomo Tsuyuki 61752e9e0f MDL-70736 gradingform_guide: Fix loading marking guide template issue
Do not check grade item name if it is from shared template.
2021-02-04 16:08:05 +11:00
Andrew Nicols d9e13438d1 Merge branch 'MDL-69748-39' of git://github.com/rezaies/moodle into MOODLE_39_STABLE 2021-02-04 11:52:41 +08:00
Shamim Rezaie 6a7750a141 MDL-69748 core: Fix hideif issue with array elements
Changed the element selector to get all array elements,
whether named or unnamed. The previus selector was only
working for elements that thir names were like name="something[]".
It was not working for name="something[a]" elements.
2021-02-04 14:39:04 +11:00
AMOS bot f025935c1c Automatically generated installer lang files 2021-02-04 00:07:51 +00:00
Eloy Lafuente (stronk7) 4640d8f9ca MDL-70741 capability overview: missing whitespace after placeholder 2021-02-04 00:01:03 +01:00
Tim Hunt c420408522 MDL-70513 quiz manual grading: use formchangechecker to avoid dataloss 2021-02-03 16:11:18 +00:00
David Mudrák 2020498bd5 MDL-70631 files: Replace hard-coded value with FL_ENC_RAW constant
This is not related to the issue but I noticed it while trying to debug
it.

Back when this line was introduced in 9c140a681e, the ZipArchive had
not yet exposed this flag as a constant. It was added later with PHP
7.0.8 and we can switch to using it now.
2021-02-03 16:11:00 +01:00
David Mudrák 6ad9b1314f MDL-70631 files: Fix performance of zip_packer::extract_to_pathname()
The original implementation was based on ZipArchive::getStream() which
turns out to be very slow and if the archive contains many files, the
unzipping performance is very slow.

The patch changes the implementation to use ZipArchive::extractTo()
unless the extracted entry path contains a folder name ending with dot
(such as some/path./to/file.txt). There is a known upstream bug in the
PHP ZIP extension #77214 (also #74619 and #69477) so that we fall back
to keep using the stream in those cases.
2021-02-03 16:11:00 +01:00
Sara Arjona 994e833c20 Merge branch 'MDL-70705-39' of git://github.com/lucaboesch/moodle into MOODLE_39_STABLE 2021-02-03 15:33:26 +01:00
Luca Bösch ab3f29f739 MDL-70705 block_blog_recent: support multilang blog entry titles 2021-02-03 15:15:43 +01:00
Sara Arjona fb298c2209 Merge branch 'MDL-70741_39' of https://github.com/timhunt/moodle into MOODLE_39_STABLE 2021-02-03 14:49:57 +01:00
David Castro 10126a1325 MDL-69562 admin: Allow getting IP from all sources. 2021-02-03 07:23:12 -05:00
Eloy Lafuente (stronk7) 6bd3ffdf25 Merge branch 'MDL-70711-M39' of git://github.com/kordan/moodle into MOODLE_39_STABLE 2021-02-03 13:04:22 +01:00
Sara Arjona d1f40013d9 Merge branch 'MDL-67959-39-2' of git://github.com/junpataleta/moodle into MOODLE_39_STABLE 2021-02-03 10:50:54 +01:00
Tim Hunt 2386b44490 MDL-69101 Essay/Moodle XML: recent new settings not imported/exported 2021-02-03 08:15:26 +00:00
Sara Arjona dffd5de050 Merge branch 'MDL-70621-39' of git://github.com/lucaboesch/moodle into MOODLE_39_STABLE 2021-02-03 09:03:05 +01:00
Sara Arjona fdf5ac3dfb Merge branch 'MDL-68970_39' of https://github.com/timhunt/moodle into MOODLE_39_STABLE 2021-02-03 08:51:29 +01:00
Luca Bösch 70cfba0496 MDL-70621 mod_glossary: use glossary rsstype string. 2021-02-03 08:34:24 +01:00
Luca Bösch 92e4d6c028 MDL-70621 mod_forum: use forum rsstype string. 2021-02-03 08:34:24 +01:00
Andrew Nicols 3a88c22eb1 Merge branch 'MDL-56772-39' of git://github.com/peterRd/moodle into MOODLE_39_STABLE 2021-02-03 10:58:05 +08:00
Andrew Nicols ac4fe16003 Merge branch 'MDL-66932_M39' of https://github.com/nadavkav/moodle into MOODLE_39_STABLE 2021-02-03 10:24:12 +08:00
Andrew Nicols 0e0a753346 Merge branch 'MDL-68893-39' of git://github.com/lucaboesch/moodle into MOODLE_39_STABLE 2021-02-03 09:41:28 +08:00
Andrew Nicols 0f21f23c05 Merge branch 'MDL-68958-39' of git://github.com/peterRd/moodle into MOODLE_39_STABLE 2021-02-03 09:38:08 +08:00
Andrew Nicols 7171c9fc0a Merge branch 'MDL-70339-39' of git://github.com/peterRd/moodle into MOODLE_39_STABLE 2021-02-03 09:09:30 +08:00
Víctor Déniz 0322232dd4 Merge branch 'MDL-59782-39' of git://github.com/bmbrands/moodle into MOODLE_39_STABLE 2021-02-02 09:35:29 +00:00
Sara Arjona f5590ad1c0 Merge branch 'MDL-70574_39' of https://github.com/timhunt/moodle into MOODLE_39_STABLE 2021-02-02 08:20:45 +01:00
Sara Arjona dcaf627cfe Merge branch 'MDL-70288-39-2' of git://github.com/junpataleta/moodle into MOODLE_39_STABLE 2021-02-02 07:59:49 +01:00
Jun Pataleta 6aa1c3dfcb MDL-70288 qtype: Remove unnecessary empty label string
* When a label is passed to an (advanced) checkbox and no text
  was provided, the label will be displayed on the right of the the
  checkbox element. So there's no point in passing an empty string for
  the label just to render the text to the right of the checkbox.
2021-02-02 14:22:30 +08:00
Jun Pataleta 6c97f9d1f5 MDL-70288 mod_lti: Remove unnecessary empty label string
* When a label is passed to an (advanced) checkbox and no text
  was provided, the label will be displayed on the right of the the
  checkbox element. So there's no point in passing an empty string for
  the label just to render the text to the right of the checkbox.
2021-02-02 14:22:30 +08:00
Jun Pataleta 8a2a5f1a89 MDL-70288 core: Remove duplicate labels for checkbox elements
* If there's a label, the text will serve as the description of  the
element.
2021-02-02 14:22:30 +08:00
Jun Pataleta 9bce6baf62 MDL-70288 theme_boost: Manage aria-describedby on form validation
* The aria-describedby attribute can be a list of element IDs that
describe the element. On form validation, the ID of the error message
container is added to this attribute which may already be containing
another ID. So we need to properly add/remove the error message ID
so that we don't delete any existing ID(s) in the aria-describedby
attribute during form validation.
2021-02-02 14:22:30 +08:00
Eloy Lafuente (stronk7) f7f7755067 Merge branch 'MDL-46256_39' of https://github.com/timhunt/moodle into MOODLE_39_STABLE 2021-02-01 23:20:33 +01:00
Sara Arjona 9ac848c738 Merge branch 'MDL-70625-39' of git://github.com/rezaies/moodle into MOODLE_39_STABLE 2021-02-01 15:37:17 +01:00
Sara Arjona db9934a625 Merge branch 'MDL-70734-39' of git://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2021-02-01 12:30:29 +01:00
Sara Arjona 6b3cb904d0 Merge branch 'MDL-70740-39' of git://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2021-02-01 11:25:31 +01:00
Paul Holden c43f9136f3 MDL-70614 user: consistent roles spacing in course profile. 2021-02-01 07:54:13 +00:00
Andrew Nicols 01fc4b40f0 MDL-70734 behat: Increase the WebDriver Curl timeout 2021-02-01 09:50:20 +08:00
AMOS bot f5152d30c3 Automatically generated installer lang files 2021-02-01 00:07:49 +00:00
Andrew Nicols 3827885984 MDL-70740 behat: Composer bump for new version of Mink Driver 2021-01-31 20:26:35 +08:00
AMOS bot bc84eabfc6 Automatically generated installer lang files 2021-01-31 00:07:45 +00:00
Luca Bösch 6735a694e2 MDL-68893 mod_data: use own RSS feed string.
AMOS BEGIN
 CPY [rsstype,core],[rsstype,mod_data]
AMOS END
2021-01-29 23:18:36 +01:00
Tim Hunt 186fd5b847 MDL-70741 capability overview: avoid errors from orphan contexts 2021-01-29 20:51:08 +00:00
Víctor Déniz 0f1f18d8a4 weekly release 3.9.4+ 2021-01-29 17:13:10 +00:00
Víctor Déniz c3589fee83 Merge branch 'install_39_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_39_STABLE 2021-01-29 17:13:03 +00:00
Jake Dallimore 6e74df2344 Merge branch 'MDL-66979-39-7' of git://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2021-01-29 15:45:03 +08:00
Andrew Nicols 42bb84db9f MDL-66979 behat: Mark some tests as being slow
Uses of the httpsreplace and customlang tools are known to be extremely
slow.

In our CI infrastructure on slwoer DBs, the customlang tool can take
over 90 seconds to load the page, whilst the httpsreplace tool can take
up to about 60 seconds.

These changes set appropriate timeout factors to increase the timeout
accordingly.
2021-01-29 14:19:16 +08:00
Andrew Nicols 6d38633c3c MDL-66979 behat: Add a step to set a timeout factor for a test 2021-01-29 14:18:57 +08:00
Eloy Lafuente (stronk7) ff1877c738 MDL-66979 behat: Goutte driver doesn't implement setTimeouts()
Also, change:

get_real_timeout(30000)

to:

get_real_timeout(30) * 1000

because the original functions are defined to use seconds, and
having the 1000 around will help us detecting cases in the case
of a hypothetical review of uses.
2021-01-29 14:18:48 +08:00
Jun Pataleta 6e7c0d9686 MDL-67959 mod_forum: Display group pictures in forum only if available
Displaying a default group picture in forum posts leads to confusion,
so better to not display a default group picture when the group
picture is not set for the group.
2021-01-29 12:30:32 +08:00
AMOS bot 40edd91ddb Automatically generated installer lang files 2021-01-29 00:07:48 +00:00
Eloy Lafuente (stronk7) 9d7343074d MDL-66979 behat: Goutte driver doesn't implement setTimeouts()
Also, change:

get_real_timeout(30000)

to:

get_real_timeout(30) * 1000

because the original functions are defined to use seconds, and
having the 1000 around will help us detecting cases in the case
of a hypothetical review of uses.
2021-01-28 17:12:28 +01:00
Bas Brands feea5e5cbd MDL-59782 core_question: improve questionbank highlighting 2021-01-28 11:08:07 +01:00
Kordan 78855e618c MDL-70711 form: deleted useless if block
get_magic_quotes_gpc() always return false since PHP 5.3 so (1 == get_magic_quotes_gpc()) is never verified.
This allows me to safetly delete what I dropped out.
2021-01-28 09:28:34 +01:00
Eloy Lafuente (stronk7) 01f6f99349 Merge branch 'MDL-66979-39-7' of git://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2021-01-28 09:09:09 +01:00
Andrew Nicols 63a322b0e7 MDL-66979 behat: Set script timeout with timeout factor 2021-01-28 15:27:49 +08:00
Andrew Nicols 9a92ca5e75 MDL-66979 behat: Correct selenium2 reference in config-dist 2021-01-28 15:08:10 +08:00
Andrew Nicols 209768c9bc MDL-66979 behat: Handle driver stop failure properly
An case was found where the webdriver stop() call could fail in an
AfterScenario hook, leading to a complete rerun if no other errors were
experienced.
2021-01-28 15:07:52 +08:00
Andrew Nicols 8e1f02568a Merge branch 'MDL-70048-39' of git://github.com/peterRd/moodle into MOODLE_39_STABLE 2021-01-28 08:05:26 +08:00
Peter Dias 8039e01ef7 MDL-70048 dropbox: Augmented unit tests to account for additional params 2021-01-28 07:32:47 +08:00
Peter Dias 1dc927aea7 MDL-70048 dropbox: Update the dropbox search URL.
- Update fetch_dropbox_data to allow different result nodes and version
- Update search to the new URL with new params
- Update the get entities function to account for the change in structure.
2021-01-28 07:32:47 +08:00
Sara Arjona f03fd2f6b7 MDL-70725 oauth2: move expectException to separate method 2021-01-27 17:54:23 +01:00
AMOS bot ea17a4cbd6 Automatically generated installer lang files 2021-01-27 00:07:50 +00:00
Eloy Lafuente (stronk7) 9a9fde8aa5 Merge branch 'MDL-66979-39-7' of git://github.com/andrewnicols/moodle into MOODLE_39_STABLE 2021-01-26 22:46:08 +01:00
Víctor Déniz aa741e8795 Merge branch 'MDL-70528-39' of git://github.com/ilyatregubov/moodle into MOODLE_39_STABLE 2021-01-26 14:04:35 +00:00
Ilya Tregubov 1ca2e36ecf MDL-70528 h5pactivity: Fix block can't be added to h5pactivity page. 2021-01-26 15:21:18 +02:00
Tim Hunt 99b37e2c3b MDL-68970 quiz: prevent page caching during attempts
This ensures that the page reloads if the student uses
the Back or Forwards buttons within an attempt. This
avoids questions being in a stale state, or
the timer showing the wrong time.

Thanks to Jake Dallimore and Russell Boyatt for suggestions
which lead to this fix.
2021-01-25 18:35:38 +00:00
Peter Dias 2d7f1d7470 MDL-70339 mod_lti: Use the convenience function to get the right img 2021-01-25 13:39:24 +08:00
Peter Dias ff146ed37d MDL-68958 mod_imscp: Return manifestfilename as default response. 2021-01-25 13:23:38 +08:00
Peter Dias 2b9db93f78 MDL-56772 core: Update the picker styles for rtl langs 2021-01-25 11:36:56 +08:00
Andrew Nicols 985f4d1e48 MDL-66979 behat: Warn about old behat.yml file location 2021-01-23 20:45:06 +08:00
AMOS bot 77475c93fd Automatically generated installer lang files 2021-01-23 00:07:47 +00:00
Andrew Nicols 6a9f05742e MDL-66979 behat: Rename and warn on old config 2021-01-22 14:52:22 +08:00
Andrew Nicols 1116c64d44 MDL-66979 behat: Pad messaging drawer
This works around an issue highlighted by MDL-70411 whereby some of the
messaging links are covered by the scrollbar in Firefox on MacOS.
2021-01-22 14:52:22 +08:00
Andrew Nicols 5d211ff68a MDL-66979 behat: Work around weird gradebook focus behaviour
I can't expand this one in a sane fashion but the older JS is doing some
weird and wonderful things with focus.

The only way I could get this to behave correctly was to move away from
the field, move back to it, and then move away again. Other combinations
failed in different browsers for different reasons.
2021-01-22 14:52:22 +08:00
Andrew Nicols aac9d82e12 MDL-66979 behat: availability field extends textarea
The availability behat field extends the textarea type, and therefore
needs to include this type.
2021-01-22 14:52:21 +08:00
Andrew Nicols f11f91a1e0 MDL-66979 behat: Improve chromeOptions configuration
Simplify the chromeOptions configuration to improve readability.
2021-01-22 14:52:21 +08:00
Andrew Nicols ad85ffb55a MDL-66979 question: Improve behat test reliability
Expand all fieldsets rather than individual fieldsets.

This can fail in some situations where the page moves as the first
fieldset opens and HTML transitions take effect. This causes subsequent
fieldsets to move after WebDriver has calculated the click target.
2021-01-22 14:52:21 +08:00
Andrew Nicols 6d21e94213 MDL-66979 mod_assign: Stop clicking the user filters
Remove the documented hack which was re-opening a popup because it
"closes for some reason". It no longer randomly closes.
2021-01-22 14:52:21 +08:00
Andrew Nicols 52eb636ebe MDL-66979 behat: Switch to generators
These steps were creating content manually in an unnecessary fashion. I
had to debug some issues with features in these areas so took the time
to update them to make use of data generators, which are significantly
faster.
2021-01-22 14:52:21 +08:00
Andrew Nicols 915339039a MDL-66979 behat: Remove unused var 2021-01-22 14:52:21 +08:00
Andrew Nicols cbd016e620 MDL-66979 behat: Whitespace fix 2021-01-22 14:52:21 +08:00
Andrew Nicols 8a76c2a9a1 MDL-66979 behat: Remove manually triggered events
Behat should not trigger Synthetic browser events. It is incorrect to do
so as the UI should be used to trigger events correctly.

The W3C WebDriver specification explicitly states when and where these
events will be triggered from (the browser) and therefore there is no
ambiguity and no need to synthetically trigger them from Behat.
2021-01-22 14:52:21 +08:00
Andrew Nicols 9ccd5030d8 MDL-66979 group: Replace direct element interaction with steps
The W3C WebDriver leads to faster operation of individual steps which
highlights where WebDriver is moving to a new step faster than the
browser can process it.

The solution here is to use the `execute` function to interact with the
browsers as this makes use of the various wait and check steps.
2021-01-22 14:52:21 +08:00
Andrew Nicols 3489bb1f30 MDL-66979 behat: Remove unnecessary steps which fail
These steps were completely pointless and were failing with the W3C
Webdriver becuase focus was never on the Update Profile button in the
first place.

At a minimum we should remove the Focus change step as it not valid, but
the following step is also pointless.
2021-01-22 14:52:21 +08:00
Andrew Nicols e4a649d0f9 MDL-66979 scorm: Increase behat window size
On Firefox there can be some issues with ensuring that all nodes are
visible in order to click them.

This is likely an upstream geckodriver bug and not one that can be
easily addressed across all of Moodle.

In this instance the "Next" button is just outside the Visible Window,
but it is in an iFrame which is fully visible. In this situation
Firefox is unable to click the button but does not error.
2021-01-22 14:52:21 +08:00
Andrew Nicols 59a09e2e3f MDL-66979 behat: Scroll nodes into view before hover
The W3C Specification does not require that a NodeElement be in the
current viewport before triggering a mouseOver. As a result the
mouseOver will generate an Exception because the element is not in the
viewport, and the X/Y co-ordinates are invalid.

To handle this the node is scrolled into view.
2021-01-22 14:52:21 +08:00
Andrew Nicols ec20642963 MDL-66979 behat: Fix window switching
Normalise switching of window contexts by setting the main window name
to a null.

Where the window has no name (null/empty), then the root context is
selected.
2021-01-22 14:52:21 +08:00
Andrew Nicols 34ba550138 MDL-66979 behat: Use tab to blur current focus
The focus should be on something, rather than removed.

The way in which focus removal works can lead to side effects.
2021-01-22 14:52:21 +08:00
Andrew Nicols a248c359cc MDL-66979 behat: Update passwordunmask form field control
Update the passwordunmask form field type for behat to interact with the
form element as a human would rather than via synthetic event triggers.
2021-01-22 14:52:21 +08:00
Andrew Nicols 18d5ddf01d MDL-66979 behat: iFrames must have a name for switchTo
The W3C WebDriver protocol supports switching of contexts using a named
context, and not the class asscoiated with that context.
2021-01-22 14:52:21 +08:00
Andrew Nicols deaab14bf9 MDL-66979 mod_data: Improve behat chart data step
Charts data visibility is more reliable when checked via the
aria-expanded attribute.

The isVisible attribute can cause some failures under Firefox.
2021-01-22 14:52:21 +08:00
Andrew Nicols 4e00a821cf MDL-66979 behat: Handle JS on elements better
This change introduces a new function to execute Javascript directly on
a node.

This should not, ordinarily, be used directly by steps, but may be
required in other parts of the Behat interaction.
2021-01-22 14:52:21 +08:00
Andrew Nicols 496ef9b0a8 MDL-66979 behat: Rename selenium config to webdriver
The PHP WebDriver Mink Driver does not necessarily require Selenium. It
supports Selenium 3 upwards, and can be used directly with ChromeDriver,
EdgeDriver, SafariDriver, GeckoDriver, and others.

It therefore uses a slightly different configuraitno path.
2021-01-22 14:52:21 +08:00
Andrew Nicols e5b1fc8083 MDL-66979 behat: Core updates for W3C WebDriver
This commit updates core Behat features to make use of the
php-webdriver/webdriver library instead of the legacy Instaclick
library.

Most of these changes relate to use of features of WebDriver which we
are required to use directly rather than through the Mink Driver.
2021-01-22 14:52:21 +08:00
Andrew Nicols c2c71b28eb MDL-66979 behat: Switch to new W3C Behat driver
This commit updates the composer dependencies to make use of the updated
version of moodlehq/moodle-behat-extension which depends upon the
php-webdriver/webdriver and relevant Mink WebDriver.
2021-01-22 14:52:21 +08:00
Jake Dallimore db6d34630f weekly release 3.9.4+ 2021-01-22 11:30:51 +08:00
Jake Dallimore 88a9d4cff1 Merge branch 'install_39_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_39_STABLE 2021-01-22 11:30:49 +08:00
Tim Hunt 96c8ad66f9 MDL-46256 count_words: fix handling of paragraphs 2021-01-21 09:55:19 +00:00
Tim Hunt fbb0428179 MDL-46256 count_letters: an unit tests and fix HTML editity handling 2021-01-21 09:55:19 +00:00
Tim Hunt 82592f0c84 MDL-46256 word count: Convert existing tests to a data provider 2021-01-21 09:55:18 +00:00
Adrian Greeve aa3118999a Merge branch 'MDL-57020-39-allow_delete_unused_scale' of https://github.com/sharidas/moodle into MOODLE_39_STABLE 2021-01-21 12:03:26 +08:00
Nadav Kavalerchik 80de5d08ee MDL-66932 theme/boost: Use LTR directionality to display user % grades 2021-01-20 09:33:23 +02:00
AMOS bot 1d457c78f5 Automatically generated installer lang files 2021-01-17 00:07:49 +00:00
Sujith Haridasan e2c94750fb MDL-57020 scales: Allow deletion of unused scales in forum
Allow deletion of unused scales used in a
forum for the course.

Signed-off-by: Sujith Haridasan <sujith@moodle.com>
2021-01-15 15:05:51 +05:30
Shamim Rezaie e49f9e46aa MDL-70625 core_calendar: Fix whitespace appearance in the id attribute 2021-01-14 01:59:18 +11:00
Tim Hunt 9055c9e213 MDL-70574 qtype_multianswer: fractional scores should be possible 2021-01-11 17:38:10 +00:00
Juan Leyva dde5a7882c MDL-70340 mod_workshop: Do not apply format to peer comments
This text is not directly output to final users, it is used just in the textarea in both the site and the app.
Applying format, case issues like adding glossary links etc...
2020-11-27 18:16:31 +01:00
811 changed files with 17401 additions and 7787 deletions
+1 -1
View File
@@ -89,4 +89,4 @@ theme/boost/amd/src/bootstrap/toast.js
theme/boost/amd/src/bootstrap/tooltip.js
theme/boost/amd/src/bootstrap/util.js
theme/boost/amd/src/tether.js
theme/boost/scss/fontawesome/
theme/boost/scss/fontawesome/
+15 -1
View File
@@ -1,6 +1,12 @@
name: Core
on: [push]
on:
push:
branches-ignore:
- master
- MOODLE_[0-9]+_STABLE
tags-ignore:
- v[0-9]+.[0-9]+.[0-9]+*
env:
php: 7.4
@@ -49,9 +55,16 @@ jobs:
include:
- os: ubuntu-18.04
php: 7.2
# Need to disable both redis and memcached (both are optional) in order to keep igbinary installed.
# (there are dependencies that become broken if we just switch the igbinary version).
# Need to do this for php 7.2 because of a bug with current default igbinary
# versions used by GHA being >= 3.2.2 and <= 3.2.4 (buggy ones).
# TODO: MDL-72399 - Revert this patch once igbinary 3.2.5 or up is the default @ GHA.
extensions: :redis, :memcached, igbinary-3.2.6
db: mysqli
- os: ubuntu-18.04
php: 7.4
extensions:
db: pgsql
steps:
@@ -82,6 +95,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ matrix.extensions }}
coverage: none
- name: Checking out code from ${{ env.GITHUB_REF_SLUG }}
+1
View File
@@ -44,3 +44,4 @@ composer.phar
/lib/yuilib/*/*/*-coverage.js
atlassian-ide-plugin.xml
/node_modules/
moodle-plugin-ci.phar
+1 -1
View File
@@ -90,4 +90,4 @@ theme/boost/amd/src/bootstrap/toast.js
theme/boost/amd/src/bootstrap/tooltip.js
theme/boost/amd/src/bootstrap/util.js
theme/boost/amd/src/tether.js
theme/boost/scss/fontawesome/
theme/boost/scss/fontawesome/
+7 -1
View File
@@ -10,7 +10,7 @@ language: php
os: linux
dist: xenial
dist: bionic
services:
- mysql
@@ -19,6 +19,12 @@ services:
addons:
postgresql: "9.6"
branches:
except:
- master
- /MOODLE_[0-9]+_STABLE/
- /^v[0-9]+\.[0-9]+\.[0-9]+.*/
jobs:
# Enable fast finish.
# This will fail the build if a single job fails (except those in allow_failures).
+2 -2
View File
@@ -424,7 +424,7 @@ module.exports = function(grunt) {
'*/**/yui/src/*/meta/',
'*/**/build/',
].concat(thirdPartyPaths);
grunt.file.write('.eslintignore', eslintIgnores.join('\n'));
grunt.file.write('.eslintignore', eslintIgnores.join('\n') + '\n');
// Generate .stylelintignore.
const stylelintIgnores = [
@@ -433,7 +433,7 @@ module.exports = function(grunt) {
'theme/boost/style/moodle.css',
'theme/classic/style/moodle.css',
].concat(thirdPartyPaths);
grunt.file.write('.stylelintignore', stylelintIgnores.join('\n'));
grunt.file.write('.stylelintignore', stylelintIgnores.join('\n') + '\n');
};
/**
+1
View File
@@ -0,0 +1 @@
mod/forum/tests/behat/forum_subscriptions_default.feature
+1 -1
View File
@@ -2,7 +2,7 @@ MOODLE TRADEMARKS POLICY
========================
The word "Moodle" is trademarked in many countries around the world. The word
was originally an acronym: Modular Object-Oriented Dynamic Learning
was originally coined as an acronym: Modular Object-Oriented Dynamic Learning
Environment. The trademark is owned by Martin Dougiamas, Founder and Director
of Moodle.
+138
View File
@@ -0,0 +1,138 @@
<?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/>.
/**
* Fix orphaned calendar events that were broken by MDL-67494.
*
* This script will look for all the calendar events which userids
* where broken by a wrong upgrade step, affecting to Moodle 3.9.5
* and up.
*
* It performs checks to both:
* a) Detect if the site was affected (ran the wrong upgrade step).
* b) Look for orphaned calendar events, categorising them as:
* - standard: site / category / course / group / user events
* - subscription: events created via subscriptions.
* - action: normal action events, created to show common important dates.
* - override: user and group override events, particular, that some activities support.
* - custom: other events, not being any of the above, common or particular.
* By specifying it (--fix) try to recover as many broken events (missing userid) as
* possible. Standard, subscription, action, override events in core are fully supported but
* override or custom events should be fixed by each plugin as far as there isn't any standard
* API (plugin-wise) to launch a rebuild of the calendar events.
*
* @package core
* @copyright 2021 onwards Simey Lameze <simey@moodle.com>
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define('CLI_SCRIPT', true);
require_once(__DIR__ . '/../../config.php');
require_once($CFG->libdir . "/clilib.php");
require_once($CFG->libdir . '/db/upgradelib.php');
// Supported options.
$long = ['fix' => false, 'help' => false];
$short = ['f' => 'fix', 'h' => 'help'];
// CLI options.
[$options, $unrecognized] = cli_get_params($long, $short);
if ($unrecognized) {
$unrecognized = implode("\n ", $unrecognized);
cli_error(get_string('cliunknowoption', 'admin', $unrecognized));
}
if ($options['help']) {
$help = <<<EOT
Fix orphaned calendar events.
This script detects calendar events that have had their
userid lost. By default it will perform various checks
and report them, showing the site status in an easy way.
Also, optionally (--fix), it wil try to recover as many
lost userids as possible from different sources. Note that
this script aims to process well-know events in core,
leaving custom events in 3rd part plugins mostly unmodified
because there isn't any consistent way to regenerate them.
For more details: https://tracker.moodle.org/browse/MDL-71156
Options:
-h, --help Print out this help.
-f, --fix Fix the orphaned calendar events in the DB.
If not specified only check and report problems to STDERR.
Usage:
- Only report: \$ sudo -u www-data /usr/bin/php admin/cli/fix_orphaned_calendar_events.php
- Report and fix: \$ sudo -u www-data /usr/bin/php admin/cli/fix_orphaned_calendar_events.php -f
EOT;
cli_writeln($help);
die;
}
// Check various usual pre-requisites.
if (empty($CFG->version)) {
cli_error('Database is not yet installed.');
}
$admin = get_admin();
if (!$admin) {
cli_error('Error: No admin account was found.');
}
if (moodle_needs_upgrading()) {
cli_error('Moodle upgrade pending, script execution suspended.');
}
// Do everything as admin by default.
\core\session\manager::set_user($admin);
// Report current site status.
cli_heading('Checking the site status');
$needsfix = upgrade_calendar_site_status();
// Report current calendar events status.
cli_heading('Checking the calendar events status');
$info = upgrade_calendar_events_status();
$hasbadevents = $info['total']->bad > 0 || $info['total']->bad != $info['other']->bad;
$needsfix = $needsfix || $hasbadevents;
// If, selected, fix as many calendar events as possible.
if ($options['fix']) {
// If the report has told us that the fix was not needed... ask for confirmation!
if (!$needsfix) {
cli_writeln("This site DOES NOT NEED to run the calendar events fix.");
$input = cli_input('Are you completely sure that you want to run the fix? (y/N)', 'N', ['y', 'Y', 'n', 'N']);
if (strtolower($input) != 'y') {
exit(0);
}
cli_writeln("");
}
cli_heading('Fixing as many as possible calendar events');
upgrade_calendar_events_fix_remaining($info);
// Report current (after fix) calendar events status.
cli_heading('Checking the calendar events status (after fix)');
upgrade_calendar_events_status();
} else if ($needsfix) {
// Fix option was not provided but problem events have been found. Notify the user and provide info how to fix these events.
cli_writeln("This site NEEDS to run the calendar events fix!");
cli_writeln("To fix the calendar events, re-run this script with the --fix option.");
}
+8 -8
View File
@@ -119,7 +119,7 @@ if (!empty($options['collation'])) {
if ($dbcollation->value !== $collation || $dbcharset->value !== $charset) {
// Try to convert the DB.
echo "Converting database to '$collation' for $CFG->wwwroot:\n";
$sql = "ALTER DATABASE $CFG->dbname DEFAULT CHARACTER SET $charset DEFAULT COLLATE = $collation";
$sql = "ALTER DATABASE `$CFG->dbname` DEFAULT CHARACTER SET $charset DEFAULT COLLATE = $collation";
try {
$DB->change_database_structure($sql);
} catch (exception $e) {
@@ -146,7 +146,7 @@ if (!empty($options['collation'])) {
} else {
try {
$DB->change_database_structure("ALTER TABLE $table->name CONVERT TO CHARACTER SET $charset COLLATE $collation");
$DB->change_database_structure("ALTER TABLE `$table->name` CONVERT TO CHARACTER SET $charset COLLATE $collation");
echo "CONVERTED\n";
$converted++;
} catch (ddl_exception $e) {
@@ -163,7 +163,7 @@ if (!empty($options['collation'])) {
}
}
$sql = "SHOW FULL COLUMNS FROM $table->name WHERE collation IS NOT NULL";
$sql = "SHOW FULL COLUMNS FROM `$table->name` WHERE collation IS NOT NULL";
$rs2 = $DB->get_recordset_sql($sql);
foreach ($rs2 as $column) {
$column = (object)array_change_key_case((array)$column, CASE_LOWER);
@@ -181,7 +181,7 @@ if (!empty($options['collation'])) {
$notnull = ($column->null === 'NO') ? 'NOT NULL' : 'NULL';
$default = (!is_null($column->default) and $column->default !== '') ? "DEFAULT '$column->default'" : '';
// primary, unique and inc are not supported for texts
$sql = "ALTER TABLE $table->name
$sql = "ALTER TABLE `$table->name`
MODIFY COLUMN $column->field $column->type
CHARACTER SET $charset
COLLATE $collation $notnull $default";
@@ -192,11 +192,11 @@ if (!empty($options['collation'])) {
$default = !is_null($column->default) ? "DEFAULT '$column->default'" : '';
if ($rowformat != '') {
$sql = "ALTER TABLE $table->name $rowformat";
$sql = "ALTER TABLE `$table->name` $rowformat";
$DB->change_database_structure($sql);
}
$sql = "ALTER TABLE $table->name
$sql = "ALTER TABLE `$table->name`
MODIFY COLUMN $column->field $column->type
CHARACTER SET $charset
COLLATE $collation $notnull $default";
@@ -315,8 +315,8 @@ function mysql_set_row_format($tablename, $charset, $collation, $engine) {
if ($rs->row_format == 'Compact' || $rs->row_format == 'Redundant') {
$rowformat = $DB->get_row_format_sql($engine, $collation);
// Try to convert to compressed format and then try updating the collation again.
$DB->change_database_structure("ALTER TABLE $tablename $rowformat");
$DB->change_database_structure("ALTER TABLE $tablename CONVERT TO CHARACTER SET $charset COLLATE $collation");
$DB->change_database_structure("ALTER TABLE `$tablename` $rowformat");
$DB->change_database_structure("ALTER TABLE `$tablename` CONVERT TO CHARACTER SET $charset COLLATE $collation");
} else {
// Row format may not be the problem. Can not diagnose problem. Send fail reply.
return false;
+2 -2
View File
@@ -158,7 +158,7 @@ if (!empty($options['info'])) {
}
foreach ($fixtables as $table) {
$DB->change_database_structure("ALTER TABLE {$prefix}$table ROW_FORMAT=Compressed");
$DB->change_database_structure("ALTER TABLE `{$prefix}$table` ROW_FORMAT=Compressed");
echo str_pad($prefix . $table, 32, ' ', STR_PAD_RIGHT) . " ... Compressed\n";
}
@@ -189,7 +189,7 @@ if (!empty($options['info'])) {
echo "SET GLOBAL innodb_file_per_table=1;\n";
echo "SET GLOBAL innodb_file_format=Barracuda;\n";
foreach ($fixtables as $table) {
echo "ALTER TABLE {$prefix}$table ROW_FORMAT=Compressed;\n";
echo "ALTER TABLE `{$prefix}$table` ROW_FORMAT=Compressed;\n";
}
echo "\n";
exit(0);
+201 -1
View File
@@ -2815,6 +2815,7 @@
<VENDOR name="oracle" version="11.2" />
</DATABASE>
<PHP version="7.1.0" level="required">
<RESTRICT function="restrict_php_version_80" message="unsupportedphpversion80" />
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
@@ -2996,6 +2997,7 @@
<VENDOR name="oracle" version="11.2" />
</DATABASE>
<PHP version="7.2.0" level="required">
<RESTRICT function="restrict_php_version_80" message="unsupportedphpversion80" />
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
@@ -3161,6 +3163,11 @@
<ON_CHECK message="sixtyfourbitswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_igbinary322_version" level="optional">
<FEEDBACK>
<ON_CHECK message="igbinary322buggyversion" />
</FEEDBACK>
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
<MOODLE version="3.10" requires="3.5">
@@ -3177,6 +3184,7 @@
<VENDOR name="oracle" version="11.2" />
</DATABASE>
<PHP version="7.2.0" level="required">
<RESTRICT function="restrict_php_version_80" message="unsupportedphpversion80" />
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
@@ -3342,6 +3350,11 @@
<ON_CHECK message="sixtyfourbitswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_igbinary322_version" level="optional">
<FEEDBACK>
<ON_CHECK message="igbinary322buggyversion" />
</FEEDBACK>
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
<MOODLE version="3.11" requires="3.6">
@@ -3444,7 +3457,7 @@
</PHP_EXTENSION>
<PHP_EXTENSION name="hash" level="required"/>
<PHP_EXTENSION name="fileinfo" level="required"/>
<PHP_EXTENSION name="sodium" level="required"/>
<PHP_EXTENSION name="sodium" level="optional"/>
</PHP_EXTENSIONS>
<PHP_SETTINGS>
<PHP_SETTING name="memory_limit" value="96M" level="required">
@@ -3524,6 +3537,193 @@
<ON_CHECK message="sixtyfourbitswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_max_input_vars" level="optional">
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
<MOODLE version="4.0" requires="3.6">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mariadb" version="10.2.29" />
<VENDOR name="mysql" version="5.7" />
<VENDOR name="postgres" version="10" />
<VENDOR name="mssql" version="14.0" />
<VENDOR name="oracle" version="11.2" />
</DATABASE>
<PHP version="7.3.0" 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="required">
<FEEDBACK>
<ON_ERROR message="mbstringrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="required">
<FEEDBACK>
<ON_ERROR message="curlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="required">
<FEEDBACK>
<ON_ERROR message="opensslrequired" />
</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="required">
<FEEDBACK>
<ON_ERROR message="intlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="json" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="hash" level="required"/>
<PHP_EXTENSION name="fileinfo" level="required"/>
<PHP_EXTENSION name="sodium" level="optional"/>
<PHP_EXTENSION name="exif" level="optional"/>
</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_CHECK file="lib/upgradelib.php" function="check_mysql_file_format" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbfileformat" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_file_per_table" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbfilepertable" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_large_prefix" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddblargeprefix" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_is_https" level="optional">
<FEEDBACK>
<ON_CHECK message="ishttpswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_incomplete_unicode_support" level="optional">
<FEEDBACK>
<ON_CHECK message="incompleteunicodesupport" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_sixtyfour_bits" level="optional">
<FEEDBACK>
<ON_CHECK message="sixtyfourbitswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_max_input_vars" level="optional">
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
</COMPATIBILITY_MATRIX>
+2 -5
View File
@@ -53,11 +53,8 @@ class behat_admin extends behat_base {
}
foreach ($data as $label => $value) {
$this->execute('behat_navigation::i_select_from_flat_navigation_drawer', [get_string('administrationsite')]);
// Search by label.
$this->execute('behat_forms::i_set_the_field_to', [get_string('query', 'admin'), $label]);
$this->execute("behat_forms::press_button", get_string('search', 'admin'));
// Navigate straight to the search results fo rthis label.
$this->execute('behat_general::i_visit', ["/admin/search.php?query=" . urlencode($label)]);
// Admin settings does not use the same DOM structure than other moodle forms
// but we also need to use lib/behat/form_field/* to deal with the different moodle form elements.
+5 -4
View File
@@ -45,7 +45,7 @@ list($options, $unrecognised) = cli_get_params(
array(
'stop-on-failure' => 0,
'verbose' => false,
'replace' => false,
'replace' => '',
'help' => false,
'tags' => '',
'profile' => '',
@@ -70,7 +70,7 @@ $help = "
Behat utilities to run behat tests in parallel
Usage:
php run.php [--BEHAT_OPTION=\"value\"] [--feature=\"value\"] [--replace] [--fromrun=value --torun=value] [--help]
php run.php [--BEHAT_OPTION=\"value\"] [--feature=\"value\"] [--replace=\"{run}\"] [--fromrun=value --torun=value] [--help]
Options:
--BEHAT_OPTION Any combination of behat option specified in http://behat.readthedocs.org/en/v2.5/guides/6.cli.html
@@ -144,9 +144,10 @@ $extraopts = $unrecognised;
if ($options['profile']) {
$profile = $options['profile'];
// If profile passed is not set, then exit.
// If profile passed is not set, then exit (note we skip if the 'replace' option is found within the 'profile' value).
if (!isset($CFG->behat_config[$profile]) && !isset($CFG->behat_profiles[$profile]) &&
!(isset($options['replace']) && (strpos($options['profile'], $options['replace']) >= 0 ))) {
!($options['replace'] && (strpos($profile, (string) $options['replace']) !== false))) {
echo "Invalid profile passed: " . $profile . PHP_EOL;
exit(1);
}
+1
View File
@@ -46,6 +46,7 @@ $string['stepsdefinitionstype'] = 'Type';
$string['theninfo'] = 'Then. Checkings to ensure the outcomes are the expected ones';
$string['unknownexceptioninfo'] = 'There was a problem with Selenium or your browser. Please ensure you are using the latest version of Selenium. Error:';
$string['viewsteps'] = 'Filter';
$string['warndirrootconfigfound'] = 'A configuration file was found at {$a}. This file is not automatically updated and may become stale. We recommend removing this file.';
$string['wheninfo'] = 'When. Action that provokes an event';
$string['wrongbehatsetup'] = 'Something is wrong with the behat setup and so step definitions cannot be listed: <b>{$a->errormsg}</b><br/><br/>Please check:<ul>
<li>$CFG->behat_dataroot, $CFG->behat_prefix and $CFG->behat_wwwroot are set in config.php with different values from $CFG->dataroot, $CFG->prefix and $CFG->wwwroot.</li>
@@ -156,7 +156,7 @@ Feature: Set up contextual data for tests
And I log in as "user5"
And I should see "You are logged in as"
And I am on "Course 1" course homepage
And I should see "You can not enrol yourself in this course."
And I should see "You cannot enrol yourself in this course."
Scenario: Add modules
Given the following "courses" exist:
@@ -21,5 +21,5 @@ Feature: Transform date time string arguments
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
And I should see "##yesterday##l, j F Y##"
And I should see "##yesterday##%A, %d %B %Y##"
And I log out
@@ -48,7 +48,7 @@ Feature: Verify that all form fields values can be get and set
And the "Unenrol users" select box should not contain "Baker"
And the "Unenrol users" select box should not contain "President, Baker"
And I am on "Course 1" course homepage with editing mode on
And I follow "Test this one"
And I am on the "Test this one" "wiki activity" page
And I press "Create page"
# Text (textarea & editor) & Select (multi-select) - Checking "I set the following fields to these values".
When I set the following fields to these values:
@@ -61,8 +61,7 @@ Feature: Verify that all form fields values can be get and set
# Checkbox - Checking "I set the field" and "The field matches value" ticked.
And I set the field "Force format" to "1"
And I press "Save and return to course"
And I should see "Test this one"
And I follow "Test this one"
And I am on the "Test this one" "wiki activity" page
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
And the field "Force format" matches value "1"
@@ -70,8 +69,7 @@ Feature: Verify that all form fields values can be get and set
# Checkbox - Checking "I set the field" and "The field matches value" unticked.
And I set the field "Force format" to ""
And I press "Save and return to course"
And I should see "Test this one"
And I follow "Test this one"
And I am on the "Test this one" "wiki activity" page
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
And the field "Force format" matches value ""
@@ -80,8 +78,7 @@ Feature: Verify that all form fields values can be get and set
And I set the following fields to these values:
| Force format | 1 |
And I press "Save and return to course"
And I should see "Test this one"
And I follow "Test this one"
And I am on the "Test this one" "wiki activity" page
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
And the following fields match these values:
@@ -92,8 +89,7 @@ Feature: Verify that all form fields values can be get and set
And I set the following fields to these values:
| Force format | |
And I press "Save and return to course"
And I should see "Test this one"
And I follow "Test this one"
And I am on the "Test this one" "wiki activity" page
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
And the following fields match these values:
@@ -115,20 +111,21 @@ Feature: Verify that all form fields values can be get and set
| Wiki name | Test this one baby |
| Default format | HTML |
And I press "Cancel"
And I am on "Course 1" course homepage
# Radio - Checking "I set the field" and "the field matches value".
And I add a "Choice" to section "1" and I fill the form with:
| Choice name | Test choice name |
| Description | Test choice description |
| Allow choice to be updated | Yes |
| Option 1 | one |
| Option 2 | two |
| Option 3 | three |
And I follow "Test choice name"
And I set the field "one" to "1"
And the following "activity" exists:
| activity | choice |
| course | C1 |
| idnumber | choice1 |
| intro | Test choice description |
| name | Test choice name |
| option | Option 1, Option 2, Option 3 |
| section | 1 |
| allowupdate | 1 |
And I am on the "Test choice name" "choice activity" page
And I set the field "Option 1" to "1"
And I press "Save my choice"
And the field "one" matches value "1"
And the field "two" matches value ""
And the field "Option 1" matches value "1"
And the field "Option 2" matches value ""
# Check if field xpath set/match works.
And I am on "Course 1" course homepage
And I navigate to "Edit settings" in current page administration
@@ -174,31 +171,23 @@ Feature: Verify that all form fields values can be get and set
And I press "Cancel"
# Advanced checkbox requires real browser to allow uncheck to work. MDL-58681. MDL-55386.
# Advanced checkbox - Checking "I set the field" and "The field matches value" ticked.
And I am on "Course 1" course homepage
And I follow "Test this one"
And I navigate to "Edit settings" in current page administration
And I am on the "Test choice name" "choice activity editing" page
And I set the field "Display description on course page" to "1"
And I press "Save and return to course"
And I should see "Test this one"
And I follow "Test this one"
And I navigate to "Edit settings" in current page administration
And I am on the "Test choice name" "choice activity editing" page
And the field "Display description on course page" matches value "1"
And the field "Display description on course page" does not match value ""
# Advanced checkbox - Checking "I set the field" and "The field matches value" unticked.
And I set the field "Display description on course page" to ""
And I press "Save and return to course"
And I should see "Test this one"
And I follow "Test this one"
And I navigate to "Edit settings" in current page administration
And I am on the "Test choice name" "choice activity editing" page
And the field "Display description on course page" matches value ""
And the field "Display description on course page" does not match value "1"
# Advanced checkbox - Checking "I set the following fields to these values:" and "The following fields match these values" ticked.
And I set the following fields to these values:
| Display description on course page | 1 |
And I press "Save and return to course"
And I should see "Test this one"
And I follow "Test this one"
And I navigate to "Edit settings" in current page administration
And I am on the "Test choice name" "choice activity editing" page
And the following fields match these values:
| Display description on course page | 1 |
And the following fields do not match these values:
@@ -207,9 +196,7 @@ Feature: Verify that all form fields values can be get and set
And I set the following fields to these values:
| Display description on course page | |
And I press "Save and return to course"
And I should see "Test this one"
And I follow "Test this one"
And I navigate to "Edit settings" in current page administration
And I am on the "Test choice name" "choice activity editing" page
And the following fields match these values:
| Display description on course page | |
And the following fields do not match these values:
@@ -0,0 +1,85 @@
@tool @tool_behat
Feature: Use core page resolvers for the I am on the page steps
In order to write tests correctly
As a developer
I need to have steps which take me straight to a page
Scenario Outline: When I am on an instance
Given the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
And the following "course" exists:
| fullname | Economics 101 |
| shortname | ECON101 |
| idnumber | 2021-econ101 |
And the following "activity" exists:
| course | ECON101 |
| activity | forum |
| name | Fundamentals of Economics |
| idnumber | fundamentalsofeconomics |
And I log in as "admin"
When I am on the <identifier> <type> page
Then I should see "<shouldsee>"
Examples:
| description | identifier | type | shouldsee |
| Course Category idnumber | CAT1 | category | Add a new course |
| Course Category name | "Cat 1" | Category | Add a new course |
| Course Full name | "Economics 101" | course | Fundamentals of Economics |
| Course Short name | ECON101 | COURSE | Fundamentals of Economics |
| Course idnumber | "2021-econ101" | Course | Fundamentals of Economics |
| Forum idnumber | fundamentalsofeconomics | Activity | Add a new discussion |
| Generic activity editing | fundamentalsofeconomics | "Activity editing" | Updating: Forum |
| Forum name | "Fundamentals of Economics" | "Forum activity" | Add a new discussion |
| Forum name editing | "Fundamentals of Economics" | "Forum activity editing" | Updating: Forum |
| Forum name permissions | "Fundamentals of Economics" | "Forum activity permissions" | Permissions in Forum: Fun |
| Forum name roles | "Fundamentals of Economics" | "Forum activity roles" | Assign roles in Forum: Fun |
Scenario Outline: When I am on an instance logged in as
Given the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
And the following "course" exists:
| fullname | Economics 101 |
| shortname | ECON101 |
| idnumber | 2021-econ101 |
And the following "activity" exists:
| course | ECON101 |
| activity | forum |
| name | Fundamentals of Economics |
| idnumber | fundamentalsofeconomics |
When I am on the <identifier> <type> page logged in as admin
Then I should see "<shouldsee>"
Examples:
| description | identifier | type | shouldsee |
| Course Category idnumber | CAT1 | category | Add a new course |
| Course Category name | "Cat 1" | Category | Add a new course |
| Course Full name | "Economics 101" | course | Fundamentals of Economics |
| Course Short name | ECON101 | COURSE | Fundamentals of Economics |
| Course idnumber | "2021-econ101" | Course | Fundamentals of Economics |
| Forum idnumber | fundamentalsofeconomics | Activity | Add a new discussion |
| Generic activity editing | fundamentalsofeconomics | "Activity editing" | Updating: Forum |
| Forum name | "Fundamentals of Economics" | "Forum activity" | Add a new discussion |
| Forum name editing | "Fundamentals of Economics" | "Forum activity editing" | Updating: Forum |
| Forum name permissions | "Fundamentals of Economics" | "Forum activity permissions" | Permissions in Forum: Fun |
| Forum name roles | "Fundamentals of Economics" | "Forum activity roles" | Assign roles in Forum: Fun |
Scenario Outline: When I am on a named page
Given I log in as "admin"
When I am on the <identifier> page
Then I should see "<shouldsee>"
Examples:
| description | identifier | shouldsee |
| Admin page | "Admin notifications" | Check for available updates |
| Home page | Homepage | Recently accessed courses |
Scenario Outline: When I am on a named page logged in as
When I am on the <identifier> page logged in as admin
Then I should see "<shouldsee>"
Examples:
| description | identifier | shouldsee |
| Admin page | "Admin notifications" | Check for available updates |
| Home page | Homepage | Recently accessed courses |
@@ -14,8 +14,6 @@ Feature: Forms manipulation
Then the field "First name" matches value "Field value"
And the "Select a country" select box should contain "Japan"
And the field "New password" matches value "TestPass"
And I take focus off "Update profile" "button"
And I press "Update profile"
@javascript
Scenario: Expand all fieldsets and advanced elements
@@ -60,12 +60,12 @@ class tool_capability_settings_form extends moodleform {
$form->addElement('select', 'roles', get_string('roleslabel', 'tool_capability'), $roles, $attributes);
$form->setType('roles', PARAM_TEXT);
$form->addElement('checkbox', 'onlydiff',
get_string('filters', 'tool_capability'),
get_string('onlydiff', 'tool_capability'));
$filters = [];
$filters[] = $form->createElement('checkbox', 'onlydiff', get_string('onlydiff', 'tool_capability'));
$form->setType('onlydiff', PARAM_BOOL);
$form->addGroup($filters, 'filters', get_string('filters', 'tool_capability'), array('<br>'), false);
$form->addElement('submit', 'submitbutton', get_string('getreport', 'tool_capability'));
}
}
}
+11 -2
View File
@@ -53,7 +53,12 @@ function tool_capability_calculate_role_data($capability, array $roles) {
$sql = 'SELECT DISTINCT con.path, 1
FROM {context} con
JOIN {role_capabilities} rc ON rc.contextid = con.id
WHERE capability = ? '.$sqlroletest;
WHERE capability = ? ' .
$sqlroletest .
// Context path should never be null, but can happen in old database with
// bad data (e.g. a course_module where the corresponding course no longer exists).
// We need to leave these out of the report to prevent errors.
' AND con.path IS NOT NULL';
$relevantpaths = $DB->get_records_sql_menu($sql, $params);
$requiredcontexts = array($systemcontext->id);
foreach ($relevantpaths as $path => $notused) {
@@ -88,6 +93,10 @@ function tool_capability_calculate_role_data($capability, array $roles) {
// Put the role capabilities into the context tree.
foreach ($rolecaps as $rolecap) {
if (!isset($contexts[$rolecap->contextid])) {
// Skip capabilities in orphaned contexts that are not in the tree.
continue;
}
$contexts[$rolecap->contextid]->rolecapabilities[$rolecap->roleid] = $rolecap->permission;
}
@@ -99,4 +108,4 @@ function tool_capability_calculate_role_data($capability, array $roles) {
}
return $contexts;
}
}
@@ -0,0 +1,88 @@
<?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/>.
/**
* Tests for the capability overview helper functions.
*
* @package tool_capability
* @copyright 2021 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later.
*/
defined('MOODLE_INTERNAL') || die();
global $CFG;
require_once($CFG->dirroot . '/' . $CFG->admin . '/tool/capability/locallib.php');
/**
* Tests for the capability overview helper functions.
*/
class tool_capability_locallib_testcase extends advanced_testcase {
/**
* Test the function that gets the data - simple case.
*/
public function test_tool_capability_calculate_role_data() {
global $DB;
$data = tool_capability_calculate_role_data('mod/quiz:attempt', get_all_roles());
$systcontext = context_system::instance();
$studentroleid = $DB->get_field('role', 'id', ['shortname' => 'student']);
$this->assertArrayHasKey($systcontext->id, $data);
$this->assertCount(1, $data);
foreach ($data[$systcontext->id]->rolecapabilities as $roleid => $permission) {
if ($roleid == $studentroleid) {
$this->assertEquals(CAP_ALLOW, $permission);
} else {
$this->assertEquals(CAP_INHERIT, $permission);
}
}
}
/**
* Test the function that gets the data - simple case.
*/
public function test_tool_capability_calculate_role_data_orphan_contexts() {
global $DB;
$this->resetAfterTest();
// This simulates a situation that seems to happen sometimes, where
// we end up with contexts with path = NULL in the database.
$systcontext = context_system::instance();
$generator = $this->getDataGenerator();
$course = $generator->create_course();
$coursecontext = context_course::instance($course->id);
$studentroleid = $DB->get_field('role', 'id', ['shortname' => 'student']);
role_change_permission($studentroleid, $coursecontext, 'mod/quiz:attempt', CAP_PREVENT);
// This is where we simulate the breakage.
$DB->set_field('context', 'path', null, ['id' => $coursecontext->id]);
// Now call the function. We mainly just want to know there is no exception.
$data = tool_capability_calculate_role_data('mod/quiz:attempt', get_all_roles());
$this->assertArrayHasKey($systcontext->id, $data);
$this->assertCount(1, $data);
foreach ($data[$systcontext->id]->rolecapabilities as $roleid => $permission) {
if ($roleid == $studentroleid) {
$this->assertEquals(CAP_ALLOW, $permission);
} else {
$this->assertEquals(CAP_INHERIT, $permission);
}
}
}
}
@@ -189,7 +189,12 @@ class cohort_role_assignments_table extends table_sql {
FROM {tool_cohortroles} uca
JOIN {user} u ON u.id = uca.userid
JOIN {cohort} c ON c.id = uca.cohortid";
$params = array();
// Check if any additional filtering is required.
[$sqlwhere, $params] = $this->get_sql_where();
if ($sqlwhere) {
$sql .= " WHERE {$sqlwhere}";
}
// Add order by if needed.
if (!$count && $sqlsort = $this->get_sql_sort()) {
+2 -2
View File
@@ -86,8 +86,8 @@ if ($removeid) {
$title = get_string('existingcohortroles', 'tool_cohortroles');
echo $output->heading($title);
$url = new moodle_url('/admin/tool/cohortroles/index.php');
$table = new tool_cohortroles\output\cohort_role_assignments_table(uniqid(), $url);
$table = new tool_cohortroles\output\cohort_role_assignments_table('cohort-role-assignments', $pageurl);
echo $table->out(50, true);
echo $output->spacer();
+28 -24
View File
@@ -39,7 +39,7 @@ class tool_customlang_utils {
const ROUGH_NUMBER_OF_STRINGS = 16500;
/** @var array cache of {@link self::list_components()} results */
protected static $components = null;
private static $components = null;
/**
* This class can not be instantiated
@@ -54,28 +54,30 @@ class tool_customlang_utils {
*/
public static function list_components() {
$list['moodle'] = 'core';
if (self::$components === null) {
$list['moodle'] = 'core';
$coresubsystems = core_component::get_core_subsystems();
ksort($coresubsystems); // should be but just in case
foreach ($coresubsystems as $name => $location) {
$list[$name] = 'core_'.$name;
}
$coresubsystems = core_component::get_core_subsystems();
ksort($coresubsystems); // Should be but just in case.
foreach ($coresubsystems as $name => $location) {
$list[$name] = 'core_' . $name;
}
$plugintypes = core_component::get_plugin_types();
foreach ($plugintypes as $type => $location) {
$pluginlist = core_component::get_plugin_list($type);
foreach ($pluginlist as $name => $ununsed) {
if ($type == 'mod') {
// Plugin names are now automatically validated.
$list[$name] = $type.'_'.$name;
} else {
$list[$type.'_'.$name] = $type.'_'.$name;
$plugintypes = core_component::get_plugin_types();
foreach ($plugintypes as $type => $location) {
$pluginlist = core_component::get_plugin_list($type);
foreach ($pluginlist as $name => $ununsed) {
if ($type == 'mod') {
// Plugin names are now automatically validated.
$list[$name] = $type . '_' . $name;
} else {
$list[$type . '_' . $name] = $type . '_' . $name;
}
}
}
self::$components = $list;
}
return $list;
return self::$components;
}
/**
@@ -211,14 +213,18 @@ class tool_customlang_utils {
return false;
}
// get all customized strings from updated components
list($insql, $inparams) = $DB->get_in_or_equal(self::list_components());
// Get all customized strings from updated valid components.
$sql = "SELECT s.*, c.name AS component
FROM {tool_customlang} s
JOIN {tool_customlang_components} c ON s.componentid = c.id
WHERE s.lang = ?
AND (s.local IS NOT NULL OR s.modified = 1)
AND c.name $insql
ORDER BY componentid, stringid";
$strings = $DB->get_records_sql($sql, array($lang));
array_unshift($inparams, $lang);
$strings = $DB->get_records_sql($sql, $inparams);
$files = array();
foreach ($strings as $string) {
@@ -336,11 +342,9 @@ EOF
* @return string|boolean filename eg 'moodle.php' or 'workshop.php', false if not found
*/
protected static function get_component_filename($component) {
if (is_null(self::$components)) {
self::$components = self::list_components();
}
$return = false;
foreach (self::$components as $legacy => $normalized) {
foreach (self::list_components() as $legacy => $normalized) {
if ($component === $normalized) {
$return = $legacy.'.php';
break;
@@ -9,10 +9,8 @@ Feature: Manage data requests
| username | firstname | lastname | email |
| student1 | John | Doe | s1@example.com |
| student2 | Jane | Doe | s2@example.com |
And I log in as "admin"
And I set the following administration settings values:
| contactdataprotectionofficer | 1 |
And I log out
And the following config values are set as admin:
| contactdataprotectionofficer | 1 | tool_dataprivacy |
@javascript
Scenario: Marking general enquiries as complete
@@ -5,7 +5,10 @@ Feature: View the httpsreplace report
I need to be able to automatically replace http links
Background: Create some http links
Given I am on site homepage
# This is a slow running feature and on slow databases can take over 30 seconds to complete.
Given I mark this test as slow setting a timeout factor of 2
And I am on site homepage
And the following "courses" exist:
| fullname | shortname | category | summary |
| Course 1 | C1 | 0 | <img src="http://intentionally.unavailable/test.png"> <img src="http://download.moodle.org/unittest/test.jpg"> |
@@ -10,12 +10,10 @@ Feature: Delete custom licenses
And I navigate to "Licence > Licence manager" in site administration
And I click on "Create licence" "link"
And I set the following fields to these values:
| shortname | MIT |
| fullname | MIT Licence |
| source | https://opensource.org/licenses/MIT |
| version[day] | 1 |
| version[month] | March |
| version[year] | 2019 |
| shortname | MIT |
| fullname | MIT Licence |
| source | https://opensource.org/licenses/MIT |
| Licence version | ##1 March 2019## |
And I press "Save changes"
And I click on "Delete" "icon" in the "MIT" "table_row"
When I click on "Save changes" "button" in the "Delete licence" "dialogue"
@@ -9,12 +9,10 @@ Feature: Custom licences
And I navigate to "Licence > Licence manager" in site administration
And I click on "Create licence" "link"
And I set the following fields to these values:
| shortname | MIT |
| fullname | MIT Licence |
| source | https://opensource.org/licenses/MIT |
| version[day] | 1 |
| version[month] | January |
| version[year] | 2020 |
| shortname | MIT |
| fullname | MIT Licence |
| source | https://opensource.org/licenses/MIT |
| Licence version | ##first day of January 2020## |
When I press "Save changes"
Then I should see "Licence manager"
And I should see "MIT Licence" in the "MIT" "table_row"
@@ -25,12 +23,10 @@ Feature: Custom licences
And I navigate to "Licence > Licence manager" in site administration
And I click on "Create licence" "link"
And I set the following fields to these values:
| shortname | MIT |
| fullname | MIT Licence |
| source | opensource.org/licenses/MIT |
| version[day] | 1 |
| version[month] | January |
| version[year] | 2020 |
| shortname | MIT |
| fullname | MIT Licence |
| source | opensource.org/licenses/MIT |
| Licence version | ##2020-01-01## |
When I press "Save changes"
Then I should see "Invalid source URL"
And I set the following fields to these values:
@@ -49,12 +45,10 @@ Feature: Custom licences
And I navigate to "Licence > Licence manager" in site administration
And I click on "Create licence" "link"
And I set the following fields to these values:
| shortname | MIT |
| fullname | MIT Licence |
| source | https://opensource.org/licenses/MIT |
| version[day] | 1 |
| version[month] | March |
| version[year] | 2019 |
| shortname | MIT |
| fullname | MIT Licence |
| source | https://opensource.org/licenses/MIT |
| Licence version | ##1 March 2019## |
When I press "Save changes"
Then I should see "Licence manager"
And I should see "2019030100" in the "MIT" "table_row"
@@ -65,12 +59,10 @@ Feature: Custom licences
And I navigate to "Licence > Licence manager" in site administration
And I click on "Create licence" "link"
And I set the following fields to these values:
| shortname | MIT |
| fullname | MIT Licence |
| source | https://opensource.org/licenses/MIT |
| version[day] | 1 |
| version[month] | March |
| version[year] | 2019 |
| shortname | MIT |
| fullname | MIT Licence |
| source | https://opensource.org/licenses/MIT |
| Licence version | ##1 Mar 2019## |
And I press "Save changes"
And I should see "Licence manager"
And I should see "MIT Licence" in the "MIT" "table_row"
+2
View File
@@ -50,6 +50,7 @@ switch ($action) {
case 'disable':
unset($enabled[$enrol]);
set_config('enabled_stores', implode(',', array_keys($enabled)), 'tool_log');
add_to_config_log('tool_logstore_visibility', '1', '0', $enrol);
break;
case 'enable':
@@ -59,6 +60,7 @@ switch ($action) {
$enabled = array_keys($enabled);
$enabled[] = $enrol;
set_config('enabled_stores', implode(',', $enabled), 'tool_log');
add_to_config_log('tool_logstore_visibility', '0', '1', $enrol);
break;
case 'up':
@@ -0,0 +1,19 @@
@tool_log @report @report_configlog
Feature: In a report, admin can see logstore visibility changes
# Change log stores visibility so the report contains known data.
Background:
Given I log in as "admin"
And the following config values are set as admin:
| enabled_stores | logstore_standard | tool_log |
@javascript
Scenario: Display configuration changes report
When I navigate to "Plugins > Logging > Manage log stores" in site administration
And I click on "Disable" "icon" in the "Standard log" "table_row"
And I click on "Enable" "icon" in the "External database log" "table_row"
And I navigate to "Reports > Config changes" in site administration
Then the following should exist in the "report-configlog-report-table" table:
| User | Plugin | Setting | New value | Original value |
| Admin User | logstore_standard | tool_logstore_visibility | 0 | 1 |
| Admin User | logstore_database | tool_logstore_visibility | 1 | 0 |
@@ -37,67 +37,68 @@
This template does not have an example context because it includes ajax functionality.
}}
<div data-region="user-competency-full-info" data-node="user-competency" data-competencyid="{{usercompetency.competencyid}}" data-userid="{{usercompetency.userid}}" data-region-id="{{uniqid}}">
<div data-region="competency-summary">
{{#competency}}
{{> tool_lp/competency_summary }}
{{/competency}}
<dl>
{{#usercompetency}}
<dt>{{#str}}reviewstatus, tool_lp{{/str}}</dt>
<dd data-region="user-competency-status">{{statusname}}
<div data-region="competency-summary">
{{#competency}}
{{> tool_lp/competency_summary }}
{{/competency}}
<dl>
{{#usercompetency}}
<dt>{{#str}}reviewstatus, tool_lp{{/str}}</dt>
<dd data-region="user-competency-status">{{statusname}}
{{#isstatusinreview}}
- {{reviewer.fullname}}
{{/isstatusinreview}}
{{#isstatusinreview}}
- {{reviewer.fullname}}
{{/isstatusinreview}}
{{#isrequestreviewallowed}}<button class="btn btn-secondary" data-action="request-review">{{#str}}requestreview, tool_lp{{/str}}</button>{{/isrequestreviewallowed}}
{{#iscancelreviewrequestallowed}}<button class="btn btn-secondary" data-action="cancel-review-request">{{#str}}cancelreviewrequest, tool_lp{{/str}}</button>{{/iscancelreviewrequestallowed}}
{{#isstartreviewallowed}}<button class="btn btn-secondary" data-action="start-review">{{#str}}startreview, tool_lp{{/str}}</button>{{/isstartreviewallowed}}
{{#isstopreviewallowed}}<button class="btn btn-secondary" data-action="stop-review">{{#str}}stopreview, tool_lp{{/str}}</button>{{/isstopreviewallowed}}
</dd>
<dt>{{#str}}proficient, tool_lp{{/str}}</dt>
<dd>
<span class="badge {{#proficiency}}badge-success{{/proficiency}}{{^proficiency}}badge-danger{{/proficiency}} float-left">
{{proficiencyname}}
</span>
</dd>
<dt>{{#str}}rating, tool_lp{{/str}}</dt>
<dd>{{gradename}}
{{#cangrade}}
<button class="btn btn-secondary" id="rate_{{uniqid}}">{{#str}}rate, tool_lp{{/str}}</button>
{{/cangrade}}
</dd>
{{#js}}
require(['jquery', 'tool_lp/grade_user_competency_inline', 'tool_lp/user_competency_info', 'tool_lp/user_competency_workflow'], function($, mod, info, UserCompWorkflow) {
{{#isrequestreviewallowed}}<button class="btn btn-secondary" data-action="request-review">{{#str}}requestreview, tool_lp{{/str}}</button>{{/isrequestreviewallowed}}
{{#iscancelreviewrequestallowed}}<button class="btn btn-secondary" data-action="cancel-review-request">{{#str}}cancelreviewrequest, tool_lp{{/str}}</button>{{/iscancelreviewrequestallowed}}
{{#isstartreviewallowed}}<button class="btn btn-secondary" data-action="start-review">{{#str}}startreview, tool_lp{{/str}}</button>{{/isstartreviewallowed}}
{{#isstopreviewallowed}}<button class="btn btn-secondary" data-action="stop-review">{{#str}}stopreview, tool_lp{{/str}}</button>{{/isstopreviewallowed}}
</dd>
<dt>{{#str}}proficient, tool_lp{{/str}}</dt>
<dd>
<span class="badge {{#proficiency}}badge-success{{/proficiency}}{{^proficiency}}badge-danger{{/proficiency}} float-left">
{{proficiencyname}}
</span>
</dd>
<dt>{{#str}}rating, tool_lp{{/str}}</dt>
<dd>{{gradename}}
{{#cangrade}}
<button class="btn btn-secondary" id="rate_{{uniqid}}">{{#str}}rate, tool_lp{{/str}}</button>
{{/cangrade}}
</dd>
{{#js}}
require(['jquery', 'tool_lp/grade_user_competency_inline', 'tool_lp/user_competency_info', 'tool_lp/user_competency_workflow'], function($, mod, info, UserCompWorkflow) {
var competencyElement = $('[data-region-id="{{uniqid}}"]');
var infoReloader = new info(competencyElement, '{{competency.competency.id}}', '{{user.id}}');
var competencyElement = $('[data-region-id="{{uniqid}}"]');
var infoReloader = new info(competencyElement, '{{competency.competency.id}}', '{{user.id}}');
var ucw = new UserCompWorkflow();
ucw.registerEvents('[data-region="user-competency-status"]');
ucw.on('status-changed', infoReloader.reload.bind(infoReloader));
ucw.on('error-occured', infoReloader.reload.bind(infoReloader));
var ucw = new UserCompWorkflow();
ucw.registerEvents('[data-region="user-competency-status"]');
ucw.on('status-changed', infoReloader.reload.bind(infoReloader));
ucw.on('error-occured', infoReloader.reload.bind(infoReloader));
var inlineGrader = new mod('#rate_{{uniqid}}', '{{competency.scaleid}}', '{{competency.competency.id}}', '{{user.id}}', '{{plan.id}}', '', '{{#str}}chooserating, tool_lp{{/str}}');
inlineGrader.on('competencyupdated', infoReloader.reload.bind(infoReloader));
});
{{/js}}
{{/usercompetency}}
</dl>
{{#commentarea}}
{{#canpostorhascomments}}
{{>tool_lp/comment_area}}
{{/canpostorhascomments}}
{{/commentarea}}
<dl data-region="evidence-listing">
<dt>{{#str}}evidence, tool_lp{{/str}}</dt>
<dd>
{{#evidence}}
{{> tool_lp/evidence_summary }}
{{/evidence}}
{{^evidence}}
<p>{{#str}}noevidence, tool_lp{{/str}}</p>
{{/evidence}}
</dd>
</dl>
var inlineGrader = new mod('#rate_{{uniqid}}', '{{competency.scaleid}}', '{{competency.competency.id}}', '{{user.id}}', '{{plan.id}}', '', '{{#str}}chooserating, tool_lp{{/str}}');
inlineGrader.on('competencyupdated', infoReloader.reload.bind(infoReloader));
});
{{/js}}
{{/usercompetency}}
</dl>
{{#commentarea}}
{{#canpostorhascomments}}
{{>tool_lp/comment_area}}
{{/canpostorhascomments}}
{{/commentarea}}
<dl data-region="evidence-listing">
<dt>{{#str}}evidence, tool_lp{{/str}}</dt>
<dd>
{{#evidence}}
{{> tool_lp/evidence_summary }}
{{/evidence}}
{{^evidence}}
<p>{{#str}}noevidence, tool_lp{{/str}}</p>
{{/evidence}}
</dd>
</dl>
</div>
</div>
@@ -24,9 +24,7 @@ Feature: See the competencies for an activity on the course competencies page.
| activity | name | intro | course | idnumber | completion | completionview |
| page | PageName1 | PageDesc1 | C1 | PAGE1 | 1 | 1 |
| page | PageName2 | PageDesc2 | C1 | PAGE2 | 1 | 1 |
And I log in as "admin"
And I am on site homepage
And I follow "Course 1"
And I am on the "Course 1" course page logged in as admin
And I follow "Competencies"
And I press "Add competencies to course"
And "Competency picker" "dialogue" should be visible
@@ -36,9 +34,7 @@ Feature: See the competencies for an activity on the course competencies page.
And "Competency picker" "dialogue" should be visible
And I select "Test-Comp2" of the competency tree
And I click on "Add" "button" in the "Competency picker" "dialogue"
And I am on "Course 1" course homepage
And I follow "PageName1"
And I navigate to "Edit settings" in current page administration
And I am on the PageName1 "page activity editing" page
And I follow "Expand all"
And I set the field "Course competencies" to "Test-Comp1"
And I press "Save and return to course"
@@ -46,10 +42,8 @@ Feature: See the competencies for an activity on the course competencies page.
@javascript
Scenario: Go to the competency course competencies page.
When I log in as "student1"
And I am on site homepage
And I follow "Course 1"
And I follow "Competencies"
Given I am on the "Course 1" course page logged in as student1
When I follow "Competencies"
Then I should see "Test-Comp1"
And I should see "Test-Comp2"
And I set the field "Filter competencies by resource or activity" to "PageName1"
@@ -64,12 +58,5 @@ Feature: See the competencies for an activity on the course competencies page.
@javascript
Scenario: None course competencies page.
When I log in as "student1"
And I am on site homepage
And I follow "Course 1"
And I follow "PageName1"
Then I should see "Test page content"
And I am on site homepage
And I follow "Course 1"
And I follow "PageName1"
When I am on the PageName1 "page activity" page logged in as student1
Then I should see "Test page content"
+1 -1
View File
@@ -221,7 +221,7 @@ class api {
}
// Identity providers.
$authsequence = get_enabled_auth_plugins(true);
$authsequence = get_enabled_auth_plugins();
$identityproviders = \auth_plugin_base::get_identity_providers($authsequence);
$identityprovidersdata = \auth_plugin_base::prepare_identity_providers_for_output($identityproviders, $OUTPUT);
if (!empty($identityprovidersdata)) {
@@ -1,2 +1,2 @@
define ("tool_policy/acceptances_filter_datasource",["jquery","core/ajax","core/notification"],function(a,b,c){return{list:function list(b,c){var d=[],e=a(b),f=a(b).data("originaloptionsjson"),g=e.val();a.each(f,function(b,e){if(""!==a.trim(c)&&-1===e.label.toLocaleLowerCase().indexOf(c.toLocaleLowerCase())){return!0}if(-1<a.inArray(e.value,g)){return!0}d.push(e);return!0});var h=new a.Deferred;h.resolve(d);return h.promise()},processResults:function processResults(b,c){var d=[];a.each(c,function(a,b){d.push({value:b.value,label:b.label})});return d},transport:function transport(a,b,d){this.list(a,b).then(d).catch(c.exception)}}});
define ("tool_policy/acceptances_filter_datasource",["jquery","core/ajax","core/notification"],function(a,b,c){return{list:function list(b,c){var d=[],e=a(b),f=a(b).data("originaloptionsjson"),g=e.val();a.each(f,function(b,e){if(""!==c.trim()&&-1===e.label.toLocaleLowerCase().indexOf(c.toLocaleLowerCase())){return!0}if(-1<a.inArray(e.value,g)){return!0}d.push(e);return!0});var h=new a.Deferred;h.resolve(d);return h.promise()},processResults:function processResults(b,c){var d=[];a.each(c,function(a,b){d.push({value:b.value,label:b.label})});return d},transport:function transport(a,b,d){this.list(a,b).then(d).catch(c.exception)}}});
//# sourceMappingURL=acceptances_filter_datasource.min.js.map
File diff suppressed because one or more lines are too long
@@ -41,7 +41,7 @@ define(['jquery', 'core/ajax', 'core/notification'], function($, Ajax, Notificat
var selectedFilters = el.val();
$.each(originalOptions, function(index, option) {
// Skip option if it does not contain the query string.
if ($.trim(query) !== '' && option.label.toLocaleLowerCase().indexOf(query.toLocaleLowerCase()) === -1) {
if (query.trim() !== '' && option.label.toLocaleLowerCase().indexOf(query.toLocaleLowerCase()) === -1) {
return true;
}
// Skip filters that have already been selected.
@@ -641,6 +641,6 @@ class acceptances_table extends \table_sql {
}
return ''; // User agreed by themselves.
}
return null;
return parent::other_cols($column, $row);
}
}
@@ -42,9 +42,7 @@ Feature: Backup user data
| Feedback for the response 'True'. | So you think it is true |
| Feedback for the response 'False'. | So you think it is false |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Quiz 1"
When I am on the "Quiz 1" "quiz activity" page logged in as student1
And I press "Attempt quiz now"
And I click on "True" "radio" in the "First question" "question"
And I click on "False" "radio" in the "Second question" "question"
@@ -132,12 +132,12 @@ Feature: Upload users
# Boost check.
And I log in as "jonest"
And I am on "Maths" course homepage
And "Turn editing on" "button" should not exist
And "Calendar" "link" should be visible
And I log out
# Classic check.
And I log in as "reznor"
And I am on "Maths" course homepage
And "Turn editing on" "button" should exist
And "Calendar" "link" should not be visible
@javascript
Scenario: Upload users setting their user theme when allowuserthemes is false
+1 -1
View File
@@ -293,7 +293,7 @@ class admin_uploaduser_form2 extends moodleform {
$mform->setAdvanced('url');
$mform->addElement('text', 'idnumber', get_string('idnumber'), 'maxlength="255" size="25"');
$mform->setType('idnumber', PARAM_NOTAGS);
$mform->setType('idnumber', core_user::get_property_type('idnumber'));
$mform->setForceLtr('idnumber');
$mform->addElement('text', 'institution', get_string('institution'), 'maxlength="255" size="25"');
+1 -11
View File
@@ -438,17 +438,7 @@ class manager {
$filename = 'tour_export_' . $tour->get_id() . '_' . time() . '.json';
// Force download.
header('Last-Modified: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT');
header('Cache-Control: private, must-revalidate, pre-check=0, post-check=0, max-age=0');
header('Expires: ' . gmdate('D, d M Y H:i:s', 0) . 'GMT');
header('Pragma: no-cache');
header('Accept-Ranges: none');
header('Content-disposition: attachment; filename=' . $filename);
header('Content-length: ' . strlen($exportstring));
header('Content-type: text/calendar; charset=utf-8');
echo $exportstring;
die;
send_file($exportstring, $filename, 0, 0, true, true);
}
/**
@@ -93,7 +93,7 @@ class create_xml_file extends XMLDBAction {
$c.= ' </KEYS>' . "\n";
$c.= ' </TABLE>' . "\n";
$c.= ' </TABLES>' . "\n";
$c.= ' </XMLDB>';
$c.= ' </XMLDB>' . "\n";
if (!file_put_contents($file, $c)) {
$errormsg = 'Error creando fichero ' . $file;
+5 -1
View File
@@ -68,7 +68,9 @@ if ($dataformat) {
$downloadusers = new ArrayObject($SESSION->bulk_users);
$iterator = $downloadusers->getIterator();
\core\dataformat::download_data($filename, $dataformat, $fields, $iterator, function($userid) use ($extrafields, $fields) {
\core\dataformat::download_data($filename, $dataformat, $fields, $iterator, function($userid, $supportshtml)
use ($extrafields, $fields) {
global $DB;
if (!$user = $DB->get_record('user', array('id' => $userid))) {
@@ -86,6 +88,8 @@ if ($dataformat) {
// We only take the text.
if (is_array($user->$field)) {
$userprofiledata[$field] = reset($user->$field);
} else if ($supportshtml) {
$userprofiledata[$field] = s($user->$field);
} else {
$userprofiledata[$field] = $user->$field;
}
+27
View File
@@ -178,6 +178,33 @@ class prediction {
\core\event\prediction_action_started::create($eventdata)->trigger();
}
/**
* Get the executed actions.
*
* Actions could be filtered by actionname.
*
* @param array $actionnamefilter Limit the results obtained to this list of action names.
* @param int $userid the user id. Current user by default.
* @return array of actions.
*/
public function get_executed_actions(array $actionnamefilter = null, int $userid = 0): array {
global $USER, $DB;
$conditions[] = "predictionid = :predictionid";
$params['predictionid'] = $this->get_prediction_data()->id;
if (!$userid) {
$userid = $USER->id;
}
$conditions[] = "userid = :userid";
$params['userid'] = $userid;
if ($actionnamefilter) {
list($actionsql, $actionparams) = $DB->get_in_or_equal($actionnamefilter, SQL_PARAMS_NAMED);
$conditions[] = "actionname $actionsql";
$params = $params + $actionparams;
}
return $DB->get_records_select('analytics_prediction_actions', implode(' AND ', $conditions), $params);
}
/**
* format_calculations
*
@@ -112,6 +112,86 @@ class analytics_prediction_actions_testcase extends advanced_testcase {
$this->assertEquals(2, $DB->count_records('analytics_prediction_actions'));
}
/**
* Data provider for test_get_executed_actions.
*
* @return array
*/
public function execute_actions_provider(): array {
return [
'Empty actions with no filter' => [
[],
[],
0
],
'Empty actions with filter' => [
[],
[\core_analytics\prediction::ACTION_FIXED],
0
],
'Multiple actions with no filter' => [
[
\core_analytics\prediction::ACTION_FIXED,
\core_analytics\prediction::ACTION_FIXED,
\core_analytics\prediction::ACTION_INCORRECTLY_FLAGGED
],
[],
3
],
'Multiple actions applying filter' => [
[
\core_analytics\prediction::ACTION_FIXED,
\core_analytics\prediction::ACTION_FIXED,
\core_analytics\prediction::ACTION_INCORRECTLY_FLAGGED
],
[\core_analytics\prediction::ACTION_FIXED],
2
],
'Multiple actions not applying filter' => [
[
\core_analytics\prediction::ACTION_FIXED,
\core_analytics\prediction::ACTION_FIXED,
\core_analytics\prediction::ACTION_INCORRECTLY_FLAGGED
],
[\core_analytics\prediction::ACTION_NOT_APPLICABLE],
0
],
'Multiple actions with multiple filter' => [
[
\core_analytics\prediction::ACTION_FIXED,
\core_analytics\prediction::ACTION_FIXED,
\core_analytics\prediction::ACTION_INCORRECTLY_FLAGGED
],
[\core_analytics\prediction::ACTION_FIXED, \core_analytics\prediction::ACTION_INCORRECTLY_FLAGGED],
3
],
];
}
/**
* Tests for get_executed_actions() function.
*
* @dataProvider execute_actions_provider
* @param array $actionstoexecute An array of actions to execute
* @param array $actionnamefilter Actions to filter
* @param int $returned Number of actions returned
*
* @covers \core_analytics\prediction::get_executed_actions
*/
public function test_get_executed_actions(array $actionstoexecute, array $actionnamefilter, int $returned) {
$this->setUser($this->teacher2);
list($ignored, $predictions) = $this->model->get_predictions($this->context, true);
$prediction = reset($predictions);
$target = $this->model->get_target();
foreach($actionstoexecute as $action) {
$prediction->action_executed($action, $target);
}
$filteredactions = $prediction->get_executed_actions($actionnamefilter);
$this->assertCount($returned, $filteredactions);
}
/**
* test_get_predictions
*/
+5
View File
@@ -1,6 +1,11 @@
This files describes API changes in analytics sub system,
information provided here is intended especially for developers.
=== 3.9.7 ===
* A new function get_executed_actions() has been added to \core_analytics\prediction class
to get all (or filtered by action name) executed actions of a prediction
=== 3.8 ===
* "Time-splitting method" have been replaced by "Analysis interval" for the language strings that are
+1 -1
View File
@@ -1,3 +1,3 @@
Description of phpCAS 1.3.8 library import
* downloaded from http://downloads.jasig.org/cas-clients/php/current/
* downloaded source code from https://github.com/apereo/phpCAS/releases
+1 -1
View File
@@ -4,7 +4,7 @@
<location>CAS</location>
<name>CAS</name>
<license>Apache</license>
<version>1.3.7</version>
<version>1.3.8</version>
<licenseversion>2.0</licenseversion>
</library>
</libraries>
+3 -3
View File
@@ -131,11 +131,11 @@ class auth_plugin_db extends auth_plugin_base {
$authdb->Close();
if ($this->config->passtype === 'plaintext') {
return ($fromdb == $extpassword);
return ($fromdb === $extpassword);
} else if ($this->config->passtype === 'md5') {
return (strtolower($fromdb) == md5($extpassword));
return (strtolower($fromdb) === md5($extpassword));
} else if ($this->config->passtype === 'sha1') {
return (strtolower($fromdb) == sha1($extpassword));
return (strtolower($fromdb) === sha1($extpassword));
} else if ($this->config->passtype === 'saltedcrypt') {
return password_verify($extpassword, $fromdb);
} else {
+1 -1
View File
@@ -45,7 +45,7 @@ $string['auth_dbname'] = 'Name of the database itself. Leave empty if using an O
$string['auth_dbname_key'] = 'DB name';
$string['auth_dbpass'] = 'Password matching the above username';
$string['auth_dbpass_key'] = 'Password';
$string['auth_dbpasstype'] = '<p>Specify the format that the password field is using.</p> <p>Use \'internal\' if you want the external database to manage usernames and email addresses, but Moodle to manage passwords. If you use \'internal\', you <i>must</i> provide a populated email address field in the external database, and you must execute both admin/cron.php and auth/db/cli/sync_users.php regularly. Moodle will send an email to new users with a temporary password.</p>';
$string['auth_dbpasstype'] = '<p>Specify the format that the password field is using.</p> <p>Use \'internal\' if you want the external database to manage usernames and email addresses, but Moodle to manage passwords. If you use \'internal\', you must provide a populated email address field in the external database, and you must enable the \auth_db\task\sync_users scheduled task. Moodle will send an email to new users with a temporary password.</p>';
$string['auth_dbpasstype_key'] = 'Password format';
$string['auth_dbreviveduser'] = 'Revived user {$a->name} id {$a->id}';
$string['auth_dbrevivedusererror'] = 'Error reviving user {$a}';
+16
View File
@@ -335,12 +335,28 @@ class auth_db_testcase extends advanced_testcase {
$DB->update_record('auth_db_users', $user3);
$this->assertTrue($auth->user_login('u3', 'heslo'));
// Test user created to see if the checking happens strictly.
$usermd5 = (object)['name' => 'usermd5', 'pass' => '0e462097431906509019562988736854'];
$usermd5->id = $DB->insert_record('auth_db_users', $usermd5);
// md5('240610708') === '0e462097431906509019562988736854'.
$this->assertTrue($auth->user_login('usermd5', '240610708'));
$this->assertFalse($auth->user_login('usermd5', 'QNKCDZO'));
set_config('passtype', 'sh1', 'auth_db');
$auth->config->passtype = 'sha1';
$user3->pass = sha1('heslo');
$DB->update_record('auth_db_users', $user3);
$this->assertTrue($auth->user_login('u3', 'heslo'));
// Test user created to see if the checking happens strictly.
$usersha1 = (object)['name' => 'usersha1', 'pass' => '0e66507019969427134894567494305185566735'];
$usersha1->id = $DB->insert_record('auth_db_users', $usersha1);
// sha1('aaroZmOk') === '0e66507019969427134894567494305185566735'.
$this->assertTrue($auth->user_login('usersha1', 'aaroZmOk'));
$this->assertFalse($auth->user_login('usersha1', 'aaK1STfY'));
set_config('passtype', 'saltedcrypt', 'auth_db');
$auth->config->passtype = 'saltedcrypt';
$user3->pass = password_hash('heslo', PASSWORD_BCRYPT);
+2 -4
View File
@@ -178,10 +178,10 @@ class auth_plugin_email extends auth_plugin_base {
if ($user->auth != $this->authtype) {
return AUTH_CONFIRM_ERROR;
} else if ($user->secret == $confirmsecret && $user->confirmed) {
} else if ($user->secret === $confirmsecret && $user->confirmed) {
return AUTH_CONFIRM_ALREADY;
} else if ($user->secret == $confirmsecret) { // They have provided the secret key to get in
} else if ($user->secret === $confirmsecret) { // They have provided the secret key to get in
$DB->set_field("user", "confirmed", 1, array("id"=>$user->id));
if ($wantsurl = get_user_preferences('auth_email_wantsurl', false, $user)) {
@@ -257,5 +257,3 @@ class auth_plugin_email extends auth_plugin_base {
}
}
+2 -2
View File
@@ -598,10 +598,10 @@ class auth_plugin_ldap extends auth_plugin_base {
if ($user->auth != $this->authtype) {
return AUTH_CONFIRM_ERROR;
} else if ($user->secret == $confirmsecret && $user->confirmed) {
} else if ($user->secret === $confirmsecret && $user->confirmed) {
return AUTH_CONFIRM_ALREADY;
} else if ($user->secret == $confirmsecret) { // They have provided the secret key to get in
} else if ($user->secret === $confirmsecret) { // They have provided the secret key to get in
if (!$this->user_activate($username)) {
return AUTH_CONFIRM_FAIL;
}
+1 -1
View File
@@ -75,7 +75,7 @@ $string['auth_ldap_passwdexpire_settings'] = 'LDAP password expiry settings';
$string['auth_ldap_preventpassindb'] = 'Select yes to prevent passwords from being stored in Moodle\'s DB.';
$string['auth_ldap_preventpassindb_key'] = 'Prevent password caching';
$string['auth_ldap_rolecontext'] = '{$a->localname} context';
$string['auth_ldap_rolecontext_help'] = 'LDAP context used to select for <i>{$a->localname}</i> mapping. Separate multiple groups with \';\'. Usually something like "cn={$a->shortname},ou=staff,o=myorg".';
$string['auth_ldap_rolecontext_help'] = 'LDAP context used to select for <i>{$a->localname}</i> mapping. Separate multiple groups with \';\'. Usually something like "cn={$a->shortname},ou=first-ou-with-role-groups,o=myorg; cn={$a->shortname},ou=second-ou-with-role-groups,o=myorg".';
$string['auth_ldap_search_sub'] = 'Search users from subcontexts.';
$string['auth_ldap_search_sub_key'] = 'Search subcontexts';
$string['auth_ldap_server_settings'] = 'LDAP server settings';
+1 -1
View File
@@ -8,7 +8,7 @@ $PAGE->set_context(context_system::instance());
// Define variables used in page
$site = get_site();
$authsequence = get_enabled_auth_plugins(true); // auths, in sequence
$authsequence = get_enabled_auth_plugins(); // Auths, in sequence.
if (!in_array('ldap', $authsequence, true)) {
print_error('ldap_isdisabled', 'auth');
}
+1 -1
View File
@@ -8,7 +8,7 @@ $PAGE->set_context(context_system::instance());
// Define variables used in page
$site = get_site();
$authsequence = get_enabled_auth_plugins(true); // auths, in sequence
$authsequence = get_enabled_auth_plugins(); // Auths, in sequence.
if (!in_array('ldap', $authsequence, true)) {
print_error('ldap_isdisabled', 'auth');
}
+1 -1
View File
@@ -10,7 +10,7 @@ require(__DIR__.'/../../config.php');
$PAGE->set_context(context_system::instance());
$authsequence = get_enabled_auth_plugins(true); // auths, in sequence
$authsequence = get_enabled_auth_plugins(); // Auths, in sequence.
if (!in_array('ldap', $authsequence, true)) {
print_error('ldap_isdisabled', 'auth');
}
+1 -1
View File
@@ -543,7 +543,7 @@ class auth_ldap_plugin_testcase extends advanced_testcase {
}
protected function enable_plugin() {
$auths = get_enabled_auth_plugins(true);
$auths = get_enabled_auth_plugins();
if (!in_array('ldap', $auths)) {
$auths[] = 'ldap';
+1 -3
View File
@@ -716,9 +716,7 @@ class auth_plugin_mnet extends auth_plugin_base {
foreach($superArray as $subArray) {
$subArray = array_values($subArray);
$instring = "('".implode("', '",$subArray)."')";
$query = "select id, session_id, username from {mnet_session} where username in $instring";
$results = $DB->get_records_sql($query);
$results = $DB->get_records_list('mnet_session', 'username', $subArray, '', 'id, session_id, username');
if ($results == false) {
// We seem to have a username that breaks our query:
+2 -2
View File
@@ -372,10 +372,10 @@ class auth extends \auth_plugin_base {
if ($user->auth != $this->authtype) {
return AUTH_CONFIRM_ERROR;
} else if ($user->secret == $confirmsecret && $user->confirmed) {
} else if ($user->secret === $confirmsecret && $user->confirmed) {
return AUTH_CONFIRM_ALREADY;
} else if ($user->secret == $confirmsecret) { // They have provided the secret key to get in.
} else if ($user->secret === $confirmsecret) { // They have provided the secret key to get in.
$DB->set_field("user", "confirmed", 1, array("id" => $user->id));
return AUTH_CONFIRM_OK;
}
+21 -11
View File
@@ -93,13 +93,12 @@ class helper {
foreach ($sessions as $session) {
// Get user session from DB.
if (session_decode(base64_decode($session->sessdata))) {
if (isset($_SESSION['SESSION']) && isset($_SESSION['SESSION']->shibboleth_session_id)) {
// If there is a match, kill the session.
if ($_SESSION['SESSION']->shibboleth_session_id == trim($spsessionid)) {
// Delete this user's sessions.
\core\session\manager::kill_user_sessions($session->userid);
}
$usersession = self::unserializesession(base64_decode($session->sessdata));
if (isset($usersession['SESSION']) && isset($usersession['SESSION']->shibboleth_session_id)) {
// If there is a match, kill the session.
if ($usersession['SESSION']->shibboleth_session_id == trim($spsessionid)) {
// Delete this user's sessions.
\core\session\manager::kill_user_sessions($session->userid);
}
}
}
@@ -113,11 +112,22 @@ class helper {
*/
private static function unserializesession($serializedstring) {
$variables = array();
$a = preg_split("/(\w+)\|/", $serializedstring, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
$counta = count($a);
for ($i = 0; $i < $counta; $i = $i + 2) {
$variables[$a[$i]] = unserialize($a[$i + 1]);
$index = 0;
// Find next delimiter after current index. It's key being the characters between those points.
while ($delimiterpos = strpos($serializedstring, '|', $index)) {
$key = substr($serializedstring, $index, $delimiterpos - $index);
// Start unserializing immediately after the delimiter. PHP will read as much valid data as possible.
$value = unserialize(substr($serializedstring, $delimiterpos + 1),
['allowed_classes' => ['stdClass']]);
$variables[$key] = $value;
// Advance index beyond the length of the previously captured serialized value.
$index = $delimiterpos + 1 + strlen(serialize($value));
}
return $variables;
}
}
+1 -3
View File
@@ -41,10 +41,8 @@ Feature: Authentication
Then I should see "You are not logged in" in the "page-footer" "region"
Scenario Outline: Checking the display of the Remember username checkbox
Given I log in as "admin"
And I set the following administration settings values:
Given the following config values are set as admin:
| rememberusername | <settingvalue> |
And I log out
And I am on homepage
When I click on "Log in" "link" in the ".logininfo" "css_element"
Then I should <expect> "Remember username"
+6 -6
View File
@@ -290,9 +290,9 @@ abstract class info {
*/
protected function warn_about_invalid_availability(\coding_exception $e) {
$name = $this->get_thing_name();
// If it occurs while building modinfo based on somebody calling $cm->name,
// we can't get $cm->name, and this line will cause a warning.
$htmlname = @$this->format_info($name, $this->course);
$htmlname = $this->format_info($name, $this->course);
// Because we call format_info here, likely in the middle of building dynamic data for the
// activity, there could be a chance that the name might not be available.
if ($htmlname === '') {
// So instead use the numbers (cmid) from the tag.
$htmlname = preg_replace('~[^0-9]~', '', $name);
@@ -739,11 +739,11 @@ abstract class info {
$info = preg_replace_callback('~<AVAILABILITY_CMNAME_([0-9]+)/>~',
function($matches) use($modinfo, $context) {
$cm = $modinfo->get_cm($matches[1]);
if ($cm->has_view() and $cm->uservisible) {
if ($cm->has_view() and $cm->get_user_visible()) {
// Help student by providing a link to the module which is preventing availability.
return \html_writer::link($cm->url, format_string($cm->name, true, array('context' => $context)));
return \html_writer::link($cm->get_url(), format_string($cm->get_name(), true, ['context' => $context]));
} else {
return format_string($cm->name, true, array('context' => $context));
return format_string($cm->get_name(), true, ['context' => $context]);
}
}, $info);
@@ -48,10 +48,10 @@ Feature: Confirm that conditions on completion no longer cause a bug
And I click on "Activity completion" "button" in the "Add restriction..." "dialogue"
And I set the field with xpath "//div[contains(concat(' ', normalize-space(@class), ' '), ' availability-item ')][preceding-sibling::div]//select[@name='cm']" to "Page2"
And I press "Save and return to course"
And I should see "Not available unless:" in the ".activity.glossary" "css_element"
Then I should see "Not available unless:" in the ".activity.glossary" "css_element"
And I should see "The activity Page1 is marked complete" in the ".activity.glossary" "css_element"
And I should see "The activity Page2 is marked complete" in the ".activity.glossary" "css_element"
And I follow "TestGlossary"
# Behat will automatically check there is no error on this page.
Then I should see "TestGlossary"
And I am on the TestGlossary "glossary activity" page
And I should see "TestGlossary"
@@ -86,13 +86,12 @@ Feature: availability_grade
And I set the field "Minimum grade percentage (inclusive)" to "10"
And I press "Save and return to course"
And I log out
# Log in as student without a grade yet.
When I log out
And I log in as "student1"
And I am on "Course 1" course homepage
When I am on the "A1" "assign activity" page logged in as student1
# Do the assignment.
And I follow "A1"
And I click on "Add submission" "button"
And I set the field "Online text" to "Q"
And I click on "Save changes" "button"
@@ -103,14 +102,12 @@ Feature: availability_grade
And I should not see "P3" in the "region-main" "region"
And I should not see "P4" in the "region-main" "region"
And I should see "A1" in the "region-main" "region"
And I log out
# Log back in as teacher.
When I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
When I am on the "A1" "assign activity" page logged in as teacher1
# Give the assignment 40%.
And I follow "A1"
And I navigate to "View all submissions" in current page administration
# Pick the grade link in the row that has s@example.com in it.
And I click on "Grade" "link" in the "s@example.com" "table_row"
@@ -118,11 +115,10 @@ Feature: availability_grade
And I click on "Save changes" "button"
And I press "OK"
And I click on "Edit settings" "link"
And I log out
# Log back in as student.
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as student1
# Check pages are visible.
Then I should see "P2" in the "region-main" "region"
@@ -95,8 +95,7 @@ Feature: availability_profile
And I click on "Save and return to course" "button"
# Edit it again and check the setting still works.
When I follow "P1"
And I navigate to "Edit settings" in current page administration
When I am on the P1 "page activity editing" page
And I expand all fieldsets
Then the field "User profile field" matches value "Super field"
And the field "Value to compare against" matches value "Bananaman"
+29
View File
@@ -511,4 +511,33 @@ class info_testcase extends advanced_testcase {
sort($result);
$this->assertEquals($expected, $result);
}
/**
* Tests the info_module class when involved in a recursive call to $cm->name.
*/
public function test_info_recursive_name_call() {
global $DB;
$this->resetAfterTest();
// Create a course and page.
$generator = $this->getDataGenerator();
$course = $generator->create_course();
$page1 = $generator->create_module('page', ['course' => $course->id, 'name' => 'Page1']);
// Set invalid availability.
$DB->set_field('course_modules', 'availability', 'not valid', ['id' => $page1->cmid]);
// Get the cm_info object.
$this->setAdminUser();
$modinfo = get_fast_modinfo($course);
$cm1 = $modinfo->get_cm($page1->cmid);
// At this point we will generate dynamic data for $cm1, which will cause the debugging
// call below.
$this->assertEquals('Page1', $cm1->name);
$this->assertDebuggingCalled('Error processing availability data for ' .
'&lsquo;Page1&rsquo;: Invalid availability text');
}
}
@@ -198,8 +198,11 @@ M.core_availability.form = {
// If the groupmode and grouping id aren't set, disable it.
var groupmode = Y.one('#id_groupmode');
var groupingid = Y.one('#id_groupingid');
if ((!groupmode || Number(groupmode.get('value')) === 0) &&
(!groupingid || Number(groupingid.get('value')) === 0)) {
var groupavailability = Number(this.restrictByGroup.getData('groupavailability')) === 1;
var groupingavailability = Number(this.restrictByGroup.getData('groupingavailability')) === 1;
if ((!groupmode || Number(groupmode.get('value')) === 0 || !groupavailability) &&
(!groupingid || Number(groupingid.get('value')) === 0 || !groupingavailability)) {
this.restrictByGroup.set('disabled', true);
return;
}
@@ -220,22 +223,28 @@ M.core_availability.form = {
e.preventDefault();
// Add the condition.
var groupmode = Y.one('#id_groupmode');
var groupingid = Y.one('#id_groupingid');
var groupavailability = Number(this.restrictByGroup.getData('groupavailability')) === 1;
var groupingavailability = Number(this.restrictByGroup.getData('groupingavailability')) === 1;
var newChild;
if (groupingid && Number(groupingid.get('value')) !== 0) {
if (groupingid && Number(groupingid.get('value')) !== 0 && groupingavailability) {
// Add a grouping restriction if one is specified.
newChild = new M.core_availability.Item(
{type: 'grouping', id: Number(groupingid.get('value'))}, true);
} else {
} else if (groupmode && groupavailability) {
// Otherwise just add a group restriction.
newChild = new M.core_availability.Item({type: 'group'}, true);
}
// Refresh HTML.
this.rootList.addChild(newChild);
this.update();
this.rootList.renumber();
this.rootList.updateHtml();
if (newChild !== null) {
this.rootList.addChild(newChild);
this.update();
this.rootList.renumber();
this.rootList.updateHtml();
}
}
};
File diff suppressed because one or more lines are too long
@@ -198,8 +198,11 @@ M.core_availability.form = {
// If the groupmode and grouping id aren't set, disable it.
var groupmode = Y.one('#id_groupmode');
var groupingid = Y.one('#id_groupingid');
if ((!groupmode || Number(groupmode.get('value')) === 0) &&
(!groupingid || Number(groupingid.get('value')) === 0)) {
var groupavailability = Number(this.restrictByGroup.getData('groupavailability')) === 1;
var groupingavailability = Number(this.restrictByGroup.getData('groupingavailability')) === 1;
if ((!groupmode || Number(groupmode.get('value')) === 0 || !groupavailability) &&
(!groupingid || Number(groupingid.get('value')) === 0 || !groupingavailability)) {
this.restrictByGroup.set('disabled', true);
return;
}
@@ -220,22 +223,28 @@ M.core_availability.form = {
e.preventDefault();
// Add the condition.
var groupmode = Y.one('#id_groupmode');
var groupingid = Y.one('#id_groupingid');
var groupavailability = Number(this.restrictByGroup.getData('groupavailability')) === 1;
var groupingavailability = Number(this.restrictByGroup.getData('groupingavailability')) === 1;
var newChild;
if (groupingid && Number(groupingid.get('value')) !== 0) {
if (groupingid && Number(groupingid.get('value')) !== 0 && groupingavailability) {
// Add a grouping restriction if one is specified.
newChild = new M.core_availability.Item(
{type: 'grouping', id: Number(groupingid.get('value'))}, true);
} else {
} else if (groupmode && groupavailability) {
// Otherwise just add a group restriction.
newChild = new M.core_availability.Item({type: 'group'}, true);
}
// Refresh HTML.
this.rootList.addChild(newChild);
this.update();
this.rootList.renumber();
this.rootList.updateHtml();
if (newChild !== null) {
this.rootList.addChild(newChild);
this.update();
this.rootList.renumber();
this.rootList.updateHtml();
}
}
};
+17 -8
View File
@@ -196,8 +196,11 @@ M.core_availability.form = {
// If the groupmode and grouping id aren't set, disable it.
var groupmode = Y.one('#id_groupmode');
var groupingid = Y.one('#id_groupingid');
if ((!groupmode || Number(groupmode.get('value')) === 0) &&
(!groupingid || Number(groupingid.get('value')) === 0)) {
var groupavailability = Number(this.restrictByGroup.getData('groupavailability')) === 1;
var groupingavailability = Number(this.restrictByGroup.getData('groupingavailability')) === 1;
if ((!groupmode || Number(groupmode.get('value')) === 0 || !groupavailability) &&
(!groupingid || Number(groupingid.get('value')) === 0 || !groupingavailability)) {
this.restrictByGroup.set('disabled', true);
return;
}
@@ -218,22 +221,28 @@ M.core_availability.form = {
e.preventDefault();
// Add the condition.
var groupmode = Y.one('#id_groupmode');
var groupingid = Y.one('#id_groupingid');
var groupavailability = Number(this.restrictByGroup.getData('groupavailability')) === 1;
var groupingavailability = Number(this.restrictByGroup.getData('groupingavailability')) === 1;
var newChild;
if (groupingid && Number(groupingid.get('value')) !== 0) {
if (groupingid && Number(groupingid.get('value')) !== 0 && groupingavailability) {
// Add a grouping restriction if one is specified.
newChild = new M.core_availability.Item(
{type: 'grouping', id: Number(groupingid.get('value'))}, true);
} else {
} else if (groupmode && groupavailability) {
// Otherwise just add a group restriction.
newChild = new M.core_availability.Item({type: 'group'}, true);
}
// Refresh HTML.
this.rootList.addChild(newChild);
this.update();
this.rootList.renumber();
this.rootList.updateHtml();
if (newChild !== null) {
this.rootList.addChild(newChild);
this.update();
this.rootList.renumber();
this.rootList.updateHtml();
}
}
};
@@ -358,6 +358,15 @@ class backup_controller extends base_controller {
return $this->plan;
}
/**
* For debug only. Get a simple test display of all the settings.
*
* @return string
*/
public function debug_display_all_settings_values(): string {
return $this->get_plan()->debug_display_all_settings_values();
}
/**
* Sets the user roles that should be kept in the destination course
* for a course copy operation.
@@ -350,6 +350,15 @@ class restore_controller extends base_controller {
}
}
/**
* For debug only. Get a simple test display of all the settings.
*
* @return string
*/
public function debug_display_all_settings_values(): string {
return $this->get_plan()->debug_display_all_settings_values();
}
public function get_info() {
return $this->info;
}
+12 -1
View File
@@ -832,6 +832,9 @@ class backup_badges_structure_step extends backup_structure_step {
}
protected function define_structure() {
global $CFG;
require_once($CFG->libdir . '/badgeslib.php');
// Define each element separated.
@@ -883,7 +886,15 @@ class backup_badges_structure_step extends backup_structure_step {
// Define sources.
$badge->set_source_table('badge', array('courseid' => backup::VAR_COURSEID));
$parametersql = '
SELECT *
FROM {badge}
WHERE courseid = :courseid
AND status != ' . BADGE_STATUS_ARCHIVED;
$parameterparams = [
'courseid' => backup::VAR_COURSEID
];
$badge->set_source_sql($parametersql, $parameterparams);
$criterion->set_source_table('badge_criteria', array('badgeid' => backup::VAR_PARENTID));
$endorsement->set_source_table('badge_endorsement', array('badgeid' => backup::VAR_PARENTID));
+25 -5
View File
@@ -2110,7 +2110,6 @@ class restore_ras_and_caps_structure_step extends restore_structure_step {
public function process_override($data) {
$data = (object)$data;
// Check roleid is one of the mapped ones
$newrole = $this->get_mapping('role', $data->roleid);
$newroleid = $newrole->newitemid ?? false;
@@ -2128,8 +2127,8 @@ class restore_ras_and_caps_structure_step extends restore_structure_step {
// Check if the new role is an overrideable role AND if the user performing the restore has the
// capability to assign the capability.
if (in_array($newrole->info['shortname'], $overrideableroles) &&
($safecapability && has_capability('moodle/role:safeoverride', $context, $userid) ||
!$safecapability && has_capability('moodle/role:override', $context, $userid))
(has_capability('moodle/role:override', $context, $userid) ||
($safecapability && has_capability('moodle/role:safeoverride', $context, $userid)))
) {
assign_capability($data->capability, $data->permission, $newroleid, $this->task->get_contextid());
} else {
@@ -4046,9 +4045,30 @@ class restore_contentbankcontent_structure_step extends restore_structure_step {
$exists = $DB->record_exists('contentbank_content', $params);
if (!$exists) {
$params['configdata'] = $data->configdata;
$params['usercreated'] = $this->get_mappingid('user', $data->usercreated);
$params['usermodified'] = $this->get_mappingid('user', $data->usermodified);
$params['timemodified'] = time();
// Trying to map users. Users cannot always be mapped, e.g. when copying.
$params['usercreated'] = $this->get_mappingid('user', $data->usercreated);
if (!$params['usercreated']) {
// Leave the content creator unchanged when we are restoring the same site.
// Otherwise use current user id.
if ($this->task->is_samesite()) {
$params['usercreated'] = $data->usercreated;
} else {
$params['usercreated'] = $this->task->get_userid();
}
}
$params['usermodified'] = $this->get_mappingid('user', $data->usermodified);
if (!$params['usermodified']) {
// Leave the content modifier unchanged when we are restoring the same site.
// Otherwise use current user id.
if ($this->task->is_samesite()) {
$params['usermodified'] = $data->usermodified;
} else {
$params['usermodified'] = $this->task->get_userid();
}
}
$newitemid = $DB->insert_record('contentbank_content', $params);
$this->set_mapping('contentbank_content', $oldid, $newitemid, true);
}
+67
View File
@@ -278,6 +278,73 @@ class core_backup_automated_backup_testcase extends advanced_testcase {
$this->assertTrue($skipped);
$this->expectOutputRegex("/Skipping $course->fullname \(Not modified since previous backup\)/");
}
/**
* Test the task completes when coureid is missing.
*/
public function test_task_complete_when_courseid_is_missing() {
global $DB;
$admin = get_admin();
$classobject = $this->backupcronautomatedhelper->return_this();
// Create this backup course.
$backupcourse = new stdClass;
$backupcourse->courseid = $this->course->id;
$backupcourse->laststatus = backup_cron_automated_helper::BACKUP_STATUS_NOTYETRUN;
$DB->insert_record('backup_courses', $backupcourse);
$backupcourse = $DB->get_record('backup_courses', ['courseid' => $this->course->id]);
// Create a backup task.
$method = new ReflectionMethod('\backup_cron_automated_helper', 'push_course_backup_adhoc_task');
$method->setAccessible(true); // Allow accessing of private method.
$method->invokeArgs($classobject, [$backupcourse, $admin]);
// Delete course for this test.
delete_course($this->course->id, false);
$task = core\task\manager::get_next_adhoc_task(time());
ob_start();
$task->execute();
$output = ob_get_clean();
$this->assertStringContainsString('Invalid course id: ' . $this->course->id . ', task aborted.', $output);
core\task\manager::adhoc_task_complete($task);
}
/**
* Test the task completes when backup course is missing.
*/
public function test_task_complete_when_backup_course_is_missing() {
global $DB;
$admin = get_admin();
$classobject = $this->backupcronautomatedhelper->return_this();
// Create this backup course.
$backupcourse = new stdClass;
$backupcourse->courseid = $this->course->id;
$backupcourse->laststatus = backup_cron_automated_helper::BACKUP_STATUS_NOTYETRUN;
$DB->insert_record('backup_courses', $backupcourse);
$backupcourse = $DB->get_record('backup_courses', ['courseid' => $this->course->id]);
// Create a backup task.
$method = new ReflectionMethod('\backup_cron_automated_helper', 'push_course_backup_adhoc_task');
$method->setAccessible(true); // Allow accessing of private method.
$method->invokeArgs($classobject, [$backupcourse, $admin]);
// Delete backup course for this test.
$DB->delete_records('backup_courses', ['courseid' => $this->course->id]);
$task = core\task\manager::get_next_adhoc_task(time());
ob_start();
$task->execute();
$output = ob_get_clean();
$this->assertStringContainsString('Automated backup for course: ' . $this->course->fullname . ' encounters an error.',
$output);
core\task\manager::adhoc_task_complete($task);
}
}
/**
+179
View File
@@ -0,0 +1,179 @@
<?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') || die();
// Include all the needed stuff.
global $CFG;
require_once($CFG->dirroot . '/backup/util/includes/backup_includes.php');
require_once($CFG->dirroot . '/backup/util/includes/restore_includes.php');
/**
* Unit tests for how backup and restore handles role-related things.
*
* @package core_backup
* @copyright 2021 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class roles_backup_restore_test extends advanced_testcase {
/**
* Create a course where the (non-editing) Teacher role is overridden
* to have 'moodle/user:loginas' and 'moodle/site:accessallgroups'.
*
* @return stdClass the new course.
*/
protected function create_course_with_role_overrides(): stdClass {
$generator = $this->getDataGenerator();
$course = $generator->create_course();
$teacher = $generator->create_user();
$context = context_course::instance($course->id);
$generator->enrol_user($teacher->id, $course->id, 'teacher');
$editingteacherrole = $this->get_role('teacher');
role_change_permission($editingteacherrole->id, $context, 'moodle/user:loginas', CAP_ALLOW);
role_change_permission($editingteacherrole->id, $context, 'moodle/site:accessallgroups', CAP_ALLOW);
return $course;
}
/**
* Get the role id from a shortname.
*
* @param string $shortname the role shortname.
* @return stdClass the role from the DB.
*/
protected function get_role(string $shortname): stdClass {
global $DB;
return $DB->get_record('role', ['shortname' => $shortname]);
}
/**
* Get an array capability => CAP_... constant for all the orverrides set for a given role on a given context.
*
* @param string $shortname role shortname.
* @param context $context context.
* @return array the overrides set here.
*/
protected function get_overrides_for_role_on_context(string $shortname, context $context): array {
$overridedata = get_capabilities_from_role_on_context($this->get_role($shortname), $context);
$overrides = [];
foreach ($overridedata as $override) {
$overrides[$override->capability] = $override->permission;
}
return $overrides;
}
/**
* Makes a backup of the course.
*
* @param stdClass $course The course object.
* @return string Unique identifier for this backup.
*/
protected function backup_course(\stdClass $course): string {
global $CFG, $USER;
// Turn off file logging, otherwise it can't delete the file (Windows).
$CFG->backup_file_logger_level = backup::LOG_NONE;
// Do backup with default settings. MODE_IMPORT means it will just
// create the directory and not zip it.
$bc = new \backup_controller(backup::TYPE_1COURSE, $course->id,
backup::FORMAT_MOODLE, backup::INTERACTIVE_NO, backup::MODE_IMPORT,
$USER->id);
$backupid = $bc->get_backupid();
$bc->execute_plan();
$bc->destroy();
return $backupid;
}
/**
* Restores a backup that has been made earlier.
*
* @param string $backupid The unique identifier of the backup.
* @param string $asroleshortname Which role in the new cousre the restorer should have.
* @return int The new course id.
*/
protected function restore_adding_to_course(string $backupid, string $asroleshortname): int {
global $CFG, $USER;
// Create course to restore into, and a user to do the restore.
$generator = $this->getDataGenerator();
$course = $generator->create_course();
$restorer = $generator->create_user();
$generator->enrol_user($restorer->id, $course->id, $asroleshortname);
$this->setUser($restorer);
// Turn off file logging, otherwise it can't delete the file (Windows).
$CFG->backup_file_logger_level = backup::LOG_NONE;
// Do restore to new course with default settings.
$rc = new \restore_controller($backupid, $course->id,
backup::INTERACTIVE_NO, backup::MODE_GENERAL, $USER->id,
backup::TARGET_CURRENT_ADDING);
$precheck = $rc->execute_precheck();
$this->assertTrue($precheck);
$rc->get_plan()->get_setting('role_assignments')->set_value(true);
$rc->execute_plan();
$rc->destroy();
return $course->id;
}
public function test_restore_role_overrides_as_manager(): void {
$this->resetAfterTest();
$this->setAdminUser();
// Create a course and back it up.
$course = $this->create_course_with_role_overrides();
$backupid = $this->backup_course($course);
// When manager restores, both role overrides should be restored.
$newcourseid = $this->restore_adding_to_course($backupid, 'manager');
// Verify.
$overrides = $this->get_overrides_for_role_on_context('teacher',
context_course::instance($newcourseid));
$this->assertArrayHasKey('moodle/user:loginas', $overrides);
$this->assertEquals(CAP_ALLOW, $overrides['moodle/user:loginas']);
$this->assertArrayHasKey('moodle/site:accessallgroups', $overrides);
$this->assertEquals(CAP_ALLOW, $overrides['moodle/site:accessallgroups']);
}
public function test_restore_role_overrides_as_teacher(): void {
$this->resetAfterTest();
$this->setAdminUser();
// Create a course and back it up.
$course = $this->create_course_with_role_overrides();
$backupid = $this->backup_course($course);
// When teacher restores, only the safe override should be restored.
$newcourseid = $this->restore_adding_to_course($backupid, 'editingteacher');
// Verify.
$overrides = $this->get_overrides_for_role_on_context('teacher',
context_course::instance($newcourseid));
$this->assertArrayNotHasKey('moodle/user:loginas', $overrides);
$this->assertArrayHasKey('moodle/site:accessallgroups', $overrides);
$this->assertEquals(CAP_ALLOW, $overrides['moodle/site:accessallgroups']);
}
}
+2 -2
View File
@@ -1078,8 +1078,8 @@ abstract class restore_dbops {
$localpath = $filesystem->get_local_path_from_storedfile($storedfile);
$fs->create_file_from_pathname($file, $localpath);
} else if ($filesystem->is_file_readable_remotely_by_storedfile($storedfile)) {
$url = $filesystem->get_remote_path_from_storedfile($storedfile);
$fs->create_file_from_url($file, $url);
$remotepath = $filesystem->get_remote_path_from_storedfile($storedfile);
$fs->create_file_from_pathname($file, $remotepath);
} else if ($filesystem->is_file_readable_locally_by_storedfile($storedfile, true)) {
$localpath = $filesystem->get_local_path_from_storedfile($storedfile, true);
$fs->create_file_from_pathname($file, $localpath);
+13
View File
@@ -126,6 +126,19 @@ abstract class base_plan implements checksumable, executable {
return $result;
}
/**
* For debug only. Get a simple test display of all the settings.
*
* @return string
*/
public function debug_display_all_settings_values(): string {
$result = '';
foreach ($this->settings as $name => $setting) {
$result .= $name . ': ' . $setting->get_value() . "\n";
}
return $result;
}
/**
* Wrapper over @get_setting() that returns if the requested setting exists or no
*/
+3 -1
View File
@@ -116,7 +116,9 @@ class backup_ui_stage_initial extends backup_ui_stage {
if (isset($data->$name) && $data->$name != $setting->get_value()) {
$setting->set_value($data->$name);
$changes++;
} else if (!isset($data->$name) && $setting->get_ui_type() == backup_setting::UI_HTML_CHECKBOX && $setting->get_value()) {
} else if (!isset($data->$name) && $setting->get_value() &&
$setting->get_ui_type() == backup_setting::UI_HTML_CHECKBOX &&
$setting->get_status() !== backup_setting::LOCKED_BY_HIERARCHY) {
$setting->set_value(0);
$changes++;
}
@@ -14,10 +14,8 @@ Feature: Duplicate activities
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And I log in as "admin"
And I set the following administration settings values:
| backup_import_activities | 0 |
And I log out
And the following config values are set as admin:
| backup_import_activities | 0 | backup |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add a "Database" to section "1" and I fill the form with:
+1 -1
View File
@@ -52,7 +52,7 @@ if (!is_null($action)) {
} else { // Revoked badge.
header("HTTP/1.0 410 Gone");
$assertion = array();
if ($obversion == OPEN_BADGES_V2) {
if ($obversion >= OPEN_BADGES_V2) {
$assertionurl = new moodle_url('/badges/assertion.php', array('b' => $hash));
$assertion['id'] = $assertionurl->out();
}
+4
View File
@@ -42,6 +42,10 @@ if ($persistedissuer) {
$returnurl = new moodle_url('/badges/backpack-connect.php',
['action' => 'authorization', 'sesskey' => sesskey()]);
// If scope is not passed as parameter, use the issuer supported scopes.
if (empty($scope)) {
$scope = $issuer->get('scopessupported');
}
$client = new core_badges\oauth2\client($issuer, $returnurl, $scope, $externalbackpack);
if ($client) {
if (!$client->is_logged_in()) {
+2 -2
View File
@@ -128,7 +128,7 @@ class core_badges_assertion {
$email = empty($this->_data->backpackemail) ? $this->_data->email : $this->_data->backpackemail;
$assertionurl = new moodle_url('/badges/assertion.php', array('b' => $hash, 'obversion' => $this->_obversion));
if ($this->_obversion == OPEN_BADGES_V2) {
if ($this->_obversion >= OPEN_BADGES_V2) {
$classurl = new moodle_url('/badges/badge_json.php', array('id' => $this->get_badge_id()));
} else {
$classurl = new moodle_url('/badges/assertion.php', array('b' => $hash, 'action' => 1));
@@ -325,7 +325,7 @@ class core_badges_assertion {
*/
protected function embed_data_badge_version2 (&$json, $type = OPEN_BADGES_V2_TYPE_ASSERTION) {
// Specification Version 2.0.
if ($this->_obversion == OPEN_BADGES_V2) {
if ($this->_obversion >= OPEN_BADGES_V2) {
$badge = new badge($this->_data->id);
if (empty($this->_data->courseid)) {
$context = context_system::instance();
+2 -2
View File
@@ -61,12 +61,12 @@ class external_backpack extends \moodleform {
$mform->addElement('text', 'backpackapiurl', get_string('backpackapiurl', 'core_badges'));
$mform->setType('backpackapiurl', PARAM_URL);
$mform->addRule('backpackapiurl', null, 'required', null, 'client');
$mform->addRule('backpackapiurl', get_string('maximumchars', '', 255), 'maxlength', 50, 'client');
$mform->addRule('backpackapiurl', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
$mform->addElement('text', 'backpackweburl', get_string('backpackweburl', 'core_badges'));
$mform->setType('backpackweburl', PARAM_URL);
$mform->addRule('backpackweburl', null, 'required', null, 'client');
$mform->addRule('backpackweburl', get_string('maximumchars', '', 255), 'maxlength', 50, 'client');
$mform->addRule('backpackweburl', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
$apiversions = badges_get_badge_api_versions();
$mform->addElement('select', 'apiversion', get_string('apiversion', 'core_badges'), $apiversions);
+7 -4
View File
@@ -173,7 +173,7 @@ class client extends \core\oauth2\client {
* @return moodle_url url of callback
*/
public static function callback_url() {
return new moodle_url('/badges/oauth2callback.php');
return new moodle_url('/admin/oauth2callback.php');
}
/**
@@ -222,6 +222,7 @@ class client extends \core\oauth2\client {
$callbackurl = self::callback_url();
if ($granttype == 'authorization_code') {
$this->basicauth = true;
$params = array('code' => $code,
'grant_type' => $granttype,
'redirect_uri' => $callbackurl->out(false),
@@ -236,7 +237,7 @@ class client extends \core\oauth2\client {
);
}
if ($this->basicauth) {
$idsecret = urlencode($this->clientid) . ':' . urlencode($this->clientsecret);
$idsecret = $this->clientid . ':' . $this->clientsecret;
$this->setHeader('Authorization: Basic ' . base64_encode($idsecret));
} else {
$params['client_id'] = $this->clientid;
@@ -244,11 +245,13 @@ class client extends \core\oauth2\client {
}
// Requests can either use http GET or POST.
$response = $this->post($this->token_url(), $this->build_post_data($params));
$r = json_decode($response);
if ($this->info['http_code'] !== 200) {
throw new moodle_exception('Could not upgrade oauth token');
$debuginfo = !empty($this->error) ? $this->error : $response;
throw new moodle_exception('oauth2refreshtokenerror', 'core_error', '', $this->info['http_code'], $debuginfo);
}
$r = json_decode($response);
if (is_null($r)) {
throw new moodle_exception("Could not decode JSON token response");
}
+13 -3
View File
@@ -240,13 +240,23 @@ class award_criteria_cohort extends award_criteria {
return array($join, $where, $params);
} else {
// User is a member of ALL of the specified cohorts.
$join = " LEFT JOIN {cohort_members} cm ON cm.userid = u.id";
$join = ' LEFT JOIN {cohort_members} cm ON cm.userid = u.id';
$where = ' AND (';
$i = 0;
foreach ($this->params as $param) {
$i++;
$where = ' AND cm.cohortid = :cohortid'.$i;
if ($i == 0) {
$where .= 'cm.cohortid = :cohortid'.$i;
} else {
$where .= ' OR cm.cohortid = :cohortid'.$i;
}
$params['cohortid'.$i] = $param['cohort'];
$i++;
}
$where .= ')
GROUP BY u.id, bi.badgeid
HAVING COUNT(cm.cohortid) = :cohortcount';
$params['cohortcount'] = $i;
return array($join, $where, $params);
}
}
-57
View File
@@ -1,57 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Verify authorization callback.
*
* @package core_badges
* @copyright 2020 Tung Thai
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @author Tung Thai <Tung.ThaiDuc@nashtechglobal.com>
*/
require_once(__DIR__ . '/../config.php');
$error = optional_param('error', '', PARAM_RAW);
if ($error) {
$message = optional_param('error_description', '', PARAM_RAW);
if ($message) {
print_error($message);
} else {
print_error($error);
}
die();
}
require_login();
// The authorization code generated by the authorization server.
$code = required_param('code', PARAM_RAW);
$scope = required_param('scope', PARAM_RAW);
// The state parameter we've given (used in moodle as a redirect url).
$state = required_param('state', PARAM_LOCALURL);
$redirecturl = new moodle_url($state);
$params = $redirecturl->params();
if (isset($params['sesskey']) and confirm_sesskey($params['sesskey'])) {
$redirecturl->param('oauth2code', $code);
$redirecturl->param('scope', $scope);
redirect($redirecturl);
} else {
print_error('invalidsesskey');
}
+9 -4
View File
@@ -322,7 +322,15 @@ class core_badges_renderer extends plugin_renderer_base {
$badgeclass = $ibadge->badgeclass;
$badge = new badge($ibadge->badgeid);
$now = time();
$expiration = isset($issued['expires']) ? $issued['expires'] : $now + 86400;
if (isset($issued['expires'])) {
if (!is_numeric($issued['expires'])) {
$issued['expires'] = strtotime($issued['expires']);
}
$expiration = $issued['expires'];
} else {
$expiration = $now + 86400;
}
$badgeimage = is_array($badgeclass['image']) ? $badgeclass['image']['id'] : $badgeclass['image'];
$languages = get_string_manager()->get_list_of_languages();
@@ -431,9 +439,6 @@ class core_badges_renderer extends plugin_renderer_base {
}
$dl[get_string('dateawarded', 'badges')] = userdate($issued['issuedOn']);
if (isset($issued['expires'])) {
if (!is_numeric($issued['expires'])) {
$issued['expires'] = strtotime($issued['expires']);
}
if ($issued['expires'] < $now) {
$dl[get_string('expirydate', 'badges')] = userdate($issued['expires']) . get_string('warnexpired', 'badges');
+110 -8
View File
@@ -620,35 +620,127 @@ class core_badges_badgeslib_testcase extends advanced_testcase {
}
/**
* Test badges observer when cohort_member_added event is fired.
* Test badges observer when cohort_member_added event is fired and user required to belong to any cohort.
*
* @covers award_criteria_cohort
*/
public function test_badges_observer_cohort_criteria_review() {
public function test_badges_observer_any_cohort_criteria_review() {
global $CFG;
require_once("$CFG->dirroot/cohort/lib.php");
$cohort = $this->getDataGenerator()->create_cohort();
$cohort1 = $this->getDataGenerator()->create_cohort();
$cohort2 = $this->getDataGenerator()->create_cohort();
$this->preventResetByRollback(); // Messaging is not compatible with transactions.
$badge = new badge($this->badgeid);
$this->assertFalse($badge->is_issued($this->user->id));
$this->assertSame(0, $badge->review_all_criteria()); // Verify award_criteria_cohort->get_completed_criteria_sql().
// Set up the badge criteria.
$criteriaoverall = award_criteria::build(array('criteriatype' => BADGE_CRITERIA_TYPE_OVERALL, 'badgeid' => $badge->id));
$criteriaoverall->save(array('agg' => BADGE_CRITERIA_AGGREGATION_ANY));
$criteriaoverall1 = award_criteria::build(array('criteriatype' => BADGE_CRITERIA_TYPE_COHORT, 'badgeid' => $badge->id));
$criteriaoverall1->save(array('agg' => BADGE_CRITERIA_AGGREGATION_ANY, 'cohort_cohorts' => array('0' => $cohort->id)));
// Make the badge active.
$criteriaoverall1->save(array('agg' => BADGE_CRITERIA_AGGREGATION_ANY,
'cohort_cohorts' => array('0' => $cohort1->id, '1' => $cohort2->id)));
$badge->set_status(BADGE_STATUS_ACTIVE);
// Reload it to contain criteria.
$badge = new badge($this->badgeid);
$this->assertFalse($badge->is_issued($this->user->id));
$this->assertSame(0, $badge->review_all_criteria()); // Verify award_criteria_cohort->get_completed_criteria_sql().
// Add the user to the cohort.
cohort_add_member($cohort->id, $this->user->id);
cohort_add_member($cohort2->id, $this->user->id);
$this->assertDebuggingCalled();
// Verify that the badge was awarded.
$this->assertDebuggingCalled();
$this->assertTrue($badge->is_issued($this->user->id));
// As the badge has been awarded to user because core_badges_observer been called when the member has been added to the
// cohort, there are no other users that can award this badge.
$this->assertSame(0, $badge->review_all_criteria()); // Verify award_criteria_cohort->get_completed_criteria_sql().
}
/**
* Test badges observer when cohort_member_added event is fired and user required to belong to multiple (all) cohorts.
*
* @covers award_criteria_cohort
*/
public function test_badges_observer_all_cohort_criteria_review() {
global $CFG;
require_once("$CFG->dirroot/cohort/lib.php");
$cohort1 = $this->getDataGenerator()->create_cohort();
$cohort2 = $this->getDataGenerator()->create_cohort();
$cohort3 = $this->getDataGenerator()->create_cohort();
// Add user2 to cohort1 and cohort3.
$user2 = $this->getDataGenerator()->create_user();
cohort_add_member($cohort3->id, $user2->id);
cohort_add_member($cohort1->id, $user2->id);
// Add user3 to cohort1, cohort2 and cohort3.
$user3 = $this->getDataGenerator()->create_user();
cohort_add_member($cohort1->id, $user3->id);
cohort_add_member($cohort2->id, $user3->id);
cohort_add_member($cohort3->id, $user3->id);
$this->preventResetByRollback(); // Messaging is not compatible with transactions.
// Cohort criteria are used in site badges.
$badge = new badge($this->badgeid);
$this->assertFalse($badge->is_issued($this->user->id));
$this->assertSame(0, $badge->review_all_criteria()); // Verify award_criteria_cohort->get_completed_criteria_sql().
// Set up the badge criteria.
$criteriaoverall = award_criteria::build(array('criteriatype' => BADGE_CRITERIA_TYPE_OVERALL, 'badgeid' => $badge->id));
$criteriaoverall->save(array('agg' => BADGE_CRITERIA_AGGREGATION_ANY));
$criteriaoverall1 = award_criteria::build(array('criteriatype' => BADGE_CRITERIA_TYPE_COHORT, 'badgeid' => $badge->id));
$criteriaoverall1->save(array('agg' => BADGE_CRITERIA_AGGREGATION_ALL,
'cohort_cohorts' => array('0' => $cohort1->id, '1' => $cohort2->id, '2' => $cohort3->id)));
$badge->set_status(BADGE_STATUS_ACTIVE);
// Reload it to contain criteria.
$badge = new badge($this->badgeid);
// Verify that the badge was not awarded yet (ALL cohorts are needed and review_all_criteria has to be called).
$this->assertFalse($badge->is_issued($this->user->id));
$this->assertFalse($badge->is_issued($user2->id));
$this->assertFalse($badge->is_issued($user3->id));
// Verify that after calling review_all_criteria, users with the criteria (user3) award the badge instantly.
$this->assertSame(1, $badge->review_all_criteria()); // Verify award_criteria_cohort->get_completed_criteria_sql().
$this->assertFalse($badge->is_issued($this->user->id));
$this->assertFalse($badge->is_issued($user2->id));
$this->assertTrue($badge->is_issued($user3->id));
$this->assertDebuggingCalled();
// Add the user to the cohort1.
cohort_add_member($cohort1->id, $this->user->id);
// Verify that the badge was not awarded yet (ALL cohorts are needed).
$this->assertFalse($badge->is_issued($this->user->id));
$this->assertSame(0, $badge->review_all_criteria()); // Verify award_criteria_cohort->get_completed_criteria_sql().
// Add the user to the cohort3.
cohort_add_member($cohort3->id, $this->user->id);
// Verify that the badge was not awarded yet (ALL cohorts are needed).
$this->assertFalse($badge->is_issued($this->user->id));
$this->assertSame(0, $badge->review_all_criteria()); // Verify award_criteria_cohort->get_completed_criteria_sql().
// Add user to cohort2.
cohort_add_member($cohort2->id, $this->user->id);
$this->assertDebuggingCalled();
// Verify that the badge was awarded (ALL cohorts).
$this->assertTrue($badge->is_issued($this->user->id));
// As the badge has been awarded to user because core_badges_observer been called when the member has been added to the
// cohort, there are no other users that can award this badge.
$this->assertSame(0, $badge->review_all_criteria()); // Verify award_criteria_cohort->get_completed_criteria_sql().
}
/**
@@ -694,6 +786,16 @@ class core_badges_badgeslib_testcase extends advanced_testcase {
$this->assertStringMatchesFormat($testassertion2->badge, json_encode($assertion2->get_badge_assertion()));
$this->assertStringMatchesFormat($testassertion2->class, json_encode($assertion2->get_badge_class()));
$this->assertStringMatchesFormat($testassertion2->issuer, json_encode($assertion2->get_issuer()));
// Test Openbadge specification version 2.1. It has the same format as OBv2.0.
// Get assertion version 2.1.
$award = reset($awards);
$assertion2 = new core_badges_assertion($award->uniquehash, OPEN_BADGES_V2P1);
// Make sure JSON strings have the same structure.
$this->assertStringMatchesFormat($testassertion2->badge, json_encode($assertion2->get_badge_assertion()));
$this->assertStringMatchesFormat($testassertion2->class, json_encode($assertion2->get_badge_class()));
$this->assertStringMatchesFormat($testassertion2->issuer, json_encode($assertion2->get_issuer()));
}
/**
+1 -1
View File
@@ -120,4 +120,4 @@ Feature: Backpack badges
And I click on "Delete" "button" in the "Delete site backpack" "dialogue"
Then I should see "The site backpack has been deleted."
And I should not see "https://dc.imsglobal.org"
And "Delete" "button" should not exist
And "Delete" "button" should not be visible
+5 -5
View File
@@ -51,18 +51,18 @@ Feature: Award badges based on activity completion
And I log out
Scenario: Student earns a badge using activity completion, but does not get passing grade
When I log in as "student1"
Given I log in as "student1"
And I am on "Course 1" course homepage
And the "Test quiz name" "quiz" activity with "auto" completion should be marked as not complete
And I follow "Test quiz name"
When I am on the "Test quiz name" "quiz activity" page
And I press "Re-attempt quiz"
And I set the field "False" to "1"
And I press "Finish attempt ..."
And I press "Submit all and finish"
And I click on "Submit all and finish" "button" in the "Confirmation" "dialogue"
And I log out
Then I log in as "teacher1"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as teacher1
And I navigate to "Badges > Manage badges" in current page administration
And I follow "Course Badge"
And I should see "Recipients (1)"
Then I should see "Recipients (1)"
@@ -64,6 +64,7 @@ Feature: Award badges based on competency completion
And I set the following fields to these values:
| Rating | C |
And I click on "Rate" "button" in the "Rate" "dialogue"
And I should see "The competency rating was manually set in the course"
And I log out
# See if we got the badge
Then I log in as "user1"
@@ -114,8 +115,8 @@ Feature: Award badges based on competency completion
And I press "Rate"
And I set the following fields to these values:
| Rating | C |
And I wait until the page is ready
And I click on "Rate" "button" in the "Rate" "dialogue"
And I should see "The competency rating was manually set in the course"
And I log out
# See if we got the badge
Then I log in as "user1"
@@ -168,8 +169,8 @@ Feature: Award badges based on competency completion
And I press "Rate"
And I set the following fields to these values:
| Rating | C |
And I wait until the page is ready
And I click on "Rate" "button" in the "Rate" "dialogue"
And I should see "The competency rating was manually set in the course"
And I log out
# We should not get the badge yet.
Then I log in as "user1"
@@ -184,8 +185,8 @@ Feature: Award badges based on competency completion
And I press "Rate"
And I set the following fields to these values:
| Rating | C |
And I wait until the page is ready
And I click on "Rate" "button" in the "Rate" "dialogue"
And I should see "The competency rating was manually set in the course"
And I log out
# See if we got the badge now.
Then I log in as "user1"
+1 -1
View File
@@ -7,7 +7,7 @@ default:
Behat\MinkExtension:
base_url: 'http://localhost:8000'
goutte: null
selenium2: null
webdriver: null
Moodle\BehatExtension:
moodledirroot: /Should/Change/To/Moodle/www/dir
steps_definitions: { }
@@ -512,6 +512,10 @@ class block_activity_results extends block_base {
$fields = implode(',', $fields);
$users = $DB->get_records_list('user', 'id', $userids, '', $fields);
// If configured to view user idnumber, ensure current user can see it.
$extrafields = get_extra_user_fields($this->context);
$canviewidnumber = (array_search('idnumber', $extrafields) !== false);
// Ready for output!
if ($activity->gradetype == GRADE_TYPE_SCALE) {
// We must display the results using scales.
@@ -537,10 +541,14 @@ class block_activity_results extends block_base {
}
$this->content->text .= '</h6></caption><colgroup class="number" />';
$this->content->text .= '<colgroup class="name" /><colgroup class="grade" /><tbody>';
foreach ($best as $userid => $gradeid) {
switch ($nameformat) {
case B_ACTIVITYRESULTS_NAME_FORMAT_ID:
$thisname = get_string('user').' '.$users[$userid]->idnumber;
$thisname = get_string('user');
if ($canviewidnumber) {
$thisname .= ' ' . s($users[$userid]->idnumber);
}
break;
case B_ACTIVITYRESULTS_NAME_FORMAT_ANON:
$thisname = get_string('user');
@@ -603,7 +611,10 @@ class block_activity_results extends block_base {
foreach ($worst as $userid => $gradeid) {
switch ($nameformat) {
case B_ACTIVITYRESULTS_NAME_FORMAT_ID:
$thisname = get_string('user').' '.$users[$userid]->idnumber;
$thisname = get_string('user');
if ($canviewidnumber) {
$thisname .= ' ' . s($users[$userid]->idnumber);
};
break;
case B_ACTIVITYRESULTS_NAME_FORMAT_ANON:
$thisname = get_string('user');
@@ -139,7 +139,9 @@ Feature: The activity results block displays student high scores
And I should see "70.00" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores using ID numbers
Given I add the "Activity results" block
Given the following config values are set as admin:
| showuseridentity | idnumber,email |
And I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 3 |
@@ -78,7 +78,9 @@ Feature: The activity results block displays students high scores in group as sc
And I should see "Good" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores using ID numbers
Given I add the "Activity results" block
Given the following config values are set as admin:
| showuseridentity | idnumber,email |
And I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 3 |
@@ -110,7 +110,9 @@ Feature: The activity results block displays student in group high scores as sca
And I should see "Good" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores using ID numbers
Given I add the "Activity results" block
Given the following config values are set as admin:
| showuseridentity | idnumber,email |
And I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 3 |
@@ -123,11 +125,13 @@ Feature: The activity results block displays student in group high scores as sca
And I should see "Very good" in the "Activity results" "block"
And I should see "Good" in the "Activity results" "block"
And I log out
# Students cannot see user identity fields.
And I log in as "student1"
And I am on "Course 1" course homepage
And I should see "User S1" in the "Activity results" "block"
And I should see "User" in the "Activity results" "block"
And I should not see "User S1" in the "Activity results" "block"
And I should see "Excellent!" in the "Activity results" "block"
And I should see "User S2" in the "Activity results" "block"
And I should not see "User S2" in the "Activity results" "block"
And I should see "Very good" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores using anonymous names

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