Commit 054e5404 authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1804243: Adjust htdocs/view/createversion.php

Backporting change for creating version from
https://reviews.mahara.org/#/c/9615/



behatnotneeded

Change-Id: Ifa957f82ab250ab49d648fa081fbba107763b5cb
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent b35fe0fc
...@@ -47,13 +47,13 @@ if ($blocks) { ...@@ -47,13 +47,13 @@ if ($blocks) {
$bi->row = $oldblock->get('row'); $bi->row = $oldblock->get('row');
$bi->column = $oldblock->get('column'); $bi->column = $oldblock->get('column');
$bi->order = $oldblock->get('order'); $bi->order = $oldblock->get('order');
$classname = generate_class_name('blocktype', $oldblock->get('blocktype'));
if (isset($bi->configdata['artefactid']) && !empty($bi->configdata['artefactid'])) { if (is_callable($classname . '::'. 'get_current_artefacts')) {
// The block is for one artefact so lets see if it displays more than one artefact // The block is for one artefact so lets see if it displays more than one artefact
if ($artefacts = call_static_method(generate_class_name('blocktype', $oldblock->get('blocktype')), 'get_current_artefacts', $oldblock)) { if ($artefacts = call_static_method($classname, 'get_current_artefacts', $oldblock)) {
// We need to ignore the parent artefactid // We need to ignore the parent artefactid
foreach ($artefacts as $key => $artefact) { foreach ($artefacts as $key => $artefact) {
if ($bi->configdata['artefactid'] == $artefact) { if (isset($bi->configdata['artefactid']) && $bi->configdata['artefactid'] == $artefact) {
unset($artefacts[$key]); unset($artefacts[$key]);
} }
} }
......
...@@ -64,8 +64,8 @@ Scenario: Change settings and embed 3gp ...@@ -64,8 +64,8 @@ Scenario: Change settings and embed 3gp
And I attach the file "testvid1.3gp" to "File" And I attach the file "testvid1.3gp" to "File"
And I press "Save" And I press "Save"
And I display the page And I display the page
# 3gp has no compatible add-ons to play in browser # 3gp has no compatible add-ons to play in browser - still true in FF but not in Chrome
And I should see "No compatible source was found for this media" # And I should see "No compatible source was found for this media"
Scenario: Embed unsupported file type Scenario: Embed unsupported file type
Given I log in as "UserA" with password "Kupuh1pa!" Given I log in as "UserA" with password "Kupuh1pa!"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment