Convert using template fails because of missing source and destination array data

izaiah - June 2, 2009 - 20:40
Project:Node Convert
Version:6.x-1.5
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:needs review
Description

Error is warning: Invalid argument supplied for foreach() in /sites/all/modules/node_convert/node_convert.module on line 625.

looking at node_convert_convert_nodes_using_template() and printing out $template shows that currently there is this:

$result = node_convert_node_convert($node->nid, $template['destination_type'], $template['fields']['source'], $template['fields']['destination'], $template['data']['no_fields'], $template['data']['hook_options']);

when it should be:
$result = node_convert_node_convert($node->nid, $template['destination_type'], $template['data']['fields']['source'], $template['data']['fields']['destination'], $template['data']['no_fields'], $template['data']['hook_options']);

#1

bitman - June 6, 2009 - 21:18

I experience the same error. When converting with a template, it is unable to convert between different fields, discards the data in those fields, and produces this warning.

I've created a patch from the fix izaiah describes above, which I have tested with a text field. It resolves the warning and the data is converted as intended.

AttachmentSize
convert_template_fix.patch 1.22 KB

#2

bitman - August 5, 2009 - 05:34
Status:active» needs review

#3

nohup - October 26, 2009 - 20:05

The attached patch fixes the problem with node convert action along with the original issue.

AttachmentSize
data_array_fix.patch 1.83 KB
 
 

Drupal is a registered trademark of Dries Buytaert.