sf_node_import doesn't create new nodes

trizzo - August 28, 2009 - 02:31
Project:Salesforce
Version:6.x-2.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review
Description

From comments a new node is supposed to be created when NULL is sent in to the function (" * The nid of the node to update. If left NULL, a new node will be created.")

this does not work since the node_save is in the if structure which won't be met when the nid is null.

We believe we have a solution, but it will be a few more weeks before it will be through our testing.

If anyone needs a copy of our work in process, please let me know.

#1

Bevan - August 29, 2009 - 16:40
Status:active» needs work

Please submit your patch so that others may review and/or collaborate. Thanks!

#2

aaronbauman - October 2, 2009 - 14:06
Status:needs work» needs review

I'm using the attached.

trizzo, is this something along the same lines as your solution?

AttachmentSize
561818-sf_node-import.patch 2.65 KB

#3

vfilby - October 13, 2009 - 17:30

I just came across the same problem and I applied (manually) aaronbauman's patch, it seems to have resolved the issue with new nodes not being created.

#4

vfilby - October 28, 2009 - 17:23

I was running into patch conflicts so I started fresh from salesforce-dev and started reapplying the patches. When I applied this patch via the patch command it caused problems. The problem was that:

<?php
   
elseif (isset($data->$value)) {
     
// Otherwise set the field on the export object to the value of the source
      // field if it's present on the source object.
     
$node->$key = $data->$value;
    }
?>

was changed to:

<?php
   
elseif (isset($data->fields->$value)) {
     
// Otherwise set the field on the export object to the value of the source
      // field if it's present on the source object.
     
$node->$key = $data->fields->$value;
    }
?>

by the patch. I am not sure how the changes to $data affect the $nid if block. This is a relatively small, but annoying bug. We should get this tested and into the core.

This patch is the same as Arron's from #2, but I have removed the changes to $data->fields

AttachmentSize
sf_node-import-bug.561818.4.patch 2.45 KB

#5

aaronbauman - October 28, 2009 - 18:37

Thanks vfilby,
I've been hacking this module for various clients who use the Partner API Client, which for some reason defines its data structures just differently enough to be really really annoying.

At first glance, this patch works for me on a fresh install.
Let's get another review and get this in.

#6

dago.aceves - November 13, 2009 - 17:05

I ran into this problem as well and I'm working on rewriting the sf_import module right now to handle both users and nodes on import. I'm curious if the salesforce project is considering adding sf_import and if there is interest in me putting up the module once its done.

My changes to sf_node_import are similar to the patch on this post, so i just applied your patch to a fresh sf_node install.

The project I'm working on right now is going to be working very tightly with salesforce operations. I'm curious what the plans are with this project.

#7

kostajh - November 13, 2009 - 18:56

dago.aceves, I'm also working on a project to tightly integrate salesforce operations with a Drupal site. Myself and another developer will probably do some work on this module and contribute back whatever we develop.

#8

Bevan - November 16, 2009 - 04:49

kostajh and dago; Currently development has kind of stalled since neither JoshK nor I are actively developing websites that use this module (Aaron has been more active recently, but I'm not sure what his current status is). I can't speak for Josh, but I think he would agree that we're happy to add maintainers if they can show the quality of their contributions through patches here in the issues queue, have CVS accounts, and ask nicely. ;)

What Salesforce module really needs is someone to invest a developer in it for a few months to work through the issue queue, get a stable release out, support it, and start committing some of the many awesome features in the queue and creating new d.o projects for integration modules.

 
 

Drupal is a registered trademark of Dries Buytaert.