30533 Commits

Author SHA1 Message Date
Jun Pataleta
a360fd0601 Merge branch 'MDL-76977-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-01-25 16:10:18 +08:00
Eloy Lafuente (stronk7)
e6dfa9ff3c MDL-76362 output: Preserve original behaviour for PHP 8.1
Whenever the page_requirements_manager::js_fix_url()
is called with null url, it must throw an exception and emit 0 warnings.

It's covered by an explicit test:

test_js_fix_url_coding_exception with data set "Provide a null argument"
2023-01-23 09:17:48 +08:00
Andrew Nicols
8f4bd4ce11 MDL-76362 core: Coding style fixes 2023-01-23 09:16:08 +08:00
Andrew Nicols
a4ea607c24 MDL-76362 core: Short circuit s() on empty values 2023-01-23 09:16:08 +08:00
Andrew Nicols
dbfb5eaa45 MDL-76362 core: Short-circuit strip_querystring on empty values 2023-01-23 09:16:08 +08:00
Andrew Nicols
788d86d7a3 MDL-76362 core_file: Check prefix exists before checking length 2023-01-23 09:16:07 +08:00
Andrew Nicols
a1f4f7bac5 MDL-76362 core: plugin names must be strings to be valid 2023-01-23 09:16:07 +08:00
Andrew Nicols
d08319ddf7 MDL-76362 core: Update core_component plugin name tests 2023-01-23 09:16:07 +08:00
Andrew Nicols
de4de9cec5 MDL-76362 core: Test coursealias before using 2023-01-23 09:16:07 +08:00
Andrew Nicols
5fbbb51882 MDL-76362 core: Use empty default string when getting prefs
The json_decode function does not accept a null, which is the
traditional default for get_user_preferences. By passing a default of
am empty string we avoid issues in PHP 8.1.
2023-01-23 09:16:06 +08:00
Marina Glancy
2dd7290ccb MDL-76362 various: Avoid passing nulls to functions that don't allow nulls
PHP 8.1 is more strict on the parameter type. Functions such as trim(), strlen(), str_replace(), etc
show notice when null is passed as an argument
2023-01-23 09:16:06 +08:00
Marina Glancy
d83368a475 MDL-76362 mustache: Override parent method to avoid PHP notices
Parent method checks baseDir that is null in this case. This shows notices under PHP 8.1
2023-01-23 09:16:06 +08:00
Paul Holden
a68f5c6d37 MDL-76977 phpunit: ensure unique data provider keys in mustache test. 2023-01-20 17:21:27 +00:00
Jun Pataleta
396fff3d0b Merge branch 'MDL-76537_401' of https://github.com/stronk7/moodle into MOODLE_401_STABLE 2023-01-19 11:23:51 +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
Eloy Lafuente (stronk7)
7c66344323 MDL-76537 core: Fix date_format_string() to work with php-intl
With Moodle 4.1 and up, we have stopped to work with strftime(),
because it's deprecated for PHP 8.1 and up and, instead we are
using core_date::strftime() that performs the conversions using
the php-intl extension.

The original strftime() had a lot of OS-specific dependencies,
both about locale names and charsets used to provide the information.

Instead, the php-intl gets rid of all those OS-specific nightmares
and only uses ICU/Unicode locales and UTF-8.

Because of that, the old utf-8 => windows charset => utf-8
conversions aren't needed anymore. Hence, removing them.
2023-01-14 12:16:48 +01:00
Jun Pataleta
217a32f033 Merge branch 'MDL-76649_401' of https://github.com/timhunt/moodle into MOODLE_401_STABLE 2023-01-12 12:06:45 +08:00
Jun Pataleta
d24c201b6d Merge branch 'MDL-76474-401-2' of https://github.com/HuongNV13/moodle into MOODLE_401_STABLE 2023-01-12 11:55:41 +08:00
Huong Nguyen
4d9960ace2 MDL-76474 tiny_h5p: Prevent H5P Formatter placeholder to be assessed 2023-01-12 10:53:06 +07:00
Huong Nguyen
4e1c4f4483 MDL-76474 tiny_accessibilitychecker: Prevent placeholders to be assessed 2023-01-12 10:53:04 +07:00
Huong Nguyen
b4e7d5300a MDL-76474 editor_tiny: Implement placeholder selector list
We created a list of placeholder selectors in placeholderSelectors option.
The purpose of this list is to indicate the contents that are only shown
in the editor and not to the users, by that way, we can decide to apply or
not to apply rules, styles, etc... to these contents
2023-01-12 10:52:39 +07:00
Paul Holden
f3c335b376 MDL-76862 user: ensure user can only update own preferred start page. 2023-01-12 11:35:26 +08:00
Andrew Nicols
833bc53bbb Merge branch 'MDL-76356_401' of https://github.com/stronk7/moodle into MOODLE_401_STABLE 2023-01-11 10:30:25 +08:00
Paul Holden
f5844e80fd Merge branch 'MDL-76803-401' of https://github.com/junpataleta/moodle into MOODLE_401_STABLE 2023-01-10 16:24:16 +00:00
Marina Glancy
ff5fc3820a MDL-76356 various: avoid implicit conversion to int
PHP before version 8.1 automatically converted to int if the function
parameter (or array key) is expected to be int. PHP 8.1 shows notice in
this case
2023-01-10 15:25:57 +01:00
Marina Glancy
66dcb1683b MDL-76356 various: avoid implicit conversion to arrays
PHP before version 8.1 automatically converted stdClass or 'false' to arrays if
function parameter expects array (for example, "reset").
PHP 8.1 shows notices in these situations
2023-01-10 15:03:40 +01:00
Jun Pataleta
8280476728 MDL-76803 lang: Update usages of reworded email display options 2023-01-10 16:01:44 +08:00
Tim Hunt
d71ada1952 MDL-76649 quiz statistics task: output more useful trace info
At the moment, quiz_statistics\task\recalculate gives no useful
information about what it is doing, which makes it hard to investigate
if the task fails. This commit makes it more usefully verbose.

Also, following this change, one instance of this task will not
run for more than one hour at a time.

As part of this commit, I have added a new helper mtrace_exception.
to consistently log exceptions in scheduled tasks. It is sad to
add a new function to moodlelib.php, but that seemed the logical place.
Looking at other tasks, this method is badly needed. Many are just
logging the ->getMessage() which is normaly insufficient for proper
debugging. However, swiching all existing tasks to use the new function
will need to wait for a future MDL.
2023-01-09 13:34:14 +00:00
Jun Pataleta
8ea2421cd4 Merge branch 'MDL-76785-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-01-09 19:38:42 +08:00
Jun Pataleta
1361e6ad92 Merge branch 'MDL-76506_m41' of https://github.com/jrchamp/moodle into MOODLE_401_STABLE 2023-01-09 19:33:59 +08:00
Paul Holden
3387060fe1 MDL-76785 tiny_media: define video width/height language strings.
AMOS BEGIN
 CPY [videoheight,atto_media],[videoheight,tiny_media]
 CPY [videowidth,atto_media],[videowidth,tiny_media]
AMOS END
2023-01-09 10:52:18 +00:00
Jun Pataleta
5d27f595d7 Merge branch 'MDL-76787-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2023-01-09 18:38:55 +08:00
Paul Holden
b99d68087d Merge branch 'MDL-32114-401' of https://github.com/srobotta/moodle into MOODLE_401_STABLE 2023-01-06 11:20:47 +00:00
Stephan Robotta
64b8061180 MDL-32114 form: markdown must be preserved on saving post
- Markdown is saved to the DB, no conversion to HTML to keep
  ability to reedit the content without beaking it.
- Blockquote element is styled that it's distingishable from
  normal text.
2023-01-05 18:36:16 +01:00
Andrew Nicols
b24414554f Merge branch 'MDL-76508-401' of https://github.com/meirzamoodle/moodle into MOODLE_401_STABLE 2023-01-05 21:30:22 +08:00
Paul Holden
f8b463e394 MDL-76787 tiny_h5p: correct capability for plugin enabled state. 2023-01-04 16:07:47 +00:00
Sara Arjona
3e4ba8af5c Merge branch 'MDL-60038-401' of https://github.com/aneno-m-e/moodle into MOODLE_401_STABLE 2023-01-02 16:35:23 +01:00
Ilya Tregubov
f84d8e3c37 Merge branch 'MDL-76399-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2022-12-29 09:43:28 +07:00
Sara Arjona
52d5ebbb21 Merge branch 'MDL-72523-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2022-12-28 13:01:39 +01:00
Huong Nguyen
510bf00643 MDL-72523 javascript: Introduce setReturnElement for core/modal 2022-12-28 11:14:44 +00:00
Sara Arjona
1be732e913 Merge branch 'MDL-69071-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2022-12-28 11:41:11 +01:00
Sara Arjona
430c7ff4e7 Merge branch 'MDL-76734-401' of https://github.com/andrewnicols/moodle into MOODLE_401_STABLE 2022-12-28 10:04:31 +01:00
Meirza
9d822d41d8 MDL-76508 templates: Handling non-JSON string
When the param string contains a left curly bracket as the first character,
the system will assume the string is a JSON string and will be parsed and returned as an object.
But in some cases, the string is not JSON and will return an error if the system parses it.
For example, a user might have used the course name with a left curly bracket as the first character.
Adding a double quote after the left curly bracket to differentiate between string and JSON string,
so it can be safe to parse the string.
2022-12-24 05:50:56 +07:00
Noemie Ariste
e89ed4b463 MDL-60038 moodlelib: ignore site policy if user auth type = 'webservice' 2022-12-23 10:09:09 +13:00
Philipp Imhof
9d64ad1416
MDL-76731 behat: add steps to check for version
Co-authored-by: Andrew Nicols <andrew@nicols.co.uk>
2022-12-22 17:12:47 +01:00
Ilya Tregubov
0b7102abcc Merge branch 'MDL-76667-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE 2022-12-22 12:27:51 +07:00
Mark Johnson
0c448af668 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:28 +00:00
Andrew Nicols
744e1dbaea MDL-76734 editor_tiny: Listen to TinyMCE submit events
jQuery submit events do not trigger the native submit event, and
therefore the TinyMCE submit listener is not called. This means that the
tinymce.triggerSave() function is not called, and the editor content is
not saved.

To work around this, if there is a form for the Node that the editor is
attached to, the jQuery submit event is listened to and the save event
called.

Unfortunately it is not possible to use a global jQuery submit listener
added to the document to save all editors on the page.
In some cases, this is too late because the bubbling process means that
a child node consumer may attempt to consume the data before the
delegated handler is called for the document.
2022-12-21 13:03:14 +08:00
Paul Holden
1dda343f05 MDL-76399 behat: improvements to "should exist in" thrown exception. 2022-12-16 12:29:57 +00:00
Paul Holden
b874e20b55 MDL-69071 core: retrieve full result from remote content.
Use the full result from download_file_content within the component
installer to ensure that spurious debugging is not emitted during
operation. Handle validation of the returned data consistently.
2022-12-15 17:19:17 +00:00