Every node that I import gets set as unpublished regardless of whether I set the content type to default to published and/or specify that imported nodes should be imported as published during the import process.

Has anyone else has this issue?

CommentFileSizeAuthor
#9 node.inc_2.patch349 bytesv1nce
#8 node.inc_.patch373 bytesv1nce

Comments

Robrecht Jacques’s picture

Could you check again? The logic in supported/node.inc was not as good as I thought.

If it works, please set this issue as "fixed".
If it doesn't work, please attach a small CSV file you used where the issue is clear and mention some configuration options (what are the default workflow options for this content type and what do you choose on the global options page).

Thanks!

Robrecht Jacques’s picture

You should use the 1.41 revision of node_import.module (second line in the file).

jmiccolis’s picture

I updated to cvs head - which is version node_import.module 1.45 and this is still an issue.

Robrecht Jacques’s picture

OK. So:

If it doesn't work, please attach a small CSV file you used where the issue is clear and mention some configuration options (what are the default workflow options for this content type and what do you choose on the global options page).

Thanks.

Robrecht Jacques’s picture

Status: Active » Fixed

Fixed in HEAD.

Anonymous’s picture

Status: Fixed » Closed (fixed)
Andy Galaxy’s picture

I don't think this is fixed. I have the same problem. Using:

// $Id: node_import.module,v 1.50.2.3.2.19 2008/05/03 08:44:28 robrechtj Exp $

v1nce’s picture

Version: master » 5.x-1.6
Priority: Normal » Critical
Status: Closed (fixed) » Needs review
StatusFileSize
new373 bytes

I can confirm this bug is still in 5.x-1.6.

The attached patch fixes this issue.

v1nce’s picture

StatusFileSize
new349 bytes

Patch in #8 above didn't quite work.

Attached patch will use the global node values correctly.

Robrecht Jacques’s picture

Status: Needs review » Fixed

The problem is that I usually test with the "administrator" account which has the "administer nodes" permission and so in the wizard the workflow options appear. However, if you do the import with a user that doesn't have the "administer nodes" permission, these options do not appear on the wizard options screen. In this case I get the options with:

$options = variable_get('node_options_'. $node->type, array('status', 'promote'));

The problem now is that the $options passed from the wizard options screen (if administrator) is in a different format. Eg (if administrator):

Array (
 'status' => 1,
 'promote' => 1,
);

compared to (if non-administrator)

Array (
  0 => 'status',
  1 => 'promote',
);

Of course then the code

$node->$key = (isset($options[$key]) ? $options[$key] : 0);

only works for the first version. Something neither of the patches fixes.

Anyway, thanks for pointing it out. It should now be fixed in the next release of node_import (5.x-1.8), released this weekend by always converting it to the first form.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.