Commit 665a8161 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Don't try to import a view into 2 different collections (bug #618428)


Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent 417e16a9
......@@ -449,16 +449,23 @@ class PluginImportLeap extends PluginImport {
}
// Put views into collections
// Keep track of which views have been placed in a collection, because
// Mahara can't handle more one collection per view.
$incollection = array();
foreach ($this->collectionviewentries as $cid => $entryids) {
$i = 0;
foreach ($entryids as $entryid) {
if ($viewid = self::get_viewid_imported_by_entryid($entryid)) {
$viewid = self::get_viewid_imported_by_entryid($entryid);
if ($viewid && !isset($incollection[$viewid])) {
$record = (object) array(
'collection' => $cid,
'view' => $viewid,
'displayorder' => $i,
);
insert_record('collection_view', $record);
$incollection[$viewid] = $cid;
$i++;
}
}
......
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