Commit ace60275 authored by Cecilia Vela Gurovic's avatar Cecilia Vela Gurovic Committed by Robert Lyon

Bug 1798209: ignore not portfolio pages when importing Leap2A

dashboard and profile views are ignored when
importing Leap2A file for an existing user account

behatnotneeded

Change-Id: I47868196714ada1adf45b6aa1d44ac1a473eff57
(cherry picked from commit 92d0b92e)
parent 69a964a5
......@@ -1162,7 +1162,7 @@ class PluginImportLeap extends PluginImport {
$view['id'] = $ierview->id;
$view['decision'] = $ierview->decision;
$view['disabled'][PluginImport::DECISION_IGNORE] = false;
$view['disabled'][PluginImport::DECISION_ADDNEW] = false;
$view['disabled'][PluginImport::DECISION_ADDNEW] = in_array($view['type'], array('dashboard', 'profile'));
$view['disabled'][PluginImport::DECISION_APPEND] = true;
$view['disabled'][PluginImport::DECISION_REPLACE] = true;
$entryviews[] = $view;
......
......@@ -242,7 +242,12 @@ abstract class PluginImport extends Plugin implements IPluginImport {
$title = $entrydata['content']['title'];
if ($plugin === 'core') {
// For view import
$decision = PluginImport::DECISION_ADDNEW;
if (isset($entrydata['content']['type']) && in_array($entrydata['content']['type'], array('dashboard', 'profile'))) {
$decision = PluginImport::DECISION_IGNORE;
}
else {
$decision = PluginImport::DECISION_ADDNEW;
}
}
else {
safe_require('artefact', $plugin);
......
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