Commit graph

364 commits

Author SHA1 Message Date
Sara Arjona
1517765cca MDL-69792 core_badges: deprecated backpack.js and BADGE_BACKPACKURL
Final deprecation for constant BADGE_BACKPACKURL (it has been removed)
and badges/backpack.js file (it has been removed too).
Besides, some methods have started the deprecation process too:
 - badges_check_backpack_accessibility
 - badges_setup_backpack_js()
 - badges_local_backpack_js()

Apart from that, string 'addbackpack' has been deprecated here
because it's not used anywhere.
2021-03-19 15:14:09 +01:00
Jun Pataleta
9fe5ab67f1 Merge branch 'MDL-70911-311' of git://github.com/sarjona/moodle into MOODLE_311_STABLE 2021-03-11 17:41:25 +08:00
Sara Arjona
9b74408a33 MDL-70911 core_badges: Add navigation menu in classic
Manage backpacks page wasn't displaying the navigation and administration
menus when using classic theme (it's unrelated to changes done here).
This patch fixes this unexpected behaviour (raised thanks to behat tests).
2021-03-11 09:02:23 +01:00
Eloy Lafuente (stronk7)
bb4d5dbc25 Merge branch 'MDL-70726-3.11' of https://github.com/NashTechOpenUniversity/moodle into MOODLE_311_STABLE 2021-03-11 00:11:44 +01:00
Jun Pataleta
b535cf958a Merge branch 'MDL-45242-m311' of https://github.com/sammarshallou/moodle into MOODLE_311_STABLE 2021-03-10 23:38:42 +08:00
sam marshall
3cc4d3d2e2 MDL-45242 Course: Enrol feature supports custom profile fields 2021-03-10 10:58:09 +00:00
sam marshall
0919a04311 MDL-45242 Lib: Replace calls to deprecated functions
In all cases changes have been kept to a minimum while not making
the code completely horrible. For example, there are many instances
where it would probably be better to rewrite a query entirely, but
I have not done that (in order to reduce the risk of changes).
2021-03-10 10:58:09 +00:00
Jun Pataleta
5e7aeb7841 Merge branch 'MDL-70911-311' of git://github.com/sarjona/moodle into MOODLE_311_STABLE 2021-03-10 16:15:36 +08:00
Sara Arjona
52fd43f54d MDL-70911 core_badges: Remove $CFG->badges_site_backpack
The $CFG->badges_site_backpack setting has been completely removed
because it's not required anymore. From now, the primary site
backpack will be the first one in the "Manage backpacks" list (so,
the one with lower sortorder value).
2021-03-10 09:10:32 +01:00
Sara Arjona
3de96274ff MDL-70911 core_badges: Add support to backpacks sortorder
Before removing $CFG->badges_site_backpack setting, admins should be
able to re-order the existing site-backpacks (because then, the first
one will be treated as the default one).
This patch adds the sort order feature to the backpack list.
2021-03-10 08:31:22 +01:00
Sara Arjona
1a2db1297b MDL-70911 core_badges: Move "External backpack" to badges settings
Setting "External backpack connection" has been moved from "Backpack
settings" to "Badges settings" in order to make easier to find and
configure it.
Some extra tests have been added to cover existing behaviour and
confirm is still working as expected.
2021-03-10 08:31:22 +01:00
Eloy Lafuente (stronk7)
b7b508c5d2 Merge branch 'MDL-63961-311' of git://github.com/sarjona/moodle into MOODLE_311_STABLE 2021-03-10 00:19:58 +01:00
Amaia Anabitarte
291ff443a5 MDL-70726 behat: Fixing existing fail tests
Some of the current behat tests were wrong but not failing because of the bug in 'should not exist' step.
Once the bug is fixed, we must fix also wrong behats.
2021-03-05 14:06:43 +07:00
Eloy Lafuente (stronk7)
241cf14d71 Merge branch 'MDL-67974-311' of git://github.com/sarjona/moodle into MOODLE_311_STABLE 2021-03-01 22:33:26 +01:00
Sara Arjona
2e03630504 MDL-70913 core_badges: Use and update properly sortorder
Sortorder field in badge_external_backpack was updated with a wrong
value. This patch fixes this behaviour and adds sortorder as
sorting criteria for displaying the list of site backpacks.

In the phpunit method reviewed for covering this, a couple of
assertEquals() calls have been changed too to put the expected value
first.
2021-03-01 13:07:58 +01:00
Sara Arjona
0e63ad9f4c MDL-67974 core_badges: Badge expiry date when hover
Text displayed for expired badges when the user hovers over the
warning (!) icon has been fixed in the "Issued badge information"
page.
2021-02-23 15:32:41 +01:00
Sara Arjona
172dc36b46 MDL-63961 core_badges: Use high-resolution image
High-resolution image for a badge (f3) should be sent to external
backpacks through JSON and WS methods.
Besides, when a badge is cloned, the high-resolution image should be
used to avoid the copied looks blurry.
2021-02-22 12:52:04 +01:00
Sara Arjona
a71954fc77 MDL-70264 badges: remove badges/oauth2callback.php
File badges/oauth2callback.php has been removed and now badges
API will use admin/oauth2callback.php because it makes no sense having
it twice.

Credits go to Andrew Nicols for raising it!
2021-02-11 16:58:41 +01:00
Sara Arjona
29f7a9a210 MDL-70139 core_badges: fix invalid request when sending to backpack
Having mixed $data in badge exporters is causing some issues.
As all these exporters are using $data as an object, $data can be
converted to object in the constructor, to avoid errors and get
the expected behaviour always.
2020-11-06 16:36:52 +01:00
Andrew Nicols
919ead58fe Merge branch 'MDL-70066-310' of git://github.com/lameze/moodle into MOODLE_310_STABLE 2020-11-05 10:01:18 +08:00
Ferran Recio
75d6582fef MDL-70119 core_badges: fix tab names 2020-11-04 12:57:30 +01:00
Simey Lameze
7ca4fd97d9 MDL-70066 badges: change usages of array_key_exists to isset 2020-11-04 16:05:45 +08:00
Andrew Nicols
4dd870de20 Merge branch 'MDL-70059-310' of git://github.com/sarjona/moodle into MOODLE_310_STABLE 2020-11-03 12:05:19 +08:00
Sara Arjona
01c8c8828b MDL-70059 core_badges: avoid duplicate key error
When 2 or more backpack were created without credentials,
a "Duplicate key value violates unique constraint" error
was raised because externalbackpackid was not taking the
correct value.
Other improvements have been done to the code too in order
to make it more readable.
2020-11-02 10:48:06 +01:00
Peter Dias
32574e9cae MDL-70073 badges: Fix the backpack-add to match current master 2020-11-01 22:33:28 +08:00
Peter Dias
bcba1347f8 MDL-65959 badges: Allow cross domain/protocol functionality - obv2 2020-10-26 18:36:26 +08:00
Peter Dias
b0e1edd427 MDL-65959 badge: Enable OB2.1 *connection* with cross domain ability 2020-10-26 18:36:26 +08:00
Peter Dias
b0007a154c MDL-65959 badge: Reset external_identifiers if backpack details modified 2020-10-26 18:36:26 +08:00
Peter Dias
8c9d3695e3 MDL-65959 badge: Confirm assertion data is updated before awarding 2020-10-26 18:36:26 +08:00
Peter Dias
184944ce6a MDL-65959 badges: Unit and Behat tests 2020-10-26 18:36:26 +08:00
Peter Dias
ad9f9e54a3 MDL-65959 badges: Do not use badge user preference after verification 2020-10-26 18:36:26 +08:00
Peter Dias
943b261760 MDL-65959 badges: Update the implementation to use admin set backpack 2020-10-26 18:36:25 +08:00
Peter
8dbc7c6532 MDL-65959 core_badges: Allow ability to upload badges cross domain. 2020-10-26 18:35:36 +08:00
Peter
6f7fe5df9c MDL-65959 core_badges: Unrestricted user's badger account
* Restructure the email to be backpack specific
* Amended table defintion and functions
2020-10-26 18:35:35 +08:00
Eloy Lafuente (stronk7)
106c64ac24 MDL-67673 phpunit: Remove deprecated non-public attribute assertions
With PHPUnit 8 a good number of assertions, all them related with
operations on non-public attributes have been deprecated. And will
be removed with PHPUnit 9.

The main point is that unit tests shouldn't be testing non-public
APIs (good practice) and those assertions were an error originally.

See https://github.com/sebastianbergmann/phpunit/issues/3338 for
the complete list and other details.

When possible (the attributes being checked are public), the change
is simple, just switching to normal assertions.

When the attributes are not public we need to find a workaround
to be able to test the same using public APIs, or use Reflection,
or remove the tests.

For the records, this is the regexp used to find all the cases:

ag '>(assertAttribute|attribute\(|readAttributte|getStaticAttribute| \
    getObjectAttribute)' -G "test.php"
2020-10-21 12:46:05 +02:00
Eloy Lafuente (stronk7)
a6674bf8a4 MDL-67673 phpunit: Remove deprecated assertInternalType()
While this is not strictly required, because removal will
happen in PHPUnit 9.0, we are already getting rid of all
uses in core.

From release notes:https://phpunit.de/announcements/phpunit-8.html

assertInternalType() is deprecated and will be removed in
PHPUnit 9. Refactor your test to use assertIsArray(), assertIsBool(),
assertIsFloat(), assertIsInt(), assertIsNumeric(), assertIsObject(),
assertIsResource(), assertIsString(), assertIsScalar(),
assertIsCallable(), or assertIsIterable() instead.
2020-10-21 12:46:05 +02:00
Eloy Lafuente (stronk7)
d81a94807b MDL-67673 phpunit: Fix the return type of template methods
All the setup/teardown/pre/post/conditions template methods
now are required to return void. This was warned with phpunit 7
and now is enforced.

At the same time, fix a few wrong function names,
provider data and param types, return statements...
2020-10-21 12:46:04 +02:00
Juan Leyva
b294665c21 MDL-65976 completion: New course completion message provider 2020-09-29 13:41:49 +02:00
Paul Holden
7665c701fd MDL-63387 course: use renamed role names, update Behat tests.
Specify that we want both role names (renamed course role plus
original).
2020-09-01 12:05:26 +01:00
Sara Arjona
52836faa5b MDL-69055 core_badges: display password/oauth fields properly 2020-08-20 12:01:49 +08:00
Sara Arjona
aa3a9c7895 MDL-69054 core_badges: allow editing OBv1.0 backpacks 2020-08-20 07:31:48 +08:00
Sara Arjona
c4c770f48c MDL-61215 core_badges: use the new optimised_image filetype group
For the badge picture (instead of the web_image which includes
SVG files).
2020-08-20 07:16:41 +08:00
Bas Brands
49f1803c9d MDL-67735 theme_boost: remove bs2 and bs4alpha compatibility css 2020-08-19 08:29:50 +08:00
Sara Arjona
92219c8ffd MDL-69002 core_badges: move backpack validation to a separate page
Instead of running the site backpack validation every time badges/backpacks.php
page is loaded, an action button has been added to the backpacks with OB set
to 2.0 to let admins running manually this verification when needed.
2020-06-10 13:02:44 +02:00
Sara Arjona
3e567085a8 MDL-69002 core_badges: add methods to support backpack validation
A more generic method has been added to the API to validate the
backpack connection (for now, there was only one method for
validating current backpack).
Besides, a renderer has been added to display this information
depending on the backpackid.
2020-06-10 12:26:47 +02:00
Sara Arjona
cbe0bb91fd MDL-68905 core_badges: remove issuer details from edit page
In MDL-68746 issuer details fields were removed from the badges
form, because they are filled from the site settings.
This is a regression because these fields should be removed also
from the edit page.
2020-06-03 19:38:09 +02:00
Sara Arjona
dcbc830cfa MDL-68746 core_badges: fix behat error with issuername 2020-05-28 11:20:46 +02:00
Jake Dallimore
b08e4b5cd6 Merge branch 'MDL-68746-master' of git://github.com/sarjona/moodle 2020-05-28 11:56:23 +08:00
Sara Arjona
a80541ea90 MDL-68567 badges: add/remove site backpacks 2020-05-22 09:01:59 +02:00
Sara Arjona
630a19ebd5 MDL-68746 core_badges: remove Issuer details from badges form
When OBv2.0 support was added, the issuername and issuercontact
fields were changed to static.
In order to avoid confusion for the user, these fields shouldn't
be displayed for OBv2.0 or higher.
2020-05-20 08:51:52 +02:00