Commit graph

398 commits

Author SHA1 Message Date
Jun Pataleta
4b39124bf8 Merge branch 'MDL-72701-311' of https://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2021-12-23 12:10:53 +08:00
Andrew Nicols
f58768ee9e MDL-72701 unit tests: Fix broken @covers annotations 2021-12-21 09:24:06 +08:00
Eloy Lafuente (stronk7)
eac985d755 MDL-73348 phpunit: normalize all privacy provider tests
As far as now all them have correct privacy level2 namespace:
- Move them to "privacy" subdir.
- Rename the files to "provider_test.php", this includes old
  privacy_test.php and privacy_provider_test.php files
- Rename the testcase to provider_test too (to match file name)

Also, change some relative paths and comments to point to new
locations.
2021-12-17 14:21:09 +01:00
Eloy Lafuente (stronk7)
d6e00bc466 MDL-73348 phpunit: privacy and privacy_provider testcase names
All privacy_test and privacy_provider_test classes:

- Namespaced with component\privacy.
- Fixed incorrect use statements with leading backslash.
- Changed code to point to global scope when needed.
- Renamed a few files to make all be privacy_test or privacy_provider_test.php
- All them passing individually.
- Complete runs passing too.
2021-12-17 14:21:09 +01:00
Sara Arjona
9a21803f8f MDL-73153 badges: get image when it has more data
In some cases, image might have more fields rather than the URL.
This patch is for taking them into account and displaying the image
and also these information properly.
2021-11-24 10:28:07 +01:00
Sara Arjona
7ea7a17fb4 MDL-73128 badges: Fix warning with external badges 2021-11-22 16:32:03 +01:00
Andrew Nicols
d905332e97 Merge branch 'MDL-72990-311' of https://github.com/rezaies/moodle into MOODLE_311_STABLE 2021-11-05 11:58:29 +08:00
Jun Pataleta
70bb50e3b7 Merge branch 'MDL-72668-311' of git://github.com/rezaies/moodle into MOODLE_311_STABLE 2021-11-04 12:04:01 +08:00
Shamim Rezaie
c6f3ea3932 MDL-72990 badges: Use imagecaption as alternative text for badge image 2021-11-04 15:03:32 +11:00
Shamim Rezaie
d0d82e9f34 MDL-72668 block_badges: Add alt attribute to badge images 2021-11-04 14:17:36 +11:00
Paul Holden
1cdacd7771 MDL-72370 badges: require sesskey to remove related badge. 2021-11-02 18:04:15 +01:00
Paul Holden
40451d3a90 MDL-72857 badges: filter site/course name when showing issued badge. 2021-11-01 10:20:52 +00:00
Andrew Nicols
3dd5ef4cc0 MDL-72179 behat: Make use of page resolvers 2021-07-26 15:14:24 +08:00
Andrew Nicols
e214af5720 MDL-71113 js: Fix all jsdoc warnings 2021-06-18 09:38:05 +08:00
Sara Arjona
2864b51c7b MDL-67935 tool_lp: fix random errors with login/logout 2021-05-14 10:53:13 +02:00
Ruslan Kabalin
66e8f7a3d4 MDL-71051 core_user: fix issues and address review issues 2021-04-28 11:49:28 +02:00
Marina Glancy
10bf851874 MDL-71051 core_user: use user profile generator in all tests 2021-04-28 11:49:27 +02:00
Marina Glancy
3c9e54eafa MDL-71051 core_user: always use API when working with profile fields 2021-04-28 11:49:27 +02:00
Bas Brands
37f26f211f MDL-28452 core_user: migrate social profile fields
Create a new profile field type, move all existing content of the fields
'icq', 'skype', 'aim', 'yahoo', 'msn' and 'url' in the mdl_user table to
theses new profile fields if needed.

AMOS BEGIN
MOV [aimid,core],[aimid,courseimage,profilefield_social]
MOV [yahooid,core],[yahooid,profilefield_social]
MOV [skypeid,core],[skypeid,profilefield_social]
MOV [icqnumber,core],[icqnumber,profilefield_social]
MOV [msnid,core],[msnid,profilefield_social]
MOV [webpage,core],[webpage,profilefield_social]
AMOS END
2021-04-21 11:24:34 +02:00
Jake Dallimore
52f8e4001c Merge branch 'MDL-71119-311' of git://github.com/sarjona/moodle into MOODLE_311_STABLE 2021-04-15 08:32:04 +08:00
Sara Arjona
f58c70ebd5 MDL-71119 core_badges: Add more information to errors
Some errors raised when calling external services were ignored.
Displaying this information helps to debug and find the real reasons
why some action, like connecting to an external backpack, can't be
done.
2021-04-14 10:56:00 +02:00
Sara Arjona
1fdf3adf51 MDL-71119 core_badges: Use basicauth and remove urlencode
Basic authorization header is required to get token. Besides, client
id and secret shouldn't call urlencode.
2021-04-14 10:55:59 +02:00
Sara Arjona
7dd480dde2 MDL-71119 core_badges: Initialise scopes param in backpack-connect.php
The scopes parameter should be passed when creating the OAuth2 badges
client. As it is an optional parameter, when it's empty, it will
be initilised with the supported scopes for the backpack issuer.

It will happen, for instance, when a call is done to oauth2callback.php
because, as defined in RFC6749, OAuth2 authorization response only
supports code and state.
2021-04-14 10:55:59 +02:00
Sara Arjona
119fb4b712 MDL-71315 core_badges: Fix warning when rendering badges 2021-04-14 09:06:35 +02:00
Adrian Greeve
aaf93840d0 Merge branch 'MDL-70821-311-5' of git://github.com/junpataleta/moodle into MOODLE_311_STABLE 2021-04-12 14:44:58 +08:00
Jun Pataleta
0da0a3d344 MDL-70821 behat: Use new activity completion steps for Behat tests
Replace usages of completion Behat steps that check for the completion
checkboxes with the new activity completion Behat steps.
2021-04-12 12:29:23 +08:00
Eloy Lafuente (stronk7)
61004c89af Merge branch 'MDL-69102-311' of https://github.com/martygilbert/moodle into MOODLE_311_STABLE 2021-04-12 00:01:54 +02:00
Eloy Lafuente (stronk7)
ecc8fc3974
MDL-69102 phpunit: Add test to cover ALL cohort criteria
That way we can check that the expectations are
working ok for every database. Previously only the
ANY case was being tested.

Also, convert them to course badges and check, via
review_all_criteria() that the SQL structures returned
by award_criteria_cohort->get_completed_criteria_sql()
doesn't fail and return the expected counters.
2021-04-10 12:39:45 -04:00
Marty Gilbert
e4fabe4ae8
MDL-69102 badge: Fixes broken WHERE clause
When buildilng the 'WHERE' clause, the SQL generated
a query that selected any user who was a member of the
**last** group, not all of the groups.

I believe the query has to be re-worked so that it only
returns users who are in ALL of the groups. This can
be done by a GROUP BY and HAVING.
2021-04-10 12:26:16 -04:00
Víctor Déniz
33aaac019c Merge branch 'MDL-71116-311' of git://github.com/sarjona/moodle into MOODLE_311_STABLE 2021-04-08 01:05:06 +01:00
Eloy Lafuente (stronk7)
d24a83f5e7 Merge branch 'MDL-70963-311' of git://github.com/sarjona/moodle into MOODLE_311_STABLE 2021-03-29 12:39:49 +02:00
Sara Arjona
c2c04214bb MDL-70963 core_badges: Use expected JSON format for OBv2.1
This patch adds some changes to guarantee that OpenBadges 2.1 (OBv2.1)
will return always the same JSON format that OBv2.0 (because the only
difference between both versions it's the BadgeConnect API).
2021-03-29 10:03:15 +02:00
sam marshall
3dee5cd74c MDL-71099 Lib: Move new user_fields class from core to core_user
This class would belong more appropriately within the 'user' API
(core_user) instead of within the 'core' API, since it is
directly related to user data.

Since the class has only just been added to Moodle, now is a good
time to move it.
2021-03-25 13:48:04 +00:00
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
Sara Arjona
66efa30293 MDL-71116 core_badges: Backpack URLs with more than 50 chars
Backpack URLs (web and API) can have up to 255. However, the form
for creating/editing them, doesn't allow URLs with more than 50
characters. This patch align limitation to DB value (255).
2021-03-19 15:09:02 +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