Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I tried to update to the latest version and the import of nodes isn't working anymore. I searched a bit and it seems that the problem is coming from the json modification introduced in this commit (Works well when I remove that modification) :
http://drupalcode.org/project/node_export.git/commitdiff/ec5ea03
Comment | File | Size | Author |
---|---|---|---|
#11 | 1624514-11-not-working.patch | 472 bytes | linclark |
Comments
Comment #1
milesw CreditAttribution: milesw commentedSame here. Nodes are reported as being created, but they aren't actually being saved. I can confirm that things work after reverting to the commit referenced by the OP.
Comment #2
danielb CreditAttribution: danielb commentedWhat exactly do you mean "import of nodes isn't working anymore", and can you tell me about what settings and format of export you're doing?
Comment #3
danielb CreditAttribution: danielb commentedIs it consistent with milesw's report that nodes are reported as created but are not?
Are you sure the node doesn't already exist on the site, because node export deals with that case differently now too.
Comment #4
danielb CreditAttribution: danielb commentedThat change you guys are refering to is rather innocuous, and simply serves to prevent the json format from claiming ownership of imports that it shouldn't. I can't see how that would make such a difference, especially if you're not using json. If you are using json, then if the new if statement doesn't evaluate it should report 'invalid format'.
Comment #5
jsacksick CreditAttribution: jsacksick commentedYes I'm sure, the node isn't created, you get the message that says Imported node !nid etc... but at the end none of the nodes are created. I suspect the json modification.
Comment #6
danielb CreditAttribution: danielb commentedI'm struggling to understand why this would have such an effect.
If the message reports it was imported, something went through. Isn't there a link to the new node in that message? Where does that link take you?
Comment #7
milesw CreditAttribution: milesw commented@danielb: In my case the nodes definitely don't already exist.
- The features component contains 1 node and shows "Overridden"
- I revert the Node Export component
- I see the following message:
- Node 181897 is the original NID from the source site. This new site only has 370 nodes.
- The link in that status message, which points to a path alias, produces a 404. It's not the alias exported with the node either, it appears to be generated by pathauto on the new site.
Maybe that gives you some clues. I'll try and dig in further when I get back to working on that end of things.
Comment #8
danielb CreditAttribution: danielb commentedIs this possibly related to
#1611848: Do a better job cleaning nodes when exporting via features. Helps avoid features thinking a node is constantly 'Overridden'.
Try editing 'changed' and 'created' to NULL in the export code ?
Comment #9
danielb CreditAttribution: danielb commentedalso
#1630478: Reverting a feature causes nodes to be duplicated
those are drupal 6 issues, but chances are this is a problem with both versions.
Comment #10
Anonymous (not verified) CreditAttribution: Anonymous commentedI am working with a completely fresh install.
I was just testing it out to see how the module works so I created 2 nodes, built the feature, drush si-ed, and tried installing it. The status message said both had been created and showed their titles, but there are no nodes in the database.
If I have a chance tomorrow, I'll try to debug more.
Comment #11
Anonymous (not verified) CreditAttribution: Anonymous commentedIn
node_export_import
, if a node has an nid, it will not have the$node->is_new
flag set, even if it is new to this site. Changing this if statement fixed the problem for me.The code in this patch checks whether any existing content was loaded for the nid. If no existing content was loaded, it sets the is_new flag to TRUE.
Comment #12
danielb CreditAttribution: danielb commentedI'd rather not change node_export_save() any further. The code calling node_export_save() should sort the node out. Identifying whether the node exists already should be based on uuid not nid.
Comment #13
danielb CreditAttribution: danielb commentedspecifically this code:
should have an 'else' or something to handle a new node situation
Comment #14
danielb CreditAttribution: danielb commentedI'd say when that code was added (recently) the original code that would work for your case was mistakenly removed
Comment #15
danielb CreditAttribution: danielb commentednope i'm wrong there was nothing there before
Comment #16
danielb CreditAttribution: danielb commentedoh I think I know what happened
in node_export_node_clone() the following line is commented out in the repository:
Comment #17
danielb CreditAttribution: danielb commentedok i've restored that, the next dev should behave properly
Comment #18
Anonymous (not verified) CreditAttribution: Anonymous commentedThanks, I pulled down the change and it now works for me.
Comment #19
danielb CreditAttribution: danielb commented