Hello,

I've tried to use this module, because I have to transfert over of 24000 users in a new drupal.
I've followed your CSV example here (http://drupal.org/node/1360374#import-csv) with exactly the same data.

I can't import anything because of this error :

Exception : Uncaught Feed Import Exception dans FeedImport::errorHandler() (ligne 209 dans /www/sites/all/modules/feed_import/feed_import.inc.php).

Do you know how to fix this ?

Thanks

Comments

Sorin Sarca’s picture

Hi,
there can be two reasons:
1) you missed something from that example
2) you have other modules that alter user before saving

In order to discover real error please follow next steps:
1) open feed_import.inc.php file and find line

throw new Exception('Uncaught Feed Import Exception', $errno);

(I think is line number 209)
2) before that line add the following line which will show us the real error:

drupal_set_message('<pre>' . print_r(self::$report['errors'], TRUE) . '</pre>');

3) save file and re-run import
A message which contains error info should appear; please post the error here.

marsbidon’s picture

Hi,

Thank for your answer ...
I've verified my import params : I've not missed anything.
I've not any module that could alter users before saving.

With your script line added before line 209, drupal shows me this :

Array
(
    [0] => Array
        (
            [error] => fgetcsv() expects at most 4 parameters, 5 given
            [error number] => 2
            [line] => 1306
            [file] => /www/sites/all/modules/feed_import/feed_import.inc.php
        )
)

I've a question in your example : when you say "mail and init", this means two separated fields? Or there is any way to define only one field for both ?

Have you any idea? thanks

Sorin Sarca’s picture

Yes, mail and init are two separate fields with the same xpath (init is the mail when user registered -- because he can change his mail address).

Back to error:
You need at least php 5.3.0 (then was added last parameter: escape). If you cannot upgrade to php 5.3.0 then consider removing the last parameter $escape from each fgetcsv() function call (there are only 2 calls).
Don't forget to remove or comment that line added for debugging.

If you need any help write back.

marsbidon’s picture

Status:Active» Fixed

Of course, you're right ! Thank you.
My serveur was in 5.2.17. I've updated to 5.3.9 and imports work perfectly.

I suggest you to specify PHP version needed on project page, It should be necessary in some cases (like mine !)

My problem is solved.

Thanks a lot.

Sorin Sarca’s picture

Status:Fixed» Closed (fixed)

I found this after checking php changelog, I didn't know about it before.

openmode’s picture

Version:7.x-2.5» 7.x-2.6
Status:Closed (fixed)» Active

Array
(
[0] => Array
(
[error] => set_time_limit() has been disabled for security reasons
[error number] => 8
[line] => 266
[file] => /sites/all/modules/feed_import/feed_import.inc.php
)

)

Messaggio di errore
Exception: Uncaught Feed Import Exception in FeedImport::errorHandler() (linea 212 di /sites/all/modules/feed_import/feed_import.inc.php).

Feed Import 7.x-2.6
PHP 5.3

Sorin Sarca’s picture

Hi,
open feed_import.inc.php file and search for set_time_limit(0);
Prepend a @ to set_time_limit(0); function, your line should look like this:

@set_time_limit(0);

Save the file and try again.

openmode’s picture

No result...

Array
(
[0] => Array
(
[error] => simplexml_load_file(http://www.domain.com/sites/default/files/public/feeds/dati.xml) [function.simplexml-load-file]: failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden

[error number] => 2
[line] => 1011
[file] => /domain/sites/all/modules/feed_import/feed_import.inc.php
)

)

Feed Dati from XML processed!

Sorin Sarca’s picture

As the message says, the error is not in feed import module.
That url is not pointing to an xml file (nor to other file).

openmode’s picture

I suggest to use Feeds with Feeds import+Feeds XLS+PHP Excel library. It's better.

Sorin Sarca’s picture

Status:Active» Closed (fixed)

Since you just reopened this bug for nothing, I will close it again. This issue was a bug report not a poll about which module is better.