I can't assign the 'import nodes' permission to the desired roles (Administer >> User management >> Access control): the "node_import" row is blank (no checkboxes for roles).
Nodes import create node with Author = Anonymous, publish settings ignored, CCK fields blanks...
I'm logged as admin.
I have reinstalled last version (5x.1.8) but not success...

Thanx,

diego

Comments

Robrecht Jacques’s picture

Status: Active » Postponed (maintainer needs more info)

Can you attach a sample CSV file you are trying to import (a couple of rows)?

What is your Drupal version?
What is your PHP version?

I do not understand the Access control problem. It seems hook_perm() is not being called ?? Have you tried to completely uninstall the node_import module (go to Administer >> Site building >> Modules, unselect node_import and Save configuration, then go to the Uninstall tab on the same page and uninstall node_import, then reinstall it)? Or alternatively, if you have devel module installed, have you tried to clear the cache?

Thanks.

diego.paroni’s picture

StatusFileSize
new94.75 KB
new20 KB

Drupal version: 5.10
Php version: 4.4.7

Uninstalled completely node_import module (also Uninstall tab);
cleared cache with Devel...

I attach "node_import_access_control.jpg" screen of my Access Control Page without checkboxes for Node Import module;
I attach "node_import_test.zip": a sample CSV and the screens of my import try.
I created new type "test_type" with a CCK field "field_test_nomecompleto" (TEXTFIELD)(not reference...), and imported data from CSV ("title", "body" and "nome_completo") mapping in title, body and field.
After import success, the nodes created are with field empty and published, author, ecc empty (I set "published" and "sticky" as default options during import, if not specified by CSV...).

How I can test if hook_perm() is called?

Thanx!

diego

Robrecht Jacques’s picture

Status: Postponed (maintainer needs more info) » Active

I'll look into the import problem tomorrow (or this evening if I can find the time). Thanks for the images... they help a lot.

The perm problem puzzles me as I have never seen that before. Looking at the code in modules/user/user.module (function user_admin_perm($rid = NULL) and function theme_user_admin_perm($form)) where the permission page is constructed I see no real reason why exactly the node_import permission would disappear. Strange... Any help in debugging (probably in the functions above) would be appreciated.

UPDATE: you could easily test if node_import_perm() is called by changing (in node_import.module):

/**
 * Implementation of hook_perm().
 */
function node_import_perm() {
  return array('import nodes');
}

into

/**
 * Implementation of hook_perm().
 */
function node_import_perm() {
  drupal_set_message("DEBUG: node_import permissions is called");
  return array('import nodes');
}

and then going to admin/user/access. If you see a message things should work ?!

diego.paroni’s picture

node_import permissions is called: I can see the message on admin/user/access page.

On new drupal basic installation (same server), the Node Import module not have problems, showing the checkboxes for roles in control access page.

Now I try duplicate my installation and remove step by step other modules: I think it's an incompatible module the problem source...
If success, I will post the information.

Many many thanx.

diego

diego.paroni’s picture

First result:

now checkboxes are visible in Access Control Page,
after uninstalled the module "Node Export".

But the import data fails on test (CCK text field empty, published/author/sticky... empty)... also reinstalling Node Import.

Robrecht Jacques’s picture

Yes! Node export is the problem. That module also defines a permission called "import nodes", the same Node import uses. Probably because node_export comes before node_import alphabetically, the permission shows under Node export and disappears under Node import.

You can just check the permission under Node export and the checked roles will be able to use Node import too.

I can't really fix this permission problem. As far as I'm concerned it is a bug in Node export as that module was created later then Node import. It should not have used the same permission.

As far as the failing import... first thing tomorrow.

diego.paroni’s picture

Thanx!

I can confirm that also on the plain installation the import fails on CCK text field and date/author/published/etc info are reset to Thu, 01/01/1970 - 00:00 — Anonymous, not published.

Windows XP,
Drupal version: 5.10
Php version: 4.4.7
MySql 5.045
Node import 5x.1.8

Robrecht Jacques’s picture

Title: In Access Control page checkboxes missing for node_import module » CCK text field & publishing options fail to import
Component: Miscellaneous » Code

With a clean install of Drupal 5.12, Node import 5.x-1.8 and CCK Text 5.x-1.9 I can not reproduce this bug using exactly the same steps in configuring the content type and following the same steps as in the images (as admin).

PHP 5.2.4, MySQL 5.0.51a on Ubuntu Linux - not sure if that could be a problem. I'll try to install an exact equal version... What is your CCK Text version?

diego.paroni’s picture

cck-5.x-1.7

diego.paroni’s picture

Status: Active » Fixed

Definitely solved upgrading PHP:
from PHP 4.4.7 to PHP 5.2.6.

Now all is ok;
this is my configuration:

- Windows XP
- Php version: 5.2.6
- MySql 5.045
- Apache 2.2.4
- Drupal version: 5.10
- cck-5.x-1.7
- Node import 5x.1.8

Thanx for your support
and many congratulations for the Node Import module:
fundamental.

Diego

Robrecht Jacques’s picture

OK, this seems to be a PHP 4.x problem, maybe only on Windows (pass by value instead of pass by reference). A fix will be included in 5.x-1.9, released later today.

Thanks for the versions information.

Status: Fixed » Closed (fixed)

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