The badges/index.php and badges/view.php pages are quite similar and
have been merged into index.php.
This commit updates index.php to incorporate the missing information
previously found in view.php.
From the new badge page, when the form is cancelled, a redirect should
be done to the badges/index.php.
This is a regression introduced when newbadge.php and edit.php pages
were merged.
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.
The only backpack implementing OBv1.0 was Mozilla Backpack. It closed
in 2019 and their badges were moved to https://backpack.openbadges.org/
by Badgr.
However, as Badgr is supporting OBv2.0 too, it makes no sense keep OBv1.0
implementation in Moodle: it has caused some issues and over-complicates
current code.
Where columns were previously of type `TYPE_INTEGER` or `TYPE_FLOAT`
but did not provide numeric data on output, we should change their
type to `TYPE_TEXT` (i.e. the default) to ensure that future work on
numeric aggregation doesn't affect them.
The newbadge.php and edit.php pages have been merged in edit.php
to make them easier to maintain because they were quite similar
(newbadge.php was only used for creating badges and edit.php for
editing badge details and messages).
* 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
All setUp(), tearDown(), setUpBeforeClass() and tearDownAfterClass()
must, always, call to parent, to ensure that everything is properly
set and cleaned.
While in a lot of situations this is not needed (parents may not
have anything to run), with PHPUnit >= 10 this can become more
important because we are going to move the reset code from current
placement @ runBare() to setUp()/tearDown().
Note that all the changes performed in this commit have been detected
and fixed by moodle-cs (ParentSetUpTearDownSniffTest).
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.
Now that system reports support aggregation natively, we can replace
a whole bunch of similar code containing hand-rolled versions with much
simpler/consistent use of API.
Where calling code was previously using either the 32-bit limit, or a
value equal to SQL_INT_MAX inside a database read/write, instead use
our new constant.
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.
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>