Skip to content

Commit db26213

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 c5d94d2 commit db26213

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
@@ -377,10 +377,6 @@ protected function embed_data_badge_version2(&$json, $type = OPEN_BADGES_V2_TYPE
377377
if (!empty($relatedbadges = $this->get_related_badges($badge))) {
378378
$json['related'] = $relatedbadges;
379379
}
380-
if ($endorsement = $this->get_endorsement()) {
381-
$endorsementurl = new moodle_url('/badges/endorsement_json.php', array('id' => $this->_data->id));
382-
$json['endorsement'] = $endorsementurl->out(false);
383-
}
384380
if ($alignments = $this->get_alignments()) {
385381
$json['alignments'] = $alignments;
386382
}

0 commit comments

Comments
 (0)