Commit c7ce2f90 authored by Cecilia Vela Gurovic's avatar Cecilia Vela Gurovic
Browse files

Bug 1632913: Exporting comments in Leap2A

Fixed code to allow the export of comments
when exporting a page with Leap2A.

behatnotneeded

Change-Id: I12dd77dfbaf0e45ab765fd9140c8a7f23f5c08e0
parent 10dc92d0
......@@ -279,16 +279,14 @@ class LeapImportComment extends LeapImportArtefactPlugin {
* appropriate in setup_relationships. To do that we would have
* 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'))) {
foreach ($entry_requests as $entry_request) {
$commentids = unserialize($entry_request->artefactmapping);
$commentids = $importer->artefactids[$entry_request->entryid];
$comment = new ArtefactTypeComment($commentids[0]);
if ($comment->get('onartefact')) {
continue;
}
$entry = $importer->get_entry_by_id($entry_request->entryid);
$referentid = self::get_referent_entryid($entry, $importer);
if ($viewid = $importer->get_viewid_imported_by_entryid($referentid)) {
......
......@@ -287,7 +287,7 @@ class PluginImportLeap extends PluginImport {
*/
public function call_import_method_plugins($method) {
$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) {
if (!in_array($plugin, $installedplugins)) {
continue;
......
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