1237 Commits

Author SHA1 Message Date
james-cnz
2771e87019 MDL-76729 filepicker: Restore file picker thumbnails in tree view 2023-01-10 12:03:28 +13:00
Paul Holden
b67b4791b5 MDL-76667 forms: mark modal form as submitted upon success.
Ensure the form change checker module doesn't warn user about it.
2022-12-13 14:22:47 +00: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
Andrew Nicols
7e6d32d7c2 Merge branch 'MDL-76112-master' of https://github.com/marinaglancy/moodle 2022-11-16 10:07:49 +08:00
Sara Arjona
91e66dbaed Merge branch 'MDL-76039' of https://github.com/paulholden/moodle 2022-11-15 17:57:07 +01:00
Víctor Déniz
32fd6e60a4 Merge branch 'MDL-76229-master' of https://github.com/meirzamoodle/moodle 2022-11-14 22:56:13 +00:00
Paul Holden
7012900d08 MDL-76039 forms: account for null values in serialize util method.
Co-authored-by: Marina Glancy <marina@moodle.com>
2022-11-14 14:20:52 +00:00
Meirza
82d491cafa MDL-76229 core_form: Show frozen text editor in a more accessible way. 2022-11-12 18:27:09 +07:00
Sara Arjona
d1a0ee011f Merge branch 'MDL-76059' of https://github.com/paulholden/moodle 2022-11-09 12:31:31 +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
Thong Bui
5151cd6bd0 MDL-75784 Forms: Fix issues multi expand all/collapse buttons on a page 2022-10-26 14:06:54 +07:00
Paul Holden
3be5954500 MDL-76059 forms: graceful early exit for invalid button elements.
Ensure login form tries to capture guest button only if it exists.
2022-10-21 19:36:24 +01:00
Huong Nguyen
0795b579fa MDL-74814 forms: Fix accessibility issue in edit profile page
- Fixed legend tag issue
 - Modified the passwordunmask Javascript hide/unhide the password field by CSS class
2022-10-17 09:31:53 +07:00
Sara Arjona
fd14173a88 Merge branch 'MDL-75656' of https://github.com/paulholden/moodle 2022-10-10 16:16:20 +02:00
Jun Pataleta
6efeecd126 Merge branch 'MDL-75910-master' of https://github.com/andrewnicols/moodle 2022-10-10 11:07:27 +08:00
Andrew Nicols
1e71671205 Merge branch 'MDL-61395' of https://github.com/paulholden/moodle 2022-10-09 13:13:03 +08:00
Simey Lameze
f1be9b6544 MDL-75910 core_form: Allow editor field to set a hidden label
When an editor is used in a form as part of a group, it is missing its
label element.

This happens because there is no inline template for the editor, and
therefore it reverts to using the old `toHtml` function. The legacy
function does not cater to the editor being in a group, and therefore
does not add the hidden label.

In addition, the hiddenLabel attribute was missing from the editor
element. This is a semi-standard element but must be added to each
supporting element.

Both the missing inline template for the editor, and the hidden label
attribute must be present:
- If the hidden label attribute is not present, then the standard inline
  template will add a visible label within the group.
- If the inline editor template is missing, then the label is not shown
  at all.
2022-10-06 22:53:47 +08:00
Andrew Nicols
39241f20e0 MDL-71686 core_form: Include missing build 2022-10-06 14:43:55 +08:00
Andrew Nicols
f075272e69 MDL-71686 core_form: Move form serializer to shared function 2022-10-06 10:21:01 +08:00
Andrew Nicols
2423c26749 Merge branch 'MDL-71686-master' of https://github.com/marinaglancy/moodle 2022-10-06 10:20:56 +08:00
Paul Holden
a366cb4d5c MDL-61395 forms: style frozen tag element values. 2022-09-26 11:15:20 +01:00
Paul Holden
d2924e641b MDL-75656 tag: decode entities in tags element values. 2022-09-26 10:56:28 +01:00
David Woloszyn
2efc12e104 MDL-75459 Collapsable Form Sections: Default state bug fix
In circumstances where all collapsible form sections were expanded on
page load, a check is now made to ensure the expand all/collapse all
button behaves as intended.
2022-09-20 14:44:53 +10:00
Marina Glancy
653433a289 MDL-71686 forms: allow arrays in dynamic forms args 2022-09-14 17:58:02 +02:00
David Mudrák
aa49eb24fb MDL-75553 lang: Fix Behat regressions in scenario files 2022-09-06 21:47:18 +02:00
Jun Pataleta
ba5550ac3b Merge branch 'MDL-75111' of https://github.com/stronk7/moodle 2022-08-31 23:06:05 +08:00
Sara Arjona
471d4a10a8 Merge branch 'MDL-74969-master' of https://github.com/marinaglancy/moodle 2022-08-31 12:29:11 +02:00
Eloy Lafuente (stronk7)
83b490a594 MDL-75111 phpunit: Move tests to use correct names and ns (take#4)
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:

- The following task tests have been moved within the level2 directory:
  - \core\adhoc_task_test => \core\task\adhoc_task_test
  - \core\scheduled_task_test => \core\task\scheduled_task_test
  - \core\calendar_cron_task_test => \core\task\calendar_cron_task_test
  - \core\h5p_get_content_types_task_test => \core\task\h5p_get_content_types_task_test
  - \core\task_database_logger_test => \core\task\database_logger_test
  - \core\task_logging_test => \core\task\logging_test

- The following event tests have been moved within level2 directory:
  - \core\event_context_locked_test => \core\event\context_locked_test
  - \core\event_deprecated_test => \core\event\deprecated_test
  - \core\event_grade_deleted_test => \core\event\grade_deleted_test
  - \core\event_profile_field_test => \core\event\profile_field_test
  - \core\event_unknown_logged_test => \core\event\unknown_logged_test
  - \core\event_user_graded_test => \core\event\user_graded_test
  - \core\event_user_password_updated_test => \core\event\user_password_updated_test

- The following output tests have been moved within level2 directory:
  - \core\mustache_template_finder_test => \core\output\mustache_template_finder_test
  - \core\mustache_template_source_loader_test => \core\output\mustache_template_source_loader_test
  - \core\output_mustache_helper_collection_test => \core\output\mustache_helper_collection_test

- The following tests have been moved to their correct tests directories:
  - lib/tests/time_splittings_test.php => analytics/tests/time_splittings_test.php

- All the classes and tests under lib/filebrowser and lib/filestorage
  belong to core, not to core_files. Some day we should move
  them to their correct subsystem.
- All the classes and tests under lib/grade belong to core, not
  to core_grades. Some day we should move them to their correct
  subsystem.
- The core_grades_external class and its \core\grades_external_test
  unit test should belong to the grades subsystem or, alternatively,
  to \core\external, they both should be moved together.
- The core_grading_external class and its \core\grading_external_test
  unit test should belong to the grading subsystem or, alternatively,
  to \core\external, they both should be moved together.
- The \core\message\message and \core\message\inbound (may be others)
  classes, and their associated tests should go to the core_message
  subsystem.
- The core_user class, and its associated tests should go to the
  core_user subsystem.
- The \core\update namespace is plain wrong (update is not valid API)
  and needs action 1) create it or 2) move elsewhere.
2022-08-26 16:34:20 +02:00
Andrew Nicols
c48c431374 MDL-75244 form: Change checker should check existence of tinyMCE API
The window.tinyMCE.editors API was present in version 3 of TinyMCE, but
is not present in later versions. As a result, this check tries to loop
over a variable which does not exist and throws an error in the process.

We should check that window.tinyMCE *and* window.tinyMCE.editors both
exist before attempting to loop over them.
2022-07-28 16:09:21 +08:00
Sujith Haridasan
73d604369d MDL-71062 core: Step 1 deprecation of print_error function 2022-07-13 08:20:54 +05:30
Andrew Nicols
319e14e6cf Merge branch 'MDL-74972-master' of https://github.com/marinaglancy/moodle 2022-07-06 10:58:03 +08:00
Marina Glancy
33f81c73c3 MDL-74969 core_form: same style for headers without shortforms 2022-07-01 10:19:16 +02:00
Paul Holden
240085fd1d MDL-74287 forms: request changesmade string as required.
Unconditionally requesting the string was triggering exceptions
during installation, before the required external functions had
been populated.
2022-06-16 08:07:51 +01:00
Marina Glancy
d6540ddfda MDL-74972 core_form: frozen autocomplete element does not display values 2022-06-14 13:27:01 +02:00
Paul Holden
6e85e01d3b MDL-74459 forms: replace import of jqueryui with native code.
We used the import for ensuring collapsible section elements
contained an ID attribute (efbe1530). This conflicted with use
of Bootstrap tooltips.
2022-04-07 22:38:46 +01:00
Paul Holden
efbe15306a MDL-74222 forms: add aria-controls attribute to expand/collapse all. 2022-04-01 18:44:24 +01:00
Paul Holden
ec89abc5bf MDL-74110 forms: disable calendar link when date selector disabled. 2022-03-19 14:24:23 +00:00
Sara Arjona
08bae4cce8 Merge branch 'MDL-74214' of https://github.com/paulholden/moodle 2022-03-17 13:11:47 +01:00
Jun Pataleta
7dfb64c7cb MDL-74073 core: Fix collapsesections accessibility
* Fix focus outline
* Set aria-expanded state accordingly
* Set aria-expanded in the template to false by default as the default
mode of the link is to expand all the sections.

Reference:
https://www.w3.org/TR/wai-aria-practices-1.1/#disclosure
2022-03-16 14:09:14 +08:00
Paul Holden
29c00fc100 MDL-74214 forms: re-calculate calendar panel zIndex each time.
The previous iteration only calculated it's zIndex value on
initial load. This meant that any nodes added subsequent to this
would not be taken into account (e.g. modal forms).
2022-03-15 13:41:42 +00: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
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
Jun Pataleta
0dca278d71 MDL-72737 core: Rebuild JS modules 2022-03-01 19:22:24 +08:00
Bas Brands
2faf5e8e48 MDL-72737 theme_boost: update for section header styles 2022-03-01 12:01:59 +01:00
Andrew Nicols
e1b9d5f3cd MDL-73915 js: Drop support for IE and android
Moodle announced that support for IE would be dropped back in August
2020 with Moodle 3.9 but not active steps were taken at that time. That
decision was made in MDLSITE-6109 and this particular step was meant to
be taken in Moodle 3.10.

This is the first step taken to actively drop support for IE.

This commit also bumps the browser support pattern from 0.25% to 0.3%.
The percentage here includes any browser where at least this percentage
of users worldwide may be using a browser. In this case it causes
support for Android 4.3-4.4 to be dropped, which relate to Android
KitKat (released 2013).

This combination of changes means that all of the supported browsers in
our compatibility list support modern features including async,
for...of, classes, native Promises, and more which has a huge impact on
the ease of debugging code, and drastically reduces the minified file
size because a number of native Polyfills included by Babel are no
longer included.
2022-02-23 08:55:20 +08:00
Andrew Nicols
0a4047ab31 MDL-73915 js: Switch amd minification to terser
Unfortunately the babel minify-mangle plugin seems to be abandoned and
in certain circumstances can be very buggy. The only safe options are to
disable it, or to switch to a different minification library.

Not minifying our javascript is not ideal, so this commit updates the
javascript tasks to use a rollup, combined with babel, and terser.

Babel still converts code from ES/UMD/AMD to AMD modules with the
relevant browser support, whilst terser minifies the code.

The rollup bundler handles tracking and creation of sourcemaps, and
supports better parallelisation of the tasks.

Since the upgrade to Node LTS/Gallium requires an upgrade to @babel/core
and eslint, which change the built files anyway, this seems like the
ideal time to make this change.
2022-02-23 08:55:09 +08:00
Andrew Nicols
aa7f7957ea MDL-73915 js: Upgrade babel and eslint 2022-02-23 08:53:54 +08:00
Sara Arjona
1c33782d73 Merge branch 'MDL-73189-master' of https://github.com/nguyenphuctien/moodle 2021-12-28 11:41:54 +01:00
Eloy Lafuente (stronk7)
e4a2d9c1d4 MDL-73348 phpunit: normalize all privacy provider tests
As far as now all them have correct privacy level2 namespace:
- Move them to "privacy" subdir.
- Rename the files to "provider_test.php", this includes old
  privacy_test.php and privacy_provider_test.php files
- Rename the testcase to provider_test too (to match file name)

Also, change some relative paths and comments to point to new
locations.
2021-12-17 14:21:02 +01:00