22419 Commits

Author SHA1 Message Date
Shamim Rezaie
029d6102ea MDL-70816 mod_choice: activity_dates implementation 2021-03-22 16:15:24 +11:00
Adrian Greeve
4496a4e41c Merge branch 'MDL-70977' of git://github.com/paulholden/moodle 2021-03-18 10:49:42 +08:00
Eloy Lafuente (stronk7)
ac086dcf23 Merge branch 'MDL-70896-master' of git://github.com/marinaglancy/moodle 2021-03-18 00:34:05 +01:00
Eloy Lafuente (stronk7)
cfba0366db Merge branch 'MDL-70893-master' of git://github.com/marinaglancy/moodle 2021-03-18 00:23:26 +01:00
Jun Pataleta
ebf078458d Merge branch 'MDL-71036' of https://github.com/stronk7/moodle 2021-03-17 20:05:25 +08:00
Mihail Geshoski
fcbd1605cb 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 10:26:09 +08:00
Paul Holden
763a3c3383 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:48:51 +00:00
Mihail Geshoski
23f7830bcd MDL-44613 mod_assign: Automate testing of the assignment availability 2021-03-15 08:22:12 +08:00
Eloy Lafuente (stronk7)
713722c3fb MDL-71036 phpunit: Coding style changes, 99% whitespace only
I've gone over a few of the mofified files (those
which were showing warnings and errors to CiBoT. Some of them
have been fixed completely, while others only have fixed
for the lines belonging to this issue (lib/tests/moodlelib_test.php)
for example.
2021-03-11 23:04:32 +01:00
Eloy Lafuente (stronk7)
9fd6ac7c9d MDL-71036 phpunit: xml config - switch coverage info to new includes
This applies the "whitelist" => "include" changes to all the core
phpunit_coverage_info occurrences, so core won't emit any deprecation
warning (see previous commit).

At the same time, modified a bunch of comments in coverage files
to be more readable/understandable.
2021-03-11 23:04:32 +01:00
Eloy Lafuente (stronk7)
81407f18ec MDL-71036 phpunit: Mock->setMethods() silently deprecated
The current ->setMethods() has been silently (won't emit any
warning) in PHPUnit 9. And will stop working (current plans)
in PHPUnit 10.

Basically the now deprecated method has been split into:

- onlyMethods(): To point to existing methods in the mocked artifact.
- addMethods(): To point to non existing (yet) methods in the mocked
  artifact.

In practice that means that all our current setMethods() calls can be
converted to onlyMethods() (existing) and done. The addMethods() is
mostly useful on development phases, not final testing.

Finally note that <null> isn't accepted anymore as parameter to
double all the methods. Instead empty array [] must be used.

Link: https://github.com/sebastianbergmann/phpunit/issues/3770
2021-03-11 23:04:31 +01:00
Eloy Lafuente (stronk7)
8a14a7bd22 MDL-71036 phpunit: assertContains() now performs strict comparison
The methods assertContains() and assertNotContains() now perform
strict (type and value) comparison, pretty much like assertSame()
does.

A couple of new assertContainsEquals() and assertNotContainsEquals()
methods have been created to provide old (non-strict) behavior, pretty
much like assertEquals() do.

Apart from replacing the calls needing a relaxed comparison to those
new methods, there are also a couple of alternative, about how to
fix this, depending of every case:

- If the test is making any array_values() conversion, then it's better
  to remove that conversion and use assertArrayHasKey(), that is not
  strict.
- Sometimes if may be also possible to, simply, cast the expectation
  to the exact type coming in the array. I've not applied this technique
  to any of the cases in core.

Link: https://github.com/sebastianbergmann/phpunit/issues/3426
2021-03-11 23:04:31 +01:00
Eloy Lafuente (stronk7)
ba5b6089d5 MDL-71036 phpunit: Renamed various regexp-related assertions
In PHPUnit 9.1, the following regexp-related assertions
have been deprecated and there are new alternatives for
all them:
    - assertRegExp()     -> assertMatchesRegularExpression()
    - assertNotRegExp()  -> assertDoesNotMatchRegularExpression()

This is about to, simply, move all cases to the new alternatives.

Source: https://github.com/sebastianbergmann/phpunit/blob/9.1.0/ChangeLog-9.1.md

Regexp to find all them:

    ag 'assertRegExp|assertNotRegExp' -li
2021-03-11 19:22:24 +01:00
Jun Pataleta
5a7c629f7c Merge branch 'MDL-45242-master' of https://github.com/sammarshallou/moodle 2021-03-10 23:39:30 +08:00
sam marshall
987e55452f MDL-45242 Course: Enrol feature supports custom profile fields 2021-03-10 10:57:11 +00:00
sam marshall
558cc1b85e MDL-45242 Lib: Replace calls to deprecated functions
In all cases changes have been kept to a minimum while not making
the code completely horrible. For example, there are many instances
where it would probably be better to rewrite a query entirely, but
I have not done that (in order to reduce the risk of changes).
2021-03-10 10:57:10 +00:00
Jun Pataleta
2f0914e55f MDL-70815 mod_choice: Unit tests for the custom completion class 2021-03-09 20:15:28 +08:00
Jun Pataleta
4b2d9ef76d MDL-70815 mod_choice: Custom completion implementation 2021-03-09 20:15:28 +08:00
sam marshall
3f003455f3 MDL-45242 Lib: Replace direct references to ->showuseridentity 2021-03-08 09:20:18 +00:00
Ilya Tregubov
eaf40e050e MDL-69680 lib: Replace deprecated jQuery functions 2021-03-04 12:48:26 +08:00
Ilya Tregubov
a303eb9e9e MDL-70767 feedback: Prevent xss in feedback answer text. 2021-03-03 23:08:22 +01:00
Sara Arjona
40720df008 Merge branch 'MDL-68721-master' of git://github.com/ferranrecio/moodle 2021-03-03 17:51:16 +01:00
Ferran Recio
fe3ee4a066 MDL-68721 mod_h5pactivity: report acceptance tests 2021-03-03 17:21:56 +01:00
Marina Glancy
9cfacff738 MDL-65552 user: escape idnumber and email in table_sql 2021-03-03 23:15:07 +08:00
Sara Arjona
9d58d4de46 Merge branch 'MDL-67494-master' of git://github.com/lameze/moodle 2021-03-03 11:45:28 +01:00
Sara Arjona
187801ccf5 Merge branch 'MDL-70966-master' of git://github.com/marinaglancy/moodle 2021-03-03 09:30:41 +01:00
Sara Arjona
97786378be Merge branch 'MDL-69097-master' of https://github.com/inigozendegi/moodle 2021-03-03 09:06:45 +01:00
Simey Lameze
ac0a0bad63 MDL-67494 calendar: only user overrides should retain userid 2021-03-03 16:06:32 +08:00
Eloy Lafuente (stronk7)
5b45f13073 Merge branch 'MDL-70340-master' of git://github.com/jleyva/moodle 2021-03-02 23:32:30 +01:00
Víctor Déniz
65957d8109 Merge branch 'MDL-70676-master' of git://github.com/ilyatregubov/moodle
Fixed mod/workshop/db/upgrade.php: \xmldb_field::getNotNull()
does not verify if the column is nullable in the database.
2021-03-02 18:29:19 +00:00
Ilya Tregubov
0420ec757a MDL-70676 workshop: Allow empty grades. 2021-03-02 13:41:52 +02:00
Eloy Lafuente (stronk7)
e635eed2ed Merge branch 'MDL-70912-master' of git://github.com/sarjona/moodle 2021-03-01 16:47:28 +01:00
Eloy Lafuente (stronk7)
ac9b920981 Merge branch 'MDL-70964-master-enfix' of git://github.com/mudrd8mz/moodle 2021-03-01 09:33:49 +01:00
Marina Glancy
612c230709 MDL-70966 various: Under PHP8 empty string is no longer equals to 0 2021-02-28 19:16:09 +01:00
Helen Foster
422e70e308 MDL-70964 lang: Import fixed English strings (en_fix) 2021-02-25 16:18:57 +01:00
Iñigo Zendegi
df9eefacef MDL-69097 mod_forum: Apply filters to whole forum grading 2021-02-24 17:08:34 +01:00
Víctor Déniz
534eae88d7 Merge branch 'MDL-70038-master' of https://github.com/jpahullo/moodle 2021-02-23 11:14:14 +00:00
Jordi Pujol Ahulló
96557076a2 MDL-70038 assign: add suport for pdftoppm tool
pdftoppm (from poppler-utils package) is several orders of
magnitude quicker than ghostscript extracting PNG images
from PDF documents.

We add support for this tool and use it whenever set up,
or using gs as before if missing.

Revisited code with peer review comments. In particular:

1. Make default path for pdftoppm empty string.
2. Fix a typo on the method description for get_gs_command_for_image.
3. Added more information why is useful pdftoppm into string pathtopdftoppm_help.
4. Check that path for pdftoppm is executable to prevent errors. Otherwise, use gs.
2021-02-23 08:07:20 +01:00
Andrew Nicols
cffeb4b797 MDL-69259 h5pactivity: Whitespace fix 2021-02-22 12:19:18 +08:00
Ilya Tregubov
82433c0b6a MDL-69259 h5pactivity: Add get_user_attempts webservice 2021-02-19 16:07:51 +02:00
Eloy Lafuente (stronk7)
a72ea10b84 Merge branch 'MDL-70552-master' of git://github.com/ilyatregubov/moodle 2021-02-17 10:26:20 +01:00
Ilya Tregubov
729688b379 MDL-70552 core_message: Show popup for teachers when anonymous
user completed feedback.
2021-02-17 08:42:52 +02:00
Andrew Nicols
243262d940 MDL-68853 mod_h5pactivity: Whitespace fix 2021-02-17 12:02:53 +08:00
Andrew Nicols
57e233e742 Merge branch 'MDL-68853-master' of git://github.com/ilyatregubov/moodle 2021-02-17 11:47:27 +08:00
Andrew Nicols
ab024ac209 Merge branch 'MDL-47410-master' of git://github.com/mihailges/moodle 2021-02-17 09:34:22 +08:00
Eloy Lafuente (stronk7)
a32ed14f03 Merge branch 'MDL-66600' of https://github.com/mkassaei/moodle 2021-02-16 22:11:55 +01:00
Sara Arjona
1be2350a74 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:16:21 +01:00
Jun Pataleta
f04cbfa7ab MDL-48269 mod_forum: Remove occurrences of hidepicture 2021-02-16 12:48:45 +08:00
Frederic Massart
3aed37ee4d MDL-48269 group: Remove the option to hide the picture of a group
Plus additional amendments to Fred's original commit:
1. Updating the version numbers
2. Merging the original two-step upgrade below into one for simplicity:
   1. Deleting the pictures for groups with hidepicture set to 1; and
   2. Dropping the hidepicture field itself.
3. Converted array() usages to the short syntax [].
2021-02-16 12:46:58 +08:00
Marina Glancy
1e8375d830 MDL-70896 mod: libxml_disable_entity_loader is deprecated in php 8.0 2021-02-15 18:58:56 +01:00