As a site administrator, I use the node import module and it works fine. However, when I grant another user the following access roles: create/edit own/edit a specific node type, the default publishing options are not taken into account while uploading. The imported nodes are set as not published (while the default publishing options of the node type are set to 'published'). Since I do not want to grant 'Administer Nodes' access rights to that user, the user cannot publish these nodes.
This bug has previously been reported (and fixed) concerning a previous version of the node import module (http://drupal.org/node/84835).
Thanks in advance for your help!

Comments

Andy Galaxy’s picture

I also need this issue solved. Did you manage to sort this out?

Marcus Aurelius’s picture

I did not find a proper way to link the publishing settings of the imported nodes to the default publishing settings of the node type. However, I did find a way to hardcode all imported nodes as published, which is a great workaround for me. Is this of any interest to you?

Andy Galaxy’s picture

Yes please. Fill me in on your little secret.

Marcus Aurelius’s picture

In "node_import/supported/node.inc", add this code on line 182 (Node Import module v1.6 for Drupal 5):
$node->status = 1;
I'll show you the context of this line in case you are not working on the same version of Node Import module:

else {
      // If not, use the global option.
      $node->$key = (isset($options[$key]) ? $options[$key] : 0);
    }
    // Hack comes here:
    $node->status = 1;
  }

  // 5. Title.
  if ($type_info->has_title && (!isset($node->title) || empty($node->title))) {
    $errors[] = t('You need to provide a non-empty title.');
  }

Please let me know if this works properly.

Andy Galaxy’s picture

Thanks Marcus. I'll try it but with the 200 nodes already imported I'll have to manually publish at admin/content/node (it's easy enough to select all the ones I want and use the "update options" function to publish them).

But, whenever I edit a node, they revert back to "Not Published". It seems that this has been documented for "user without the 'administer nodes' permission" but I have this permission but nodes revert. I'll be trawling through http://drupal.org/node/38451 I suppose.

Robrecht Jacques’s picture

Status: Active » Closed (duplicate)

This has been fixed by fixing #84835 : Node Import doesn't respect published/unpublished that will be included in the next release of node_import (5.x-1.8) released later this weekend. Setting as duplicate.