3041 Commits

Author SHA1 Message Date
Ilya Tregubov
ff4f52ddcf Merge branch 'MDL-82663-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-09-20 10:17:24 +08:00
Paul Holden
230831bc70
MDL-82494 user: correct profile field name formatting method.
Add optional `$escape` parameter to allow for unescaped return.
2024-08-30 09:48:08 +01:00
Paul Holden
8caac3da44
MDL-82663 user: fix check for current user removing own enrolment.
We only need to remove the current user from selection if they were
ever part of the selection originally.
2024-08-27 16:55:20 +01:00
Marina Glancy
aca6d79b91 MDL-82567 core: Add has_capability method
Co-authored-by: David Woloszyn <david.woloszyn@moodle.com>
Co-authored-by: Jun Pataleta <jun@moodle.com>
2024-08-26 04:01:20 +00:00
Jun Pataleta
4973da2768
Merge branch 'MOODLE_404_MDL-82518' of https://github.com/danielneis/moodle into MOODLE_404_STABLE 2024-08-07 17:12:08 +08:00
Ilya Tregubov
421c0608e8 MDL-79541 core_grades: Hidden user fields check for search.
If some user profile fields are hidden on some grade reports
users without permission were able to see those.
2024-08-07 04:13:49 +00:00
Daniel Neis Araujo
b67fb190b9 MDL-82518 core_user: Fix regression introduced by MDL-80271 2024-08-02 14:46:51 -03:00
Huong Nguyen
799e5c9ecc
Merge branch 'MDL-79717-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-07-11 09:35:15 +07:00
Paul Holden
2196813e1e
MDL-79717 phpunit: ensure unique data provider keys in tests.
Duplicate data provider keys were overwriting and/or duplicating
one another, leading to some cases being skipped.

Other "duplicate array key" errors were picked up by `phpcs` in
this dragnet across all tests, which have also been fixed.
2024-07-10 14:08:52 +01:00
David Woloszyn
1be7820208 MDL-82417 admin: Clarify signoutofotherservices strings 2024-07-09 13:58:14 +10:00
Huong Nguyen
a0a2015027
Merge branch 'MDL-80907-404' of https://github.com/marinaglancy/moodle into MOODLE_404_STABLE 2024-07-04 11:13:38 +07:00
Sara Arjona
7cb072b11e
Merge branch 'MDL-81857-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE 2024-06-19 15:53:02 +02:00
Eloy Lafuente (stronk7)
091b458c52
MDL-81522 phpunit: Add missing void return type to all tests #2
This commit includes more changes, all them also adding the :void
return type to unit tests missing them.

The difference is that all these changes, while also detected
perfectly by the moodle.PHPUnit.TestReturnType sniff, were not
auto-fixed (like the previous commit ones), because all them
do include some "return" statement and, for safety, we don't
fix them.

All the cases have been visually inspected and confirmed that
the existing "return" statements always belong to anon
functions within the test body and not the test own return statement.
2024-06-11 12:18:05 +02:00
Eloy Lafuente (stronk7)
1093256560
MDL-81522 phpunit: Add missing void return type to all tests
While this change is not 100% required now, it's good habit
and we are checking for it since Moodle 4.4.

All the changes in this commit have been applied automatically
using the moodle.PHPUnit.TestReturnType sniff and are, exclusively
adding the ": void" return types when missing.
2024-06-11 12:18:04 +02:00
Paul Holden
1bff691a64
MDL-81857 user: don't check whether address is an identity field.
It can never be selected as one, so the previous comparison could
never pass.
2024-06-06 08:58:42 +01:00
Marina Glancy
ad9d4bb4af MDL-80907 various: fixes to incorrect column selectors in behat 2024-05-07 19:28:46 +01:00
Jun Pataleta
9966241efb
Merge branch 'MDL-81525-main' of https://github.com/andrewnicols/moodle 2024-04-17 23:42:22 +08:00
Stevani Andolo
66da939499 MDL-81354 core: Escape string of fullname 2024-04-17 03:44:22 +00:00
Jun Pataleta
a180dba314
MDL-81549 versions: bump all versions and requires near release 2024-04-17 00:03:29 +08:00
Andrew Nicols
d8b1156e5b
MDL-81525 core_user: Add missing docs 2024-04-15 13:05:11 +08:00
Andrew Nicols
b32fb636c5
MDL-81525 core_user: Use stoppable trait for consistency 2024-04-15 13:05:10 +08:00
Andrew Nicols
6db4285eaa
MDL-81525 core_user: Move after_complete_login to correct NS 2024-04-15 13:05:10 +08:00
Andrew Nicols
d2dddb715d
MDL-81525 core_communication: Correct hook name tense 2024-04-15 13:05:09 +08:00
Andrew Nicols
64aedb9b24
MDL-77967 core_user: Coding style fixes in tests 2024-04-11 14:00:46 +08:00
Andrew Nicols
b64dff686e
Merge branch 'MDL-77967-main' of https://github.com/rmady/moodle 2024-04-11 13:56:54 +08:00
Huong Nguyen
b283ca354e
Merge branch 'MDL-78551-main' of https://github.com/safatshahin/moodle 2024-03-26 10:08:06 +07:00
Safat
d2c5d26190 MDL-78551 core_user: Add hooks api for user updates 2024-03-26 13:53:39 +11:00
Jun Pataleta
556347c4f1
Merge branch 'MDL-81266' of https://github.com/stronk7/moodle 2024-03-26 10:34:47 +08:00
Jun Pataleta
281fecbd54
Merge branch 'MDL-78885-main' of https://github.com/rezaies/moodle 2024-03-25 23:37:57 +08:00
Daniel Ziegenberg
08027e408c
MDL-81281 phpunit: assertObjectHasAttribute is deprecated
To be integrated as part of MDL-81266

When running PHPUnit 9.6 we get the following deprecation warnings:
"assertObjectHasAttribute() is deprecated and will be removed in PHPUnit
10. Refactor your test to use assertObjectHasProperty() instead."

So we replace all instances of assertObjectHasAttribute with
assertObjectHasProperty.

PHPUnit justifies the change with:
> PHPUnit currently refers to "fields" (see above) as "attributes". This
> is (or will become) confusing considering the introduction of
> attributes in PHP 8 and their support in PHPUnit.  PHPUnit will be
> changed to use the term "property" instead of "attribute" where "field"
> is meant.

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2024-03-25 16:21:45 +01:00
Daniel Ziegenberg
87267da39d
MDL-81281 phpunit: assertObjectNotHasAttribute is deprecated
To be integrated as part of MDL-81266

When running PHPUnit 9.6 we get the following deprecation warnings:
"assertObjectNotHasAttribute() is deprecated and will be removed in PHPUnit
10. Refactor your test to use assertObjectNotHasProperty() instead."

So we replace all instances of assertObjectNotHasAttribute with
assertObjectNotHasProperty.

PHPUnit justifies the change with:
> PHPUnit currently refers to "fields" (see above) as "attributes". This
> is (or will become) confusing considering the introduction of
> attributes in PHP 8 and their support in PHPUnit.  PHPUnit will be
> changed to use the term "property" instead of "attribute" where "field"
> is meant.

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2024-03-25 16:21:07 +01:00
Jun Pataleta
f150d5016d
Merge branch 'MDL-81132-master' of https://github.com/jleyva/moodle 2024-03-22 11:57:23 +08:00
Jun Pataleta
e366db6c55
Merge branch 'MDL-80843' of https://github.com/paulholden/moodle 2024-03-22 11:34:23 +08:00
Mathew May
68bf0f5b77 MDL-78885 comboboxsearch: Points from review 2024-03-22 05:50:06 +11:00
Shamim Rezaie
2ac9dc9108 MDL-78885 comboboxsearch: Deprecate trigger 2024-03-22 05:49:52 +11:00
Shamim Rezaie
893a9e43d1 MDL-78885 comboboxsearch: Some small fixes
- Remove aria-busy
- Remove aria-label from the listbox element. A listbox that is part of
  a combobox does not need to be labelled.
- No need for the aria-label for the select all checkbox because it is
  already enclosed in the <label> tag.

- Having "view results for ..." as aria-label of listbox options is not
  helpful and only creates noise.
- Deprecated (viewresults,core) as it was not used anymore
- aria-hidden="true" should not be used on .d-none elements
- 'noresults' was falsely documented as a required context variable for
  resultset.mustache. Not only it was not required, it was not even
  provided!

- Remove duplicate code from user_selector.mustache
- Remove the redundant aria-label from search_input_auto. It already has
  a label.
- Fix placeholder missing from one case
2024-03-22 04:25:01 +11:00
Shamim Rezaie
a320dff736 MDL-78885 aria: Add support for data-short-text 2024-03-22 04:24:23 +11:00
Shamim Rezaie
50eeafeb7d MDL-78885 comboboxsearch: Improve user search and keyboard handling
- Prevent rerendering of the menu when it's already open to preserve the
  selected/highlighted option.
- Allow ArrowUp and ArrowDown to trigger the user search dropdown for
  improved keyboard navigation.

This commit ensures that the menu is not re-rendered when it's already
open, preserving the selected option to enhance the user experience.
Additionally, ArrowUp and ArrowDown keys now trigger the dropdown,
improving keyboard navigation and user interactions.
2024-03-22 04:24:20 +11:00
Shamim Rezaie
8e2555dc48 MDL-78885 comboboxsearch: Switch event listener from 'click' to 'change'
Move from listening to 'click' to listening to 'change'
2024-03-22 04:23:55 +11:00
Shamim Rezaie
bc6a3f5a8d MDL-78885 comboboxesearch: user search should have value as well 2024-03-22 04:23:26 +11:00
Shamim Rezaie
e9ec450668 MDL-78885 comboboxsearch: remove aria-activedecendant on options change 2024-03-22 04:23:22 +11:00
Shamim Rezaie
d886cba9d3 MDL-78885 comboboxsearch: Enable aria.js for auto handling
- Added the `dropdown` class to ensure toggle element focus when the
  dropdown is closed.
- Improved keyboard handling by adding the `dropdown` class.
  aria.js will automatically handle keyboard interactions.
- Removed redundant keyboard handling.
- The "view all results" option is just a normal option in a combobox.
  It should not be treated as the default action for a combobox.
- Ensured correct markup for 'Esc' key handling. aria.js automatically
  focuses on the toggle element if the dropdown's toggle and the
  dropdown menu are wrapped within a .dropdown element.
- Implemented menu closure for outside clicks and when leaving the edit
  box.
- Manually focused on the user search element when opening the search
 dropdown due to a focusLock issue.
- Fix the issue of another dropdown staying open
- Clicking on the clearSearchButton should not close the dropdown
2024-03-22 04:22:24 +11:00
Shamim Rezaie
d18f7bf5cd MDL-78885 core: combobox should have a valid aria-controls
- The aria-controls attribute cannot refer to an element that doesn't
  exist
- Also update filterDataset so it returns [] when searchTerm is empty
2024-03-22 04:00:15 +11:00
Mathew May
e4083441ec MDL-78885 core_user: A11y fixes for user combobox search
Co-authored-by: Shamim Rezaie <shamim@moodle.com>
2024-03-22 03:26:19 +11:00
Marina Glancy
6fdeabd5b5 MDL-80566 user: convert callback 'bulk_user_actions' to hook 2024-03-15 17:00:00 +00:00
Juan Leyva
ca8f197148 MDL-81132 mod_forum: Perforance improvements for app 2024-03-08 10:08:19 +01:00
Jun Pataleta
3278ce7aba
Merge branch 'MDL-65292' of https://github.com/stronk7/moodle 2024-03-08 08:00:41 +08:00
Ilya Tregubov
a6fd25485e Merge branch 'MDL-80342' of https://github.com/paulholden/moodle 2024-03-07 08:51:25 +08:00
Huong Nguyen
d61d607548 Merge branch 'MDL-80241' of https://github.com/paulholden/moodle 2024-03-06 09:23:32 +07:00
Jun Pataleta
e3160bfd16
Merge branch 'MDL-80548' of https://github.com/marinaglancy/moodle 2024-03-05 10:53:12 +08:00