It looks like hook_node_export_after_import_alter() is not being called in certain situations. The code starting around line 570 of node_export.module loops through the nodes to be imported, and (based on whether the node exists or not) sets the $save variable. Then, it saves the node if $save == TRUE. Outside of the loop, it checks $save and, if it's TRUE, calls drupal_alter('node_export_after_import') and shows the "!count of !total nodes were imported..." message.

The problem is that it's depending on the *last* value of $save. So, if the last node it tried to import was skipped, $save will be FALSE and the hook won't get called.

It seems like the hook should get called if *any* nodes are saved. Is this correct? Or am I missing something?

I'll upload a patch that fixed this for me.

#1 2086217-1.patch492 bytesjrb


jrb’s picture

Status: Active » Needs review
492 bytes

Here's a simple patch that will make sure the hook is called if any nodes are saved.

  • danielb committed 10c06b2 on 7.x-3.x authored by jrb
    Issue #2086217 by jrb: hook_node_export_after_import_alter() not being...
danielb’s picture

Issue summary: View changes
Status: Needs review » Closed (fixed)