3166 Commits

Author SHA1 Message Date
Ilya Tregubov
e93d2b0cbe Merge branch 'MDL-76399' of https://github.com/paulholden/moodle 2022-12-29 09:40:51 +07:00
Ilya Tregubov
dee383a0fa Merge branch 'MDL-76731_master' of https://github.com/PhilippImhof/moodle 2022-12-28 15:13:21 +07:00
Ilya Tregubov
1e4612ddb5 Merge branch 'MDL-76129-master' of https://github.com/sammarshallou/moodle 2022-12-28 11:26:26 +07:00
Philipp Imhof
75be72b2d6
MDL-76731 behat: add steps to check for version
Co-authored-by: Andrew Nicols <andrew@nicols.co.uk>
2022-12-22 17:13:02 +01:00
sam marshall
7724e543ff MDL-76129 accesslib: Speed up adding new cloned capabilities
Adding new capabilities can be slow if they have permissions cloned
from an existing capability, and if there are many places in the
database where the existing capability was overridden.

This change optimises the clone-capability performance, approximately
halving the number of queries required.
2022-12-22 11:05:39 +00:00
sam marshall
fe6a51265a MDL-76129 accesslib: Improve performance of adding new capabilities
Adding multiple capabilities was very slow because it clears and
rebuilds the capability cache after each one. This change makes it
clear the cache once after adding all capabilities, before adding
permissions to the archetype roles.
2022-12-22 11:05:14 +00:00
Mark Johnson
b05efb43a4 MDL-75105 tool_behat: List available data generators
This will find all data generators that can be used in behat via the
'the following "something" exist:' step, and display them in a select
list on the step definitions page.

When a generator is selected, it will fetch the required fields for that
generator and display them on the page.
2022-12-21 08:38:09 +00:00
Paul Holden
7d78fb0928 MDL-76399 behat: improvements to "should exist in" thrown exception. 2022-12-16 12:30:03 +00:00
Sara Arjona
d98be6a34e Merge branch 'MDL-71096' of https://github.com/stronk7/moodle 2022-12-14 17:51:44 +01:00
Andrew Nicols
c6e9959a40 Merge branch 'MDL-76235' of https://github.com/paulholden/moodle 2022-12-13 20:56:32 +08:00
Sara Arjona
86218ccb3d Merge branch 'MDL-72451_master' of https://github.com/marxjohnson/moodle 2022-12-12 17:34:07 +01:00
Andrew Nicols
82fe292772 Merge branch 'MDL-71261' of https://github.com/timhunt/moodle 2022-12-12 21:20:56 +08:00
Rex Lorenzo
ebeaa4b3f2 MDL-71261 mod_quiz: Quiz user override should only get enrolled users
Also update similar code in mod_assign to use the improved APIs.

Co-Authored-By: Tim Hunt <T.J.Hunt@open.ac.uk>
2022-12-12 12:29:19 +00:00
Matteo Scaramuccia
71883c2add MDL-72461 core: Required JS files in $PAGE served by the Moodle handler 2022-12-09 13:47:19 +01:00
Paul Holden
652b2e496a MDL-76235 core: compare email diversion exceptions case-insensitively.
Co-authored-by: Jan Kristoffer Roth <roth@dhbw-mosbach.de>
2022-12-09 11:19:18 +00:00
Eloy Lafuente (stronk7)
28937d4243 MDL-71096 core: Add meta information about APIs to core
Right now we have the information only in docs:
  - https://docs.moodle.org/dev/Core_APIs
  - https://moodledev.io/docs/apis

And, in fact, we are crawling those pages to get the information
from various tools (moodlecheck, CiBoT...). Obviously, that's far
from ideal, the source only has the current list of APIs, and
there isn't much information there but the names.

So we are moving the source of information to be in core, so it
can be modified between branches, and contains richer information:
 - The component the API belongs to, usually a subsystem or core.
 - If the API can be used as level 2 namespace.
 - If the API can be used as level 2 namespace out from its component.

Note that all that information has NO USES right now in core (and maybe
never will), but tools/checkers will benefit enormously by having that
information at hand, so we can check for namespaces, categories and
other bits way better.

Also, once we have this, the APIs dev documents linked above, surely
can be improved by being automatically generated and include all the
meta-information available.

It also includes a very basic json schema validating the basis. It can
be tried online @ https://www.jsonschemavalidator.net , or any other
tool. PHP requires extra libraries to be able to perform the validation.

Covered with unit tests, both api-related functions and structure validation.
2022-12-09 10:49:12 +01:00
Jun Pataleta
5bc72f5176 Merge branch 'MDL-76559-master' of https://github.com/andrewnicols/moodle 2022-12-06 23:19:53 +08:00
Andrew Nicols
f375cac31a MDL-76559 core: validate_email should not accept empty values 2022-12-06 20:53:30 +08:00
Ilya Tregubov
e641428826 Merge branch 'MDL-76490' of https://github.com/paulholden/moodle 2022-12-06 13:09:21 +03:00
Ilya Tregubov
ac60253859 Merge branch 'MDL-75516' of https://github.com/larsbonczek/moodle 2022-12-06 10:37:46 +03:00
Marina Glancy
8d86f30351 MDL-76490 behat: correct step for opening autocomplete in container. 2022-12-05 14:01:55 +00:00
Lars Bonczek
e875c6118c MDL-75516 core: Perform proper JSON encoding in mustache quote helper 2022-12-02 13:39:58 +01:00
Ilya Tregubov
fb27e80566 Merge branch 'MDL-76495-master' of https://github.com/marinaglancy/moodle 2022-12-02 13:48:11 +03:00
Andrew Nicols
8ddbc7b055 Merge branch 'MDL-76493-master' of https://github.com/marinaglancy/moodle 2022-12-02 12:15:20 +08:00
Marina Glancy
a800e7e62f MDL-74853 various: add second parameter to htmlentities functions
Default value of the $flag argument changed in PHP 8.1 from ENT_COMPAT to ENT_QUOTES | ENT_SUBSTITUTE
To ensure consistent behavior across different PHP version the second parameter is now required for the functions:
htmlspecialchars(), htmlentities(), htmlspecialchars_decode(), html_entity_decode() and get_html_translation_table()
2022-11-28 16:12:20 +01:00
Marina Glancy
369bca652c MDL-76495 lib: test for qrcode in TCPDF 2022-11-26 19:18:29 +01:00
Marina Glancy
e5f862d0b1 MDL-76493 core: make sure format_string(null) works on PHP 8.1 2022-11-26 14:02:32 +01:00
Marina Glancy
7bbb5434bf MDL-75100 core: replace function strftime deprecated in PHP 8.1 2022-11-21 11:41:12 +01:00
David Mudrák
5e2e7562b6 MDL-76105 lang: Use fixed strings in tests, too. 2022-11-17 10:37:45 +00:00
Tomo Tsuyuki
b3e046df7e MDL-72451 core: Stop keep regrading when there is an error
Set needsupdate to finish to avoid regrading each call.
Add error messages for regrading.
Display the error message on the quiz page.

Co-authored-by: Mark Johnson <mark.johnson@catalyst-eu.net>
2022-11-17 08:54:47 +00:00
Andrew Nicols
7e6d32d7c2 Merge branch 'MDL-76112-master' of https://github.com/marinaglancy/moodle 2022-11-16 10:07:49 +08:00
Paul Holden
76c68e2146 Merge branch 'MDL-68550-master' of https://github.com/rezaies/moodle 2022-11-10 11:59:35 +00:00
Shamim Rezaie
8e31a72c05 MDL-68550 output: Improve accessibility of the initials bar
- The current item should be focusable otherwise the focus will be lost
  as soon as a user clicks on an item in the initials bar
- Modified behat tests to not mistakenly click on the 'All' link
- Use the nav tag because each item in the initials bar is a
  navigation link within the current document
- The currently selected item is specified by aria-current
- Useed aria-current=true rather than =page because the links of each
  item in the initials bar is missing the pagination information
2022-11-10 06:06:02 +11:00
Shamim Rezaie
e29007d679 MDL-68550 output: Improve accessibility of the paging bar
The use of aria-current is based on the example at
https://design-system.w3.org/components/pagination.html
2022-11-10 06:06:02 +11:00
Jun Pataleta
9555637d64 Merge branch 'MDL-76053' of https://github.com/stronk7/moodle 2022-11-09 21:28:30 +08:00
Sara Arjona
a74782dcc3 Merge branch 'MDL-75889' of https://github.com/paulholden/moodle 2022-11-09 12:36:39 +01:00
Eloy Lafuente (stronk7)
621d75dbce MDL-76053 admin: Remove various warnings related to MNet
This partially reverts MDL-73270, where some useful environmental
checks and notifications in the admin UI were added to inform
about different parts of Moodle relying on the "unsupported"
php-xmlrpc extension.

Since then, some changes have happened in core, only available
for Moodle 4.1 and up (see the MDL-70889 mini-epic). Namely:

  - MNet (SSO, roaming, auth, enrol and Mahara portfolio) are not
    using the php-xmlrpc extension anymore, but a pure php library.
  - The xmlrpc webservices protocol, has been move from core to
    the plugins directory, although it continues using the php-xmlrpc
    extension.

Because of that here we are removing all the checks and notifications
related with MNet (not using the extension anymore), but keeping the
webservice plugin ones (still using the extension). Surely if some day the
protocol stops using the extension, we'll be able to remove the
corresponding checks too. But that's future.

Note the associated lang strings have been also removed (not deprecated)
because they were highly specific and hardly reusable:
  - xmlrpcmaharaenabled
  - xmlrpcmnetauthenticationenabled
  - xmlrpcmnetenabled

And very same applies, because MNet doesn't contain anything deprecated
or not supported anymore, hence, straight deletion, to the function:
  - mnet_get_deprecation_notice()

Also, related tests using any of the removed stuff above have been deleted.

In the other side, the "check_xmlrpc_usage" continues existing and
being used both by environment checks and admin notifications but,
as commented above, now it only looks for the xmlrpc webservice
protocol now.
2022-11-08 16:49:18 +01:00
Paul Holden
c4c823c20e MDL-75889 core: compare domain names in a case-insensitive manner.
As per https://www.rfc-editor.org/rfc/rfc1035#section-3.1
2022-11-07 22:37:15 +00:00
Eloy Lafuente (stronk7)
d590b08dfa MDL-75880 phpunit: fix all @coversDefaultClass missing @covers
Because @coversDefaultClass doesn't indicate any coverage (it's
just an alias to avoid having to write the class name in @covers),
this commit fixes all the files that were using that annotation
and missing any @covers.

Basically, replacing one by the other and done.
2022-11-04 16:51:20 +01:00
Jake Dallimore
446a9e64f0 Merge branch 'MDL-76055' of https://github.com/stronk7/moodle 2022-11-04 12:06:38 +03:00
Andrew Nicols
426ea50861 MDL-76169 behat: Normalise exception message in should (not) steps
These steps have accepted a NodeElement instance as an argument for some
time, but were trying to cast it to string when formulating exception
messages, making it harder to debug and, in the case of the 'should see'
step, not work at all.

This patch introduces a new function to produce a consistent naming for
them.
2022-11-03 21:39:15 +08:00
Andrew Nicols
232ebac338 MDL-76169 behat: Add improved steps for using action menus
This commit adds new steps related to action menus to support:
* Choosing an item in a named action menu
* Choosing an item in a named action menu within a container
* Confirming that an action menu item does or does not exist in a named
  action menu
* Confirming that an action menu item does or does not exist in a named
  action menu within a container

The existing action menu steps were insufficient as they assume that
there is only one action menu within he container, which is not
necessarily the case.

The existing action menu steps are not non-JS friendly and will error if
JS is disabled, without providing any fallback when one is easily
available.

Unfortunately these steps cannot be used to replace the existing steps
without manual intervention.
2022-11-03 21:39:15 +08:00
Eloy Lafuente (stronk7)
a0d916bc86 MDL-76055 libraries: Autoload phpxmlrpc and verify it works
Also, we can now safely remove Autoloader.php, because
Moodle PSR-4 autoloader has taken control, so document
and test it too.
2022-11-02 15:56:38 +01:00
Marina Glancy
a34b4ebdc3 MDL-76112 various: can not pss null as 3rd param to preg_split
This produces notices in PHP 8.1
2022-10-28 10:51:20 +02:00
Jun Pataleta
c76a2a05ba Merge branch 'MDL-72558' of https://github.com/NoelDeMartin/moodle 2022-10-26 13:37:45 +08:00
Víctor Déniz
c209719811 Merge branch 'MDL-67020_master' of https://github.com/marxjohnson/moodle 2022-10-21 09:07:58 +03:00
Mark Johnson
ea01fb2427 MDL-67020 Cache: Make local caching work for coursemodinfo 2022-10-20 11:31:33 +01:00
Jun Pataleta
3a5205dd0a Merge branch 'MDL-75985-master' of https://github.com/andrewnicols/moodle 2022-10-19 21:27:29 +08:00
Andrew Nicols
0ba4fa53c1 MDL-75985 behat: Return newline character for \n
Somehow part of this commit was lost during the push and/or squash.
2022-10-19 20:26:14 +08:00
Jun Pataleta
e591f9da66 Merge branch 'MDL-75985-master' of https://github.com/andrewnicols/moodle 2022-10-19 10:56:14 +08:00