569 Commits

Author SHA1 Message Date
Paul Holden
a0f26a114f
MDL-84000 reportbuilder: move testcase helper to autoloaded namespace.
Clean up some class imports while we're at it.
2024-12-13 10:16:29 +00:00
Andrew Nicols
55126be4ad
MDL-81520 core: Fix test finality 2024-12-11 12:30:21 +08:00
Andrew Nicols
c6942c9bb7
MDL-81521 core: Update all possibly data providers to be static
Note: Some data providers could not be automatically be converted to
being static. These will be handled in a separate issue.
2024-11-18 10:24:55 +08:00
Jun Pataleta
54e9ee4a9e
Merge branch 'MDL-83238-404-enfix' of https://github.com/mudrd8mz/moodle into MOODLE_404_STABLE 2024-10-03 16:02:02 +08:00
David Carrillo
ba131ff29d
MDL-83179 badges: Get type and courseid from context instead of params 2024-10-03 08:12:10 +08:00
David Mudrák
6e61b34ac2 MDL-83238 lang: Fix the changed strings in the tests, too 2024-10-02 22:04:50 +02:00
David Carrillo
c75ec7503c
MDL-83178 reportbuilder: correct access check to view badge recipients 2024-10-02 13:58:07 +08:00
Paul Holden
08127c83a7
MDL-83037 badges: ensure image is specified in Behat test generator. 2024-09-06 11:25:35 +01:00
Paul Holden
cd69894e95
MDL-82804 badges: define no results notice inside report instances.
When doing so from calling code, the property is not persisted when
filtering/paging (or any AJAX interaction); instead, it should be
set from within the report instance itself.
2024-08-29 16:37:58 +01:00
Paul Holden
fafeeda7e1
MDL-82455 badges: link report recipients count to appropriate page. 2024-08-15 21:40:41 +01:00
Paul Holden
8304649791 MDL-82390 badges: correct context check when deleting badges. 2024-08-07 04:13:49 +00:00
Huong Nguyen
6c7121254d
Merge branch 'MDL-73091-404' of https://github.com/laurentdavid/moodle into MOODLE_404_STABLE 2024-07-01 14:05:36 +07:00
Wolfgang Reichert
9dde27f0bb MDL-73091 core_badges: Avoid undefined variable notice in review
* Fix review method for award_criteria_courseset when courseset is empty
* Add unit tests for coverage of the award_criteria_courseset class

@co-authored jz-reichert@web.de
2024-06-25 08:47:34 +02:00
Sara Arjona
f64d94dd62
MDL-82233 badges: Display awarded users only when it applies
The message with the number of uses who have awarded a badge
were displayed always (even when the badge was disabled).
2024-06-18 16:06:49 +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
1c2f5dc1df
MDL-81434 reportbuilder: ensure filter/condition parameter uniqueness.
This change fixes an edge case that could be triggered by creating a
custom report that contained a filter instance that was active as both
a filter and condition, where the filter instance provides parameters
to it's SQL fragment.

There is only one such filter present currently with which we can test
this, see 2f9001cbe9.
2024-05-07 15:03:16 +01: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
Sara Arjona
a399be5f01
Merge branch 'MDL-81073' of https://github.com/paulholden/moodle 2024-03-19 23:18:13 +07:00
Paul Holden
ba1f9cb26c
MDL-81073 badges: better Oracle support for expiry filter.
Avoid the following error by casting the bound parameter:

ORA-00932: inconsistent datatypes: expected CHAR got NUMBER.
2024-03-18 19:53:29 +00:00
Sara Arjona
0d7af68082
Merge branch 'MDL-81073' of https://github.com/paulholden/moodle 2024-03-18 12:43:15 +01:00
Andrew Nicols
9cdc5850c5
Merge branch 'MDL-75952' of https://github.com/stronk7/moodle 2024-03-12 10:45:02 +08:00
Eloy Lafuente (stronk7)
361dfe8145
MDL-75952 general: Since php81, refection->setAccessible() is no-op
Refereces:
- https://wiki.php.net/rfc/make-reflection-setaccessible-no-op
- https://www.php.net/manual/en/reflectionproperty.setaccessible.php
- https://www.php.net/manual/en/reflectionmethod.setaccessible.php

As of PHP 8.1.0, calling this method has no effect; all methods are
invokable by default. So, let's remove all uses from core, they are
no-op.
2024-03-10 21:15:00 +01:00
Paul Holden
8fc9d3e242
Merge branch 'MDL-81128-main' of https://github.com/davidcerezal/moodle into main 2024-03-08 14:50:24 +00:00
David Cerezal
1ded2b9d48 MDL-81128 reportbuilder: use specific step instead workaround 2024-03-08 10:33:15 +01:00
Jun Pataleta
3278ce7aba
Merge branch 'MDL-65292' of https://github.com/stronk7/moodle 2024-03-08 08:00:41 +08:00
Paul Holden
2f9001cbe9
MDL-81073 badges: implement badge entity version/expiry filtering.
Add the same to the manage badges report, plus pre-existing version
column.
2024-03-07 14:38:23 +00:00
Ilya Tregubov
a6fd25485e Merge branch 'MDL-80342' of https://github.com/paulholden/moodle 2024-03-07 08:51:25 +08:00
Sara Arjona
67a1d0b639
MDL-73426 badges: Final deprecation for print_badge_tabs 2024-03-05 13:25:02 +01:00
Sara Arjona
0b3b739370
MDL-80866 behat: Fix failures after disabling Chat and Survey 2024-03-01 11:41:50 +01:00
Eloy Lafuente (stronk7)
ba1f804ffa
MDL-65292 style: Fix all function declarations white space
This has been generated running the following Sniffs, all
them part of the Moodle's CodeSniffer standard:
- PSR12.Functions.ReturnTypeDeclaration
- PSR12.Functions.NullableTypeDeclaration
- moodle.Methods.MethodDeclarationSpacing
- Squiz.Whitespace.ScopeKeywordSpacing

All them are, exclusively, about correct spacing, so the changes
are, all them, only white space changes.

Only exceptions to the above are 3 changes what were setting the
return type in a new line, and, when that happens, the closing
parenthesis (bracket) has to go to the same line than the colon.
2024-02-28 23:33:26 +01:00
Sara Arjona
b33ba0b9fb
Merge branch 'MDL-78967-main' of https://github.com/kevpercy/moodle 2024-02-27 12:49:06 +01:00
Paul Holden
958090edc6
MDL-80342 reportbuilder: use new cohort filter in related reports. 2024-02-21 16:34:35 +00:00
Angelia Dela Cruz
31ce6c87fb MDL-79792 core_badges: Behat test for awarding badge to group members 2024-02-21 13:55:45 +08:00
Kevin Percy
a72a810479 MDL-78967 core_grades: Removed advanced grade item and category options 2024-02-21 13:45:21 +08:00
Sara Arjona
ce7f3eef04
Merge branch 'MDL-79552' of https://github.com/paulholden/moodle 2024-02-14 09:30:09 +01:00
David Carrillo
10d2b5864b
MDL-80325 reportbuilder: Update 'Delete' links to red color
- Update all 'Delete' links on RB system report actions to red color
2024-01-12 15:38:19 +01:00
David Carrillo
76bed1480a
MDL-80052 badges: Convert Course badges report to use Report builder 2023-12-19 10:23:27 +01:00
David Carrillo
982581d5eb
MDL-80052 badges: Convert Badge recipients report to use Report builder 2023-12-19 10:23:26 +01:00
Paul Holden
4fb106506d
MDL-79552 cohort: add cohort data to user-focused custom reports. 2023-12-15 09:58:19 +00:00
Huong Nguyen
b671e89685 Merge branch 'MDL-79828-master' of https://github.com/andelacruz/moodle 2023-12-14 10:14:07 +07:00
Paul Holden
7143cf4cbc
MDL-79397 reportbuilder: update existing entity table definitions. 2023-12-07 17:19:01 +00:00
Paul Holden
c564a8249a MDL-80268 badges: require capability to view awarded badges. 2023-12-06 03:54:20 +01:00
Angelia Dela Cruz
b445e72c80 MDL-79828 core_badges: Delete already awarded course badges 2023-11-21 16:11:39 +08:00
Sara Arjona
95e50b59ea
MDL-75572 criteria: Only award badges to sucessfull completions
The UX team confirmed a badge shouldn't be awarded when the criteria
use a passing grade and the user gets a failing grade.
So the COMPLETION_COMPLETE_FAIL status won't be considered
completed for activities with completion that require a passing
grade.
2023-10-25 07:08:03 +02:00
Andrew Nicols
c81cf6a7b7
MDL-79583 core_badges: Remove unused AMD module
This module was removed by removed by MDL-78324, but added back due to a
merge conflict in MDL-79064.
2023-10-04 14:28:30 +08:00
Ilya Tregubov
5da0cee324
Merge branch 'MDL-79334' of https://github.com/paulholden/moodle 2023-09-14 19:46:53 +08:00
Paul Holden
b6e85266da
MDL-79334 badges: fix return URL of activate action in system report.
We cannot rely on `qualified_me()` to work reliably upon report reload
events (paging, sorting, filtering, etc. are all performed via AJAX).

Small cleanup after f0770658.
2023-09-12 15:13:22 +01:00
Andrew Nicols
adce2874b0
MDL-78324 badges: Remove unnecessary Modal
The core/utility confirmation modal can be used in this case to confirm
backpack actions. It is not necessary to have a custom module for this
purpose.
2023-09-09 00:04:04 +08:00
Andrew Nicols
ee81bfabe8
Merge branch 'MDL-77061' of https://github.com/dravek/moodle 2023-09-05 10:53:19 +08:00
Andrew Nicols
0235a368da
Merge branch 'MDL-78179-master' of https://github.com/sarjona/moodle 2023-09-01 11:25:22 +08:00