Merge branch 'MDL-68667-master' of git://github.com/aanabit/moodle

This commit is contained in:
Sara Arjona
2020-05-27 12:26:46 +02:00
3 changed files with 19 additions and 2 deletions
+2 -1
View File
@@ -882,6 +882,7 @@ class behat_core_generator extends behat_generator_base {
$content = $contenttype->create_content($record);
if (!empty($data['filepath'])) {
$filename = basename($data['filepath']);
$fs = get_file_storage();
$filerecord = array(
'component' => 'contentbank',
@@ -889,7 +890,7 @@ class behat_core_generator extends behat_generator_base {
'contextid' => $context->id,
'userid' => $data['userid'],
'itemid' => $content->get_id(),
'filename' => $data['contentname'],
'filename' => $filename,
'filepath' => '/'
);
$fs->create_file_from_pathname($filerecord, $CFG->dirroot . $data['filepath']);
@@ -153,3 +153,19 @@ Feature: Select content bank files using the content bank files repository
And I click on "Link" "button"
When I click on "Browse repositories..." "button"
Then I should not see "Content bank" in the ".fp-repo-area" "css_element"
Scenario: Both content name and file name are shown when a content is selected
Given the following "contentbank content" exist:
| contextlevel | reference | contenttype | user | contentname | filepath |
| Course | mscC1 | contenttype_h5p | admin | My content | /h5p/tests/fixtures/ipsums.h5p |
And I log in as "admin"
And I am on "MiscellaneousCourse1" course homepage
And I follow "Folder"
And I click on "Edit" "button"
And I click on "Add..." "button"
And I should see "Content bank" in the ".fp-repo-area" "css_element"
When I select "Content bank" repository in file picker
Then I should see "My content"
And I click on "My content" "link"
And I should see "Select My content"
And the field "Save as" matches value "ipsums.h5p"
+1 -1
View File
@@ -1149,7 +1149,7 @@ M.core_filepicker.init = function(Y, options) {
}, false);
},
select_file: function(args) {
var argstitle = args.title;
var argstitle = args.shorttitle ? args.shorttitle : args.title;
// Limit the string length so it fits nicely on mobile devices
var titlelength = 30;
if (argstitle.length > titlelength) {