28467 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7)
27df23a5b7 Merge branch 'MDL-71159-master' of git://github.com/andrewnicols/moodle 2021-05-26 18:35:55 +02:00
Sara Arjona
eeb5b4b4d8 Merge branch 'MDL-53544-master-2' of git://github.com/peterRd/moodle 2021-05-26 12:39:25 +02:00
Peter Dias
f991397011 MDL-53544 lib: Update unit tests and thirdpartylibs 2021-05-26 16:46:30 +08:00
Peter Dias
490c72f491 MDL-53544 core: Remove typo3 usages in core 2021-05-26 16:46:30 +08:00
Peter Dias
36c64105a7 MDL-53544 lib: Remove typo3 from text.php 2021-05-26 16:46:30 +08:00
Jake Dallimore
83644cc414 Merge branch 'MDL-70990-master' of git://github.com/andrewnicols/moodle 2021-05-26 12:49:34 +08:00
Andrew Nicols
743d17ff58 MDL-70990 core: Deprecate core/events::getLegacyEvents() 2021-05-26 10:49:01 +08:00
Andrew Nicols
31d6adef4d MDL-70990 core_block: Replace legacy BLOCK_CONTENT_UPDATED event
The legacy M.core.event.BLOCK_CONTENT_UPDATED event has been replaced with a
new core_block/events::blockContentUpdated native DOM event.

The new event can be triggered using the `notifyBlockContentUpdated`
event, and by providing the HTMLElement that was updated, for example:

```
import {notifyBlockContentUpdated} from 'core_block/events';

const someHandler = e => {
    // ...
    const updatedBlock = e.target.closest('.block');
    notifyBlockContentUpdated(updatedBlock);
};
```

The new event can be listened to at any point in the DOM using the
following syntax:

```
import {eventTypes} from 'core_block/events';

const handler = e => {
    // The block that was updated.
    e.target;

    // The id of the updated block.
    e.detail.instanceId;
};

document.addEventListener(eventTypes.blockContentUpdated, handler);
```

A backward-compatabibility layer is included to ensure that any legacy
YUI event listener is still called with the same arguments.

This legacy bridges will be removed after Moodle 4.3.
2021-05-26 10:47:17 +08:00
Andrew Nicols
1a9d53d831 MDL-70990 core_form: Replace FORM_ERROR event
The legacy M.core.event.FORM_ERROR event has been replaced with a new
core_form/events::formError native DOM event.

The new event can be listened to at any point in the DOM using the
following syntax:

```
import {eventTypes} from 'core_form/events';

document.addEventListener(eventTypes.formError, handler);
```

A backward-compatabibility layer is included to ensure that any legacy
YUI event listener is still called with the same arguments.

This legacy bridges will be removed after Moodle 4.3.
2021-05-26 10:47:17 +08:00
Andrew Nicols
d4c6ac20c7 MDL-70990 core_filter: Add new native filterContentUpdated event
The legacy M.core.event.FILTER_CONTENT_UPDATED event has been replaced with a
new core_filter/events::filterContentUpdated native DOM event.

The new event can be triggered using the `notifyFilterContentUpdated`
function, and by providing with an Array containing the HTMLElements
that were updated, for example:

```
import {notifyFilterContentUpdated} from 'core_filter/events';

const someHandler = e => {
    // ...
    const nodeList = Array.from(document.querySelectorAll('div'));
    notifyFilterContentUpdated(nodeList);
};
```

The new event can be listened to at any point in the DOM using the
following syntax:

```
import {eventTypes} from 'core_filter/events';

const handler = e => {
    // The list of HTMLElements in an Array.
    e.detail.nodes;
};

document.addEventListener(eventTypes.filterContentUpdated, handler);
```

A backward-compatabibility layer is included to ensure that any legacy
YUI event listener, or jQuery event listener are still called with the
same arguments.

This legacy bridges will be removed after Moodle 4.3.
2021-05-26 10:47:15 +08:00
Andrew Nicols
a44cee78f1 MDL-70990 core_editor: Replace EDITOR_CONTENT_RESTORED event
The legacy M.core.event.EDITOR_CONTENT_RESTORED event has been replaced
with a new core_editor/events::editorContentRestored native DOM event.

The new event can be listened to at any point in the DOM using the
following syntax:

```
import {eventTypes} from 'core_editor/events';

document.addEventListener(eventTypes.editorContentRestored, handler);
```

A backward-compatabibility layer is included to ensure that any legacy
jQuery event is still called with the same arguments.

This legacy bridge will be removed after Moodle 4.3.
2021-05-26 10:47:03 +08:00
Andrew Nicols
a1ccefe2ac MDL-70990 core_form: Standardise event name usage
The `types` object introduced in Moodle 3.11 has been replaced with the
`eventTypes` object which is used consistently across all CustomEvent
definitinos.

Likewise the trigger functions have been renamed from
`triggerUploadStarted` to `notifyUploadStarted` and from
`triggerUploadCompleted` to `notifyUploadCompleted`.

Backwards compatability is maintained.
2021-05-26 10:46:52 +08:00
Andrew Nicols
919db49a44 MDL-70990 core_form: Replace FORM_FIELD_VALIDATION event
The legacy core/event::FORM_FIELD_VALIDATION event has been replaced with a
new core_form/events::formFieldValidationFailed native DOM event.

The new event can be listened to at any point in the DOM using the
following syntax:

```
import {eventTypes} from 'core_form/events';

document.addEventListener(eventTypes.formFieldValidationFailed, handler);
```

A backward-compatabibility layer is included to ensure that any legacy
jQuery event is still called with the same arguments.

This legacy bridge will be removed after Moodle 4.3.
2021-05-26 10:46:52 +08:00
Andrew Nicols
acd9d9823b MDL-70990 core_form: Replace FORM_SUBMIT_AJAX event
The legacy M.core.event.FORM_SUBMIT_AJAX ecent has been replaced with a
new core_form/events::formSubmittedByJavascript native DOM event.

The new event can be listened to at any point in the DOM using the
following syntax:

```
import {eventTypes} from 'core_form/events';

document.addEventListener(eventTypes.formSubmittedByJavascript, handler);
```

A backward-compatabibility layer is included to ensure that any
legacy YUI event triggered on a form is still respected and the new
native event is also fired.

A similar handler is also included to ensure that any legacy YUI event
listener is still called with the same arguments.

These legacy bridges will be removed after Moodle 4.3.
2021-05-26 10:46:49 +08:00
Andrew Nicols
da8658e49a MDL-70990 core: Rewrite core/event as ES6 2021-05-26 10:45:21 +08:00
Eloy Lafuente (stronk7)
413551656d Merge branch 'MDL-71659-master-missinggradeitem' of git://github.com/mudrd8mz/moodle 2021-05-24 23:22:59 +02:00
Andrew Nicols
053b0462fd MDL-70990 core: Ignore amd directory in plugin-like lists
The `get_list_of_plugins()` function is used to fetch plugin-like files
or directories from a specified directory. A number of standard
exclusions are included but this list is not the same as the list in
`core_component`.

The list has been updated to include the `amd` directory, which is
regularly used in both components, and plugins.
2021-05-24 08:47:09 +08:00
Peter Dias
ca76395aba MDL-53544 lib: Remove old Typo3 files 2021-05-21 09:54:36 +08:00
Jun Pataleta
97429f82b4 Merge branch 'MDL-71157-master' of git://github.com/sarjona/moodle 2021-05-20 12:30:15 +08:00
abgreeve
de3f8e1240 Merge branch 'MDL-65203-master' of https://github.com/dcai/moodle 2021-05-20 11:10:07 +08:00
Andrew Nicols
da8787d68d Merge branch 'MDL-71626' of https://github.com/paulholden/moodle 2021-05-20 09:32:06 +08:00
Eloy Lafuente (stronk7)
ba4a7b8ccb Merge branch 'MDL-71126-master' of git://github.com/HuongNV13/moodle 2021-05-19 23:02:41 +02:00
Andrew Nicols
dfaa450621 MDL-71157 core: Pending JS in paged content bars 2021-05-19 09:30:15 +02:00
David Mudrák
a949a151f3 MDL-71659 completion: Consider modules without grade_item incomplete
Activity modules may not have the associated grade_item created yet. It
used to throw fatal error in that case - even when trying to view the
course or edit the activity. So there was no easy way to recover from
this situation.

The patch is based on reasoning that an activity without grade item is
same as activity without any grades. And as such it is considered
incomplete.

A new unit test is added to cover this specific scenario. The existing
unit test is modified and it does not expect the exception any more.
There does not seem to be any good reason why this situation should be
exceptional.
2021-05-18 20:59:51 +02:00
Dongsheng Cai
ee58790e46 MDL-65203 template: tab should be quoted to produce valid json 2021-05-18 20:40:32 +10:00
Luca Bösch
19d7c11b60 MDL-71373 core_enrol: localize "close" in role manager. 2021-05-14 14:18:52 +02:00
Luca Bösch
8c411f1234 MDL-71373 core_table: localize "previous"/"next" in pagination. 2021-05-14 14:18:52 +02:00
Huong Nguyen
46aece2b63 MDL-71126 Quiz: Manual grading page size preference can get stuck at 0
Including in this change:
 - New positiveint regex rule to check if the value is a positive integer
2021-05-14 17:01:45 +07:00
Paul Holden
605c8940a2 MDL-71626 admin: filter site fullname in CLI maintenance script. 2021-05-13 19:57:28 +01:00
Eloy Lafuente (stronk7)
d88452fd29 Merge branch 'MDL-71580-master-enfix' of git://github.com/mudrd8mz/moodle 2021-05-12 22:58:12 +02:00
David Mudrák
03402e3c5d MDL-71580 lang: Fix reworded strings in tests 2021-05-12 17:10:16 +02:00
Eloy Lafuente (stronk7)
9d6aa39985 MDL-71583 versions: Add all the missing full-stops to version/requires
It seems that the new phpcs3 checker is now controlling those
line comments that previously were ignored.

This commit just looks for all the cases and bulk-add
them when needed. The bash script (mac) used to add all them is:

while read -r line; do
    arr=(${line//:/ })
    if [[ -n ${arr[0]} ]] && [[ -n ${arr[1]} ]]; then
        echo "  file ${arr[0]}, line ${arr[1]}"
        sed -i "${arr[1]}s/\$/\./" ${arr[0]}
    fi
done < <(find . -name version.php | xargs ag --nomultiline '>(version|requires) *=.*//.*[^;\.]$')
2021-05-11 20:11:07 +02:00
Sara Arjona
71c59ad8dd Merge branch 'MDL-71533' of git://github.com/danmarsden/moodle 2021-05-10 11:37:58 +02:00
Jun Pataleta
3482ce5f78 Merge branch 'MDL-71395-master-2' of git://github.com/marinaglancy/moodle 2021-05-07 10:30:23 +08:00
Dan Marsden
f7529abb48 MDL-71533 lib: Remove libraries that already exist in core. 2021-05-07 12:18:47 +12:00
Víctor Déniz
47d63ce9ef Merge branch 'MDL-71303' of https://github.com/StudiUM/moodle 2021-05-06 23:32:05 +01:00
Marina Glancy
b46badb130 MDL-70926 core: getuserdate() shoud show debugging if null was passed
passing null to getdate() has different results in PHP7 and PHP8
2021-05-06 19:55:32 +02:00
Sara Arjona
5e2a754e16 Merge branch 'MDL-71420' of https://github.com/stronk7/moodle 2021-05-06 17:58:02 +02:00
Marina Glancy
5148d33fa1 MDL-71395 core: fix bug in google lib wrapper
because of changes in PHP8 the '' == 0 is no longer true and the error in the google api wrapper was discovered
2021-05-06 15:39:11 +02:00
Eloy Lafuente (stronk7)
d676a8114e MDL-71420 environment: Add some strategic comments and todos.
This isn't really a deprecations where something is replaced
by another and all uses must adapt to. Instead it's just a
fallback functionality that will stop working in Moodle 4.2.

Because of that, I've tried to add TODO/@todo comments to
the places that will need to modified, always pointing to
MDL-71421 that is where the removal will happen.

Also, haven't added any debugging() output, after thinking
a lot about it, because this isn't anything that developers
can be using but a internal implementation detail (a fallback)
that we want to remove in some versions.
2021-05-06 14:29:33 +02:00
Sara Arjona
d8a029ad64 Merge branch 'MDL-71390-master' of git://github.com/marinaglancy/moodle 2021-05-06 08:01:47 +02:00
Jun Pataleta
5891fb1352 Merge branch 'MDL-71518-master' of git://github.com/rezaies/moodle 2021-05-06 11:38:48 +08:00
Shamim Rezaie
a27876c3df MDL-71518 behat: Remove %P and AM/PM
The %P modifier is not supported in the macOS (MDL-71549)
2021-05-06 12:31:42 +10:00
Víctor Déniz
f798446f4c Merge branch 'MDL-71460-master' of git://github.com/peterRd/moodle 2021-05-05 10:16:44 +01:00
Marina Glancy
d42fd649cc MDL-71390 core: raise max_input_vars requirement 2021-05-05 10:49:59 +02:00
Jun Pataleta
e8b3ab767b Merge branch 'MDL-71518-master' of git://github.com/rezaies/moodle 2021-05-05 13:26:29 +08:00
Shamim Rezaie
35d1ac13d2 MDL-71518 core: Add weekday to activity dates 2021-05-05 13:56:06 +10:00
Peter Dias
e5f7ecdacd MDL-71460 hub: Use checkboxes instead of dropdowns
Change the yes/no dropdowns to a checkbox. Defaults to unchecked.
2021-05-05 10:03:18 +08:00
Víctor Déniz
162278e69a Merge branch 'MDL-70864-master-zip_packer_windows' of git://github.com/mudrd8mz/moodle 2021-05-05 00:01:28 +01:00
Eloy Lafuente (stronk7)
9b522367a0 Merge branch 'MDL-71425-master-enfix' of git://github.com/mudrd8mz/moodle 2021-05-04 23:39:32 +02:00