29606 Commits

Author SHA1 Message Date
Ilya Tregubov
441ed4c180 Merge branch 'MDL-67428-filter-context' of https://github.com/Peterburnett/moodle 2022-03-10 09:04:05 +06:00
Sara Arjona
c67453cff2 Merge branch 'MDL-73586' of https://github.com/stronk7/moodle 2022-03-09 16:26:13 +01:00
Sara Arjona
d1eb8aef66 Merge branch 'MDL-71807' of https://github.com/stronk7/moodle 2022-03-09 16:22:02 +01:00
Sara Arjona
9b5da4de17 Merge branch 'MDL-73993-master' of https://github.com/golenkovm/moodle 2022-03-09 13:24:29 +01:00
Jun Pataleta
8ac5e00dd4 Merge branch 'MDL-74097' of https://github.com/stronk7/moodle 2022-03-09 17:59:04 +08:00
Eloy Lafuente (stronk7)
2e48f924e7 MDL-73586 phpunit: Simply, remove the setting
It's not available since PHP 7.0, so no use at all.
2022-03-08 14:56:59 +01:00
Eloy Lafuente (stronk7)
254108755a MDL-73586 mustache.php: Removed php init param for php80 and up
The 'mbstring.func_overload' php init setting was removed for
php80 (it was deprecated since php72). So it won't evaluate to
true ever, so the whole block can be put under php version condition.

Note that this is already fixed upsteam, for commit:
e7165a33b2

And it has been released with version 2.14.1 of the library, so, once
we upgrade to it, the fix will be incorporated.
2022-03-08 12:35:01 +01:00
Eloy Lafuente (stronk7)
a5c91474ee MDL-71807 cleanup: Replace deprecated codingStandardsIgnore annotations
The PHP_CodeSniffer @codingStandardsIgnore annotations are deprecated
and, since version 3.x, the new // phpcs:ignore comments should be used
instead.

This commits just reviews all the uses in core, replacing them for
the better new candidate, or removing when no longer needed.
2022-03-08 10:48:53 +01:00
Eloy Lafuente (stronk7)
1af724e105 MDL-74097 core_text: Add some tests to cover all the logic 2022-03-08 10:37:47 +01:00
Eloy Lafuente (stronk7)
3255c42bf4 MDL-74097 core_text: Add coverage info to better see what's missing 2022-03-08 10:37:47 +01:00
Eloy Lafuente (stronk7)
2def80568b MDL-74097 core_text: Ensure that transliteration always happens
Before the patch, transliteration was only happening when the
encoding of the string was utf-8. For other encodings only a
simpler conversion (iconv) to ascii was done. For some reason
iconv() own transliteration abilities are not consistent
between systems (depends of libraries installed, locales and
other bits).

So now we always convert the string to utf-8, in order to
transliterate it. And finally, also perform an iconv to
cover some characters that transliterate doesn't handle ok.

Also, remove a block of code that does nothing (previously
it was executing some code, but now it just sets and restores
the error level for nothing).
2022-03-08 10:37:47 +01:00
Ilya Tregubov
e118f7576b MDL-71703 lib: update phpmailer to 6.5.3 2022-03-08 10:04:20 +01:00
Ilya Tregubov
bdd0356fde Merge branch 'MDL-66940-master' of https://github.com/sarjona/moodle 2022-03-08 05:01:47 +02:00
Víctor Déniz
2ac75e55a9 Merge branch 'MDL-74090-master' of https://github.com/junpataleta/moodle 2022-03-08 00:00:19 +00:00
Jun Pataleta
3314000eaf MDL-74090 core: Proper RTL/LTR display of collapsed icons 2022-03-05 00:45:32 +08:00
Shamim Rezaie
a9d8207da9 Merge branch 'MDL-73824' of https://github.com/stronk7/moodle 2022-03-05 00:39:29 +11:00
Sara Arjona
bc7dec8c2b MDL-66940 badges: Create page to display badges info
The OBv2.0 specification includes a field "Criteria" for
BadgeClass. Until now, this field was filled using the
URL of the badge assertion, but that is causing some issues
in Badgr because it linked to the badge assertion of the
first user sending this badge to the Badgr backpack (so then,
the following users linked to the first user assertion page
too).

This patch adds a new page, badgeclass.php which will be
used from now to display any badge information which is
not related to any assertion (like happens with the criteria
in BadgeClass).
2022-03-04 12:18:59 +01:00
Jun Pataleta
1aa65fbdfe Merge branch 'MDL-73902-master' of https://github.com/bmbrands/moodle 2022-03-04 18:28:18 +08:00
Eloy Lafuente (stronk7)
3a016e2784 MDL-73824 gradebook: Add support for localised floats where missing
It has been detected, thanks to php80 specially, that there are
various places in core where support for localised floats is
missing. Before php80, some locale-dependent conversions were
performed by PHP, allowing things to work. But with php80 all
those comparisons are now locale-independent. See:

https://wiki.php.net/rfc/locale_independent_float_to_string

That implies that we now need to, always, unformat floats to
be internally the correct (decimal point as separator) in
order to compare it.

While this was visited in the php80 epic (MDL-70745), nothing
was found, all automated tests were passing ok. Problem is that
we run behat tests with en-AU laguage that has the decimal point
separator.

So, in this issue we are fixing all the problems detected by
running those Behat tests using localised (comma) decimal
separator.

Note that there may be other places still causing problems, but
it's really hard to find them programmatically, so we'll have to
wait for real use reports / issues and go fixing them while they
happen.

Back to this commit, this is the list of changes performed (note that
in the next commit, we'll be adding scenarios explicitly using
a localised decimal separator to ensure that they work ok).

A. Changes to various grade forms to ensure that, on their validation
  floats are unformatted properly. Also, changed the corresponding
  form element from current text/PARAM_RAW to proper float ones that
  take care of the conversion in a number of places (but when disabled,
  that's the reason we still have to unformat in validation.
  This includes the following forms:
    - edit_category_form
    - edit_item_form
  (this is the original problem reported that cause all the research
  to be performed against full behat runs)

B. Changes to edit_letter_form, so it uses a proper PARAM_LOCALISEDFLOAT
  (note this is the type of change that surely should be used for all
  the rest of /grade/edit/tree form, including those in the previous
  point).

C. Changes to the grade_item behat generator, so it's able to work with
  localised floats, un-formatting them when needed.
  At lib/behat/classes/behat_core_generator.php

D. Fix problem passing localised floats to scales, not displaying
  properly. At grade/report/singleview/classes/local/ui/finalgrade.php

E. Change the behat text matcher in order to allow comparison of
  localised floats when they are the current ones. Before this change
  the matches was using soft/lazy comparison, so '50' and '50.0000'
  match. Now, when the comma (for example) is used (and only then),
  '50' and '50,000' will also match. This comparison is in use in a
  bunch of tests and makes sense to make it localisation-aware.
  At grade/report/singleview/classes/local/ui/finalgrade.php

F. Fix a couple of number_format() uses in lesson, because they are
  not localised-aware. Switched to format_float(). At mod/lesson/locallib.php

G. Change the quiz_contains_the_following_questions() step to accept
  localised maxmark expectations. At mod/quiz/tests/behat/behat_mod_quiz.php

H. Change the quiz generator so it accepts localised gradepass.
  At mod/quiz/tests/generator/lib.php

I. Change the edit question form to show proper localised penalties,
  previously it was always showing point-decimal ones. Of course,
  leaving the values of the select element unmodified (internal floats).
  Related, also change a couple of tests to, instead of try to match the
  value (always internal floats), match the description (now localised),
  so we can test them with different separators. At:
    - question/type/ddimageortext/tests/behat/backup_and_restore.feature
    - question/type/ddmarker/tests/behat/backup_and_restore.feature
    - question/type/edit_question_form.php
2022-03-04 10:22:49 +01:00
Jake Dallimore
8ccf8390c3 Merge branch 'MDL-73796-master' of https://github.com/bmbrands/moodle 2022-03-04 14:56:09 +08:00
Jun Pataleta
e9ee905619 Merge branch 'MDL-73785' of https://github.com/stronk7/moodle 2022-03-04 14:36:47 +08:00
Peter Spicer
edde68e078
MDL-67428 navigation: Apply navigation text filters at system context
On some larger sites, processing the navigation with format_string will
habitually load all the contexts for navigation which can take 400+ DB
queries. Explicitly tying all those format_string calls to the system
context reduces this overhead to a single DB query that probably has
already been run on the page previously.

Co-authored-by: Peter Burnett <peterburnett@catalyst-au.net>
2022-03-04 14:36:25 +10:00
Jake Dallimore
9be31a19dd Merge branch 'MDL-73457-master-2' of https://github.com/HuongNV13/moodle 2022-03-04 11:59:26 +08:00
Shamim Rezaie
29c14e979b Merge branch 'MDL-74045-master' of https://github.com/bmbrands/moodle 2022-03-04 10:13:05 +11:00
Eloy Lafuente (stronk7)
4003e31983 MDL-73785 phpunit: Move more tests to use correct names and namespaces
Applied the following changes to various testcase classes:

- Namespaced with component[\level2-API]
- Moved to level2-API subdirectory when required.
- Fixed incorrect use statements with leading backslash.
- Remove file phpdoc block
- Remove MOODLE_INTERNAL if not needed.
- Changed code to point to global scope when needed.
- Fix some relative paths and comments here and there.
- All them passing individually.
- Complete runs passing too.

Special mention to:

- When belonging to other components and being valid api:
  - analytics related tests have been moved to tests/analytics subdir.
  - backup & restore related tests have been moved to tests/backup subdir.
  - events related tests have been moved to tests/event subdir.
  - privacy related tests have been moved to tests/privacy.
  - task related tests have been moved to tests/task subdir.
- Some simple renames, not including the component part anymore (not
  needed now that they are namespaced):
  - some xxxlib_test.php have been renamed lib_test.php
    (when they where testing the corresponding lib.php).
  - cache stores tests have been all renamed store_test, originally
    each one had its own name (file_test, apcu_test, redis_test...)
  - assign feedback tests have been all renamed feedback_test, originally
    each one had its own name (file_test, editpdf_test...)
2022-03-03 12:19:30 +01:00
Eloy Lafuente (stronk7)
e2821bf1ce MDL-73824 gradebook: Stricter float check to some gradelib functions
It has been detected that, right now, some localised floats are
being passed to those functions (say comma separator, say thousands)
and that's leading to all sort of problems later when comparing,
processing or storing those "wrong-floats" (user entered).

This just makes all those functions to be stricter, so any attempt
of passing to them a wrong float will fail with a clear TypeError.

Any existing case must be converted to a corrrect (X.Y) format, using
unformat_float() or PARAM_LOCALISEDFLOAT before any processing.

Localised floats cannot be used.

Also, fix all the places where those functions are called from
files having strict_types enabled because, with that, now float-like
strings are not accepted any more. Luckily, there is only case,
within the grade/classes/component_gradeitem.php file, and it has
been fixed by casting the float-like string coming from DB to float.
2022-03-03 12:19:02 +01:00
Bas Brands
729ae8f096 MDL-73902 theme_boost: prevent dropdowns being cut off 2022-03-03 09:44:33 +01:00
Mikhail Golenkov
8c914c8756 MDL-73993 phpdoc: get_module_types_names returns lang_string objects 2022-03-03 10:39:09 +11:00
Eloy Lafuente (stronk7)
bdedb3f9c9 Merge branch 'MDL-73953-master' of https://github.com/aanabit/moodle 2022-03-02 14:33:07 +01:00
Amaia Anabitarte
7a6d0015e7 MDL-73953 core_adminpresets: Fixing latest created Full preset 2022-03-02 13:45:15 +01:00
Andrew Nicols
9331de13ab MDL-71636 qbank_columnsortorder: Fix issues identified during integration 2022-03-02 20:18:41 +08:00
Andrew Nicols
b15051a55f Merge branch 'MDL-71636' of https://github.com/timhunt/moodle 2022-03-02 19:56:24 +08:00
Eloy Lafuente (stronk7)
facf5cbcd0 Merge branch 'MDL-73953-master' of https://github.com/aanabit/moodle 2022-03-02 12:54:12 +01:00
Amaia Anabitarte
534cc4dada MDL-73953 core_adminpresets: Apply fullpreset setting changes 2022-03-02 12:49:02 +01:00
Amaia Anabitarte
c0196fb096 MDL-73953 core_adminpresets: Marking core presets on DB 2022-03-02 12:49:01 +01:00
Bas Brands
a31cade872 MDL-74045 theme_boost: set the base layout to drawers 2022-03-02 11:07:45 +01:00
Marc-Alexandre Ghaly
6dc1084c47 MDL-71636 qbank_columnsortorder: Add a columnsortorder settings page
This implementation will introduce a feature "columnsortorder"
which will add the column sort order feature in an external page.
Having this feature will give users the flexibility of sorting plugin
columns in the question bank view.
2022-03-02 09:08:50 +00:00
Amaia Anabitarte
77ca86bf87 MDL-73953 core_adminpresets: Upgrading presets with different language 2022-03-02 09:42:46 +01:00
Jun Pataleta
7ac5deaced Merge branch 'MDL-73462-master' of https://github.com/peterRd/moodle 2022-03-02 13:46:10 +08:00
Peter Dias
4d5a25ffde MDL-73462 navigation: Leverage participants bar for category 2022-03-02 12:27:02 +08:00
Eloy Lafuente (stronk7)
1920243b79 Merge branch 'MDL-73756-master' of https://github.com/lameze/moodle 2022-03-01 19:46:21 +01:00
Eloy Lafuente (stronk7)
9dde12dc99 Merge branch 'MDL-72092-master' of https://github.com/Chocolate-lightning/moodle 2022-03-01 14:55:02 +01:00
Bas Brands
757b8c636e MDL-73796 theme_boost: mobile navcrumb design 2022-03-01 13:55:32 +01:00
Ilya Tregubov
47e880e347 Merge branch 'master_MDL-72448-qank_history' of https://github.com/catalyst/moodle-MDL-70329 2022-03-01 13:49:19 +02:00
Jun Pataleta
0dca278d71 MDL-72737 core: Rebuild JS modules 2022-03-01 19:22:24 +08:00
Mathew May
b0532aedd8 MDL-72092 behat: Add private files block where needed 2022-03-01 19:13:20 +08:00
Jun Pataleta
0f35a9b7f9 Merge branch 'MDL-72737-master-2' of https://github.com/bmbrands/moodle 2022-03-01 19:06:52 +08:00
Bas Brands
2faf5e8e48 MDL-72737 theme_boost: update for section header styles 2022-03-01 12:01:59 +01:00
Jun Pataleta
d8cadf7ecf Merge branch 'MDL-73462-master' of https://github.com/peterRd/moodle 2022-03-01 18:32:05 +08:00
Peter Dias
b9f9aae134 MDL-73462 course: Update visible nodes in a cat context. 2022-03-01 17:57:24 +08:00