757 Commits

Author SHA1 Message Date
Leon Stringer
a283cf8fbe MDL-78700 filter_tidy: Stop using 'clean'
When libtidy removed option 'drop-font-tags' the docs said to use the
'clean' option instead (see MDL-69951).  However, 'clean' replaces
legacy style information with classes, the corresponding CSS added in
<head>.  With 'show-body-only' (used because we're inserting an HTML
fragment mid-way through <body>) that <head> with its CSS is omitted.
So 'clean' with 'show-body-only' removes legacy style information,
rather than tidying it. Consequently we now drop the 'clean' option.
This means <font> tags are no longer dropped as libtidy currently has
no equivalent to the removed 'drop-font-tags' functionality.
2023-07-24 17:31:53 +01:00
Andrew Nicols
de329f8268 Merge branch 'MDL-75913-401' of https://github.com/davewoloszyn/moodle into MOODLE_401_STABLE 2023-06-22 14:37:43 +02:00
David Woloszyn
86a2213223 MDL-75913 behat: Use alternatives to Atto in tests 2023-06-19 16:38:18 +10:00
Petr Skoda
52e39db7ad MDL-77525 filter: add filtering stages 2023-06-17 16:49:34 +02:00
Jun Pataleta
0479c711c2 Merge branch 'MDL-76688/401' of https://github.com/skodak/moodle into MOODLE_401_STABLE 2023-05-23 15:22:04 +08:00
Andrew Nicols
da78523b15
Merge branch 'MDL-77592-401' of https://github.com/golenkovm/moodle into MOODLE_401_STABLE 2023-05-10 13:03:57 +08:00
Petr Skoda
a7920b3860 MDL-76688 filter_text: prevent LaTeX3 syntax 2023-05-08 10:12:46 +02:00
Sara Arjona
b10f6f5036 MDL-76857 filter_displayh5p: Improve behat tests
Although the screenshots in the failures for some of the scenarios in
filter/displayh5p/tests/behat/h5p_filter.feature, like "Render a local
H5P file as teacher" were displaying the expected result, there were
some javascript errors (probably due to behat is quicker and the
iframes were not always ready).
I've added one extra step before accessing the iframe to give more
time to the H5P player to load and confirm the page is displayed
properly.
2023-04-27 11:21:36 +02:00
Petr Skoda
f336875b1a MDL-76859 h5p: Fix behat failures
- Only resize if the H5P EmbedCommunicator is defined (otherwise, it was causing a
JS error)
- An unnecessary image has been removed from the greeting-card.h5p fixture package.
That way, the text will always be displayed (even if the iframe is still not
resized). Instead of replacing the original greeting-card-887.h5p file, I've
renamed it to greeting-card.h5p, to remove these ugly and unnecessary numbers
at the end of the file name).
2023-04-12 12:27:06 +02:00
Mikhail Golenkov
af7422edc0 MDL-77592 filter_tex: Use request dir instead of temp shared storage 2023-03-31 14:34:54 +11:00
Jun Pataleta
bb61d8392b Merge branch 'MDL-77559-401-2' of https://github.com/andrewnicols/moodle into MOODLE_401_STABLE 2023-03-09 15:57:44 +08:00
Andrew Nicols
cd48ae56c7 MDL-77559 js: Rebuild all JS with Node 16 2023-03-09 09:53:19 +08:00
Petr Skoda
3caeef44d2 MDL-77524 filter_algebra: fix error message 2023-03-08 11:26:58 +08:00
Petr Skoda
0292427f51 MDL-76645 filter_data: fix link title attribute 2023-03-08 01:00:30 +00:00
Andrew Nicols
288620b0b4 MDL-75012 js: Full build of all grunt things 2023-03-02 12:15:25 +08:00
Paul Holden
70a5e38b2c MDL-70070 phpunit: correct data provider method names.
They should not be prefixed `test_` because that's how actual
test methods containing assertions are identified by PHPUnit.
2023-01-16 08:28:31 +00:00
Jun Pataleta
d9cd25c2fb MDL-76497 upgrade: add the 4.1.0 separation line to all upgrade scripts 2022-12-01 08:59:07 +03:00
Marina Glancy
a5f92c041e 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:32 +01:00
Jun Pataleta
00bae8b8a4 MDL-76403 versions: bump all versions and requires near release 2022-11-23 09:45:23 +08:00
Simey Lameze
a91499c9f1 MDL-75922 behat: Apply @editor_atto tag to tests requiring Atto
These steps are currently using Atto-specific UI features and must
therefore make use of the @editor_atto tag to ensure that they continue
to run using Atto.

A new issue will be raised to migrate each of these to be
editor-agnostic.
2022-10-09 20:26:01 +08:00
Andrew Nicols
547cae0a02 MDL-74697 libraries: Update all third-party libraries with more metadata 2022-07-22 07:28:47 +02:00
Jun Pataleta
3c6fdb1993 Merge branch 'MDL-71062-master' of https://github.com/sharidas/moodle 2022-07-13 11:39:08 +08:00
Sujith Haridasan
73d604369d MDL-71062 core: Step 1 deprecation of print_error function 2022-07-13 08:20:54 +05:30
Eloy Lafuente (stronk7)
58b56e2395 MDL-71747 upgrade: remove all the < 3.9.0 upgrade steps
This just deletes all the upgrade steps previous to 3.9.0. Some
small adjustments, like tweaking globals can also be applied
when needed.

Also includes an upgrade step to prevent upgrading from any
version < 2020061500 (v3.9.0) as anti-cheating measure.

The next commits will proceed to deprecate / remove functions
that were exclusively (usually belonging to upgradelib) being
used by those, now removed, upgrade steps. This is the list
of code to remove and document in upgrade.txt files:

  - upgrade_analytics_fix_contextids_defaults()
  - upgrade_convert_hub_config_site_param_names()
  - upgrade_rename_prediction_actions_useful_incorrectly_flagged()
  - \mod_forum\task\refresh_forum_post_counts adhoc task.

And these is the code that has NOT been removed
because it may be needed later (no matter there aren't uses now):

  - \core_search\manager::clean_up_non_existing_area(), used by
  - \core\task\clean_up_deleted_search_area_task adhoc task
2022-07-07 19:16:37 +02:00
Helen Foster
e73756abdd MDL-75008 lang: Import fixed English strings (en_fix) 2022-06-30 20:31:27 +02:00
Jun Pataleta
0e853ae535 Merge branch 'MDL-74455' of https://github.com/paulholden/moodle 2022-06-13 17:20:39 +08:00
Paul Holden
1cd65d696f MDL-74455 filter_multilang: add text labels for plugin settings.
AMOS BEGIN
 MOV [multilangforceold,core_admin],[forceoldsyntax_desc,filter_multilang]
AMOS END
2022-06-08 18:52:12 +01:00
Ilya Tregubov
07c145cb53 Merge branch 'MDL-69951-remove_drop-font-tags' of https://github.com/leonstr/moodle 2022-06-06 11:11:07 +06:00
Leon Stringer
57aabee4e8 MDL-69951 filter_tidy: Replace drop-font-tags
The option drop-font-tags was removed in HTML Tidy version 5.5.14.  It
had been deprecated since 5.1.25, the docs said "Use the clean option
instead" which is what this commit does (see
https://api.html-tidy.org/tidy/quickref_5.1.25.html#drop-font-tags).
2022-05-12 11:42:05 +01:00
Eloy Lafuente (stronk7)
caf55abf17 MDL-74413 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:

- Moved to the level2 "privacy" namespace:
  - \mod_assign\privacy\feedback_legacy_polyfill_test
  - \mod_assign\privacy\submission_legacy_polyfill_test

- Moved to the level2 "task" namespace:
  - \core_message\task\migrate_message_data_test
  - \ltiservice_gradebookservices\task\cleanup_test
  - \message_email\task\send_email_test
  - \mod_lti\task\clean_access_tokens_test
  - \mod_workshop\task\cron_task_test

- Moved to the level2 "event" namespace:
  - \core_h5p\event\deleted_test
  - \core_h5p\event\viewed_test

- Renamed to a better name:
  - backup_forum_activity_task_test.php (missing "task")
2022-05-07 20:32:30 +02:00
Eloy Lafuente (stronk7)
76f5445451 MDL-74510 upgrade: add the 4.0.0 separation line to all upgrade scripts 2022-04-22 18:45:10 +02:00
Jun Pataleta
70f6b1605b MDL-74471 versions: bump all versions and requires near release 2022-04-13 10:37:36 +08:00
David Matamoros
56b035321a MDL-74228 filters: Fixed typos in core_filters events file 2022-03-16 12:21:26 +01: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
Mihail Geshoski
e949e1a33b MDL-73169 core_filter: Update course category breadcrumb nodes 2022-03-02 17:27:38 +08: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
Mathew May
b0532aedd8 MDL-72092 behat: Add private files block where needed 2022-03-01 19:13:20 +08: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
Eloy Lafuente (stronk7)
100bc51f1d MDL-73485 phpunit: externallib, generator and filter tescase names
All externallib_test, generator_test and filter_test classes:

- Namespaced with component[\level2-API]
- Moved to level2-API subdirectory when required.
- Fixed incorrect use statements with leading backslash.
- 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 tests under testing/tests:

1) The core_testing component doesn't exist.
2) But testing/tests are allowed because there is a suite pointing to it (phpunit.xml).
3) So, the only possible namespace for them is "core".
4) And to avoid problems with other core testcases (under lib/tests)
   they have been renamed to have testing_xxxx as prefix.

Finally, also modified calendar/tests/events/events_test.php because it uses
some renamed (core_calendar_externallib_testcase => \core_calendar\externallib_test)
classes.
2022-01-21 19:48:23 +01:00
Eloy Lafuente (stronk7)
0c53a3dec8 MDL-73476 phpunit: events, external and search tescase names
All events_test, external_test and search_test classes:

- Namespaced with component[\level2-API]
- Moved to level2-API subdirectory when required.
- Fixed incorrect use statements with leading backslash.
- 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 lib/external/tests/external_test.php:
- external is not a valid component
- hence, its only valid namespace is "core"
- also, it's testing lib/external/externallib.php
- hence, the file (and class) have been renamed to external_externallib_test.php
  (to avoid conflicts with other external_test that may exist in core)
2022-01-14 16:18:39 +01:00
Peter Dias
710c04d5ee MDL-72413 core: Disable the default activity header 2021-12-13 09:49:35 +08:00
Paul Holden
5dc866cc70 MDL-73054 filter_emoticon: re-factor test data providers.
PHPUnit test dataProvider methods should not modify global state,
such as initializing $OUTPUT, as they can cause failures in
unrelated tests at a distance.
2021-11-22 22:29:23 +00:00
Sara Arjona
03af737f21 MDL-71956 filter_h5p: Display the edit content button
The H5P filter will display now the "Edit content" button if the
user can edit the file.
2021-11-09 16:47:19 +01:00
Andrew Nicols
3868d359ba Merge branch 'MDL-72407-master' of git://github.com/sarjona/moodle 2021-10-05 23:20:41 +02:00
Sara Arjona
2a3527ccb0 MDL-72407 videojs: Remove videojs-flash and videojs-swf libraries
Apart from removing these libraries because the Flash Player was deprecated
in 2017 and officially discontinued on 31 December 2020, the rtmp and useflash
settings have been removed too (they make no sense anymore).
2021-10-04 09:31:25 +02:00
Sara Arjona
32576936ad MDL-72347 filter: Remove censor filter
Word censorship filter is not widely used these days so it has been
removed from Moodle core.
2021-10-04 09:28:59 +02:00
Sara Arjona
a0d3e32aa9 MDL-72042 media: Remove SWF media player
The Flash Player was deprecated in 2017 and officially discontinued
on 31 December 2020, so media_swf player has been completely
removed from Moodle core.
2021-09-17 10:39:17 +02:00
Shamim Rezaie
901ee1b6bc MDL-71240 filter_tex: Add allowlist for filter_tex_sanitize_formula 2021-09-10 17:57:33 +02:00