Skip to content

Commit f6c7e1c

Browse files
committed
MDL-84323 core_badges: Remove endorsement from JSON
The endorsement has been removed from the JSON because, according to the OBv2.0specification, it must not be included in either the badge or the assertion. Including it results in a format error, rendering the badge invalid.
1 parent 77692ee commit f6c7e1c

File tree

2 files changed

+0
-10
lines changed

2 files changed

+0
-10
lines changed

badges/badge_json.php

-6
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,6 @@
9595
$json['related'] = $relateds;
9696
}
9797

98-
$endorsement = $badge->get_endorsement();
99-
if (!empty($endorsement)) {
100-
$endorsementurl = new moodle_url('/badges/endorsement_json.php', array('id' => $badge->id));
101-
$json['endorsement'] = $endorsementurl->out(false);
102-
}
103-
10498
$alignments = $badge->get_alignments();
10599
if (!empty($alignments)) {
106100
foreach ($alignments as $item) {

badges/classes/assertion.php

-4
Original file line numberDiff line numberDiff line change
@@ -357,10 +357,6 @@ protected function embed_data_badge_version2(&$json, $type = OPEN_BADGES_V2_TYPE
357357
if (!empty($relatedbadges = $this->get_related_badges($badge))) {
358358
$json['related'] = $relatedbadges;
359359
}
360-
if ($endorsement = $this->get_endorsement()) {
361-
$endorsementurl = new moodle_url('/badges/endorsement_json.php', array('id' => $this->_data->id));
362-
$json['endorsement'] = $endorsementurl->out(false);
363-
}
364360
if ($alignments = $this->get_alignments()) {
365361
$json['alignments'] = $alignments;
366362
}

0 commit comments

Comments
 (0)