Hello,

I am running Drupal 6.16 on a WAMP server with Apache 2.2.11, MySQL 5.1.36 and php 5.3.0.

I used to have php 5.2.11 up until the Drupal 6.14 release, time at which I upgraded to php 5.3.0 which is the php version that comes with WAMP 2.0i (see www.wampserver.com and www.drupal.org/requirements)

Node Import does not work with php 5.3.0. I get the following warning message at step 7/8:

warning: Parameter 2 to drupal_retrieve_form() expected to be a reference, value given in C:\wamp\www\sites\mif\modules\node_import\node_import.inc on line 1842.

If I ignore it and proceed with the import in step 8/8, it says that all rows were imported but they actually were not. The content is not visible when looking at the content page (admin/contnet/node) nor is it visible when looking at the node table with phpMyAdmin

When I go back to php 5.2.11, it does actually import all the rows very well.

Is there something (e.g. a php extension that Node Import needs) that may not be set up properly?

Thanks a lot for your help! :)

Christian

CommentFileSizeAuthor
#14 node_import_php5.3_fix.patch746 bytestylor
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Robrecht Jacques’s picture

Status: Active » Needs work

Could you test replacing:

function node_import_drupal_execute($form_id, &$form_state) {
  $args = func_get_args();
  $form = call_user_func_array('drupal_retrieve_form', $args);
  $form['#post'] = $form_state['values'];
  $form_state['must_validate'] = TRUE;
  drupal_prepare_form($form_id, $form, $form_state);
  node_import_drupal_process_form($form_id, $form, $form_state);
}

with

function node_import_drupal_execute($form_id, &$form_state) {
  $args = func_get_args();

  // Make sure $form_state is passed around by reference.
  $args[1] = &$form_state;

  $form = call_user_func_array('drupal_retrieve_form', $args);
  $form['#post'] = $form_state['values'];
  $form_state['must_validate'] = TRUE;
  drupal_prepare_form($form_id, $form, $form_state);
  node_import_drupal_process_form($form_id, $form, $form_state);
}

in sites/all/modules/node_import/node_import.inc? It should be around line 1842.

Thanks.

(EDIT: forgot the "must_validate" line)

ch_masson’s picture

Robrecht,

Sorry for the late reply. Yes, that fixed the issue.

Thanks,

Christian

ch_masson’s picture

Status: Needs work » Closed (fixed)
ch_masson’s picture

Status: Closed (fixed) » Fixed
Robrecht Jacques’s picture

Status: Fixed » Reviewed & tested by the community

Needs to be committed.

j0rd’s picture

Needs to be committed. Subscribing. Had to find and apply this patch twice manually already.

j0rd’s picture

Issue tags: +php-5.3

tagging as 5.3 bug.

Coupon Code Swap’s picture

Thanks

http://drupal.org/node/763036#comment-2878702

works for me with PHP 5.3.3

asad.hasan’s picture

Status: Reviewed & tested by the community » Fixed

Works like a beauty!

imclean’s picture

Status: Fixed » Reviewed & tested by the community

#1 works for me. Still not committed so I wouldn't call it "fixed" just yet.

grouchyladybug’s picture

#1 works for me on PHP 5.3.1...glad to find this after a day of banging my head on the keyboard trying to figure out where my supposedly imported nodes were!

Sutharsan’s picture

Version: 6.x-1.0-rc4 » 6.x-1.x-dev
Priority: Normal » Critical

Works as advertised. Marking as critical since PHP 5.3 is used more and more.

fonant’s picture

One-line fix in #1 works for me with PHP 5.3. Should be safe to commit.

tylor’s picture

FileSize
746 bytes

Tested #1 as working properly, created a patch file so I can use this in a drush make file until it gets committed. Thanks for the fix!

PetarB’s picture

I ran into this issue. After following Robrecht's advice in #1 the patch worked. Thank you.

Renee S’s picture

Worked for me. Commit plz?? :)

itserich’s picture

I have a problem where the imports appear fine and confirm states it worked but no nodes are created, much like the original issue.

However, I am using PHP 5.2.14

Can anyone state whether that would be the cause of my failure?

I desperately need to import a bunch of nodes and actually importing them is the last step.

Thank you.

basvredeling’s picture

I checked the latest dev but it's still not committed. Please add this fix.

joe3zzz’s picture

worked for php 5.3.4 - thanks!

kclarkson’s picture

Has this fix been committed?

I am not a big fan of patches.

Thanks,
K

zahidansari’s picture

Tested with php 5.3.2 successfully . One issue though on step 7

Use Case: I have validity date in content type which I forgot to give in step 4 . When I reached to step 7 it showed me the whole code

Record 1:
* Validity Date field is required.
* Validity Date field is required.

after which it shows this code ::

values = Array
(
    [created] => 
    [node_import_build_mode] => 1
    [title] => Medical
    [format] => 2
    [body] => Consult your doctor as soon as you decide you want to conceive. Waiting till you are pregnant to meet her is not advisable.
    [cck:field_v_date:value] => 
    [type] => pregnancy_advice
    [cck:field_pregnancy_day:value] => Array
        (
            [0] => 1
        )

    [revision] => 
    [uid] => 1
    [log] => Imported with node_import.
    [sticky] => 0
    [status] => 1
    [promote] => 0
    [comment] => 0
    [path] => 
    [field_v_date] => Array
        (
        )

    [field_pregnancy_day] => Array
        (
            [0] => Array
                (
                    [value] => 1
                )

        )

    [name] => admin
    [taxonomy] => Array
        (
            [1] => 8
            [9] => 101
        )

    [op] => Preview
)
Robrecht Jacques’s picture

Status: Reviewed & tested by the community » Fixed

Committed.

Status: Fixed » Closed (fixed)
Issue tags: -php-5.3

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

YesCT’s picture

Issue summary: View changes
Issue tags: -php-5.3 +PHP 5.3