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.
This commit is contained in:
Sara Arjona
2020-06-03 19:38:09 +02:00
parent 111b293f61
commit cbe0bb91fd
2 changed files with 34 additions and 3 deletions
+5 -3
View File
@@ -100,9 +100,11 @@ if ($form->is_cancelled()) {
$badge->imageauthorurl = $data->imageauthorurl;
$badge->imagecaption = $data->imagecaption;
$badge->usermodified = $USER->id;
$badge->issuername = $data->issuername;
$badge->issuerurl = $data->issuerurl;
$badge->issuercontact = $data->issuercontact;
if (badges_open_badges_backpack_api() == OPEN_BADGES_V1) {
$badge->issuername = $data->issuername;
$badge->issuerurl = $data->issuerurl;
$badge->issuercontact = $data->issuercontact;
}
$badge->expiredate = ($data->expiry == 1) ? $data->expiredate : null;
$badge->expireperiod = ($data->expiry == 2) ? $data->expireperiod : null;
+29
View File
@@ -166,3 +166,32 @@ Feature: Add badges to the system
And I click on "Site badges" "link" in the "Navigation" "block"
Then I should see "Manage badges"
And I should see "Add a new badge"
@javascript @_file_upload
Scenario: Edit a badge
Given I navigate to "Badges > Badges settings" in site administration
And I set the field "Badge issuer name" to "Test Badge Site"
And I set the field "Badge issuer email address" to "testuser@example.com"
And I press "Save changes"
And I navigate to "Badges > Add a new badge" in site administration
And I set the following fields to these values:
| Name | Test badge with 'apostrophe' and other friends (<>&@#) |
| Version | firstversion |
| Language | English |
| Description | Test badge description |
| Image author | http://author.example.com |
| Image caption | Test caption image |
And I upload "badges/tests/behat/badge.png" file to "Image" filemanager
And I press "Create badge"
When I follow "Edit details"
And I should see "Test badge with 'apostrophe' and other friends (&@#)"
And I should not see "Issuer details"
And I set the following fields to these values:
| Name | Test badge renamed |
| Version | secondversion |
And I press "Save changes"
And I follow "Overview"
Then I should not see "Test badge with 'apostrophe' and other friends (&@#)"
And I should not see "firstversion"
And I should see "Test badge renamed"
And I should see "secondversion"