Commit 466e66ca authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Merge "Bug 1632913: Exporting comments in Leap2A"

parents daa6c439 c7ce2f90
...@@ -279,16 +279,14 @@ class LeapImportComment extends LeapImportArtefactPlugin { ...@@ -279,16 +279,14 @@ class LeapImportComment extends LeapImportArtefactPlugin {
* appropriate in setup_relationships. To do that we would have * appropriate in setup_relationships. To do that we would have
* to change that call to happen after views are created. * to change that call to happen after views are created.
*/ */
public static function setup_view_relationships_from_request(PluginImportLeap $importer) { public static function setup_view_relationships_from_requests(PluginImportLeap $importer) {
if ($entry_requests = get_records_select_array('import_entry_requests', 'importid = ? AND entrytype = ?', array($importer->get('importertransport')->get('importid'), 'comment'))) { if ($entry_requests = get_records_select_array('import_entry_requests', 'importid = ? AND entrytype = ?', array($importer->get('importertransport')->get('importid'), 'comment'))) {
foreach ($entry_requests as $entry_request) { foreach ($entry_requests as $entry_request) {
$commentids = unserialize($entry_request->artefactmapping); $commentids = $importer->artefactids[$entry_request->entryid];
$comment = new ArtefactTypeComment($commentids[0]); $comment = new ArtefactTypeComment($commentids[0]);
if ($comment->get('onartefact')) { if ($comment->get('onartefact')) {
continue; continue;
} }
$entry = $importer->get_entry_by_id($entry_request->entryid); $entry = $importer->get_entry_by_id($entry_request->entryid);
$referentid = self::get_referent_entryid($entry, $importer); $referentid = self::get_referent_entryid($entry, $importer);
if ($viewid = $importer->get_viewid_imported_by_entryid($referentid)) { if ($viewid = $importer->get_viewid_imported_by_entryid($referentid)) {
......
...@@ -287,7 +287,7 @@ class PluginImportLeap extends PluginImport { ...@@ -287,7 +287,7 @@ class PluginImportLeap extends PluginImport {
*/ */
public function call_import_method_plugins($method) { public function call_import_method_plugins($method) {
$installedplugins = array_map(create_function('$a', 'return $a->name;'), plugins_installed('artefact')); $installedplugins = array_map(create_function('$a', 'return $a->name;'), plugins_installed('artefact'));
$orderedimportplugins = array('internal', 'file', 'blog', 'resume', 'plans', 'annotation'); $orderedimportplugins = array('internal', 'file', 'blog', 'resume', 'plans', 'annotation', 'comment');
foreach ($orderedimportplugins as $plugin) { foreach ($orderedimportplugins as $plugin) {
if (!in_array($plugin, $installedplugins)) { if (!in_array($plugin, $installedplugins)) {
continue; continue;
......
Supports Markdown
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