When I go to Administer -> Settings -> Flexinode, I get two warnings:

warning: array_merge() [function.array-merge]: Argument #2 is not an array in c:\wamp\www\mvk\drupal\modules\flexinode\flexinode.module on line 783.

warning: implode() [function.implode]: Bad arguments. in c:\wamp\www\mvk\drupal\modules\flexinode\flexinode.module on line 110.

Also, nothing shows up on the Settings screen except the "Save configuration" and "Reset to defaults" buttons. I assume there should be something else there, but I'm a new flexinode user.

I'm running PHP 5.0.4 on WAMP5 1.4.4.

There's at least one other user who has seen this problem: http://drupal.org/node/19234 .

Comments

logank’s picture

As a one-day old newbie, I got these exact same errors while testing a drupal-based site on my local Apache installation. Once I uploaded the installation to my website, the errors disappeared. I don't know why this is, but just a observation.
By the way, to benefit other puzzled newbies, the information that doesn't display is simply a box regarding options for thumbnail sizes and Imagemagick conversion. In other words, nothing that would affect the functionality of text-based nodes.

udare’s picture

It seems the issue is that flexinode_invoke_all is still in the v4.5 format. Below is a revision to match the call from module_invoke_all in v4.6. This seems to work fine but needs more testing as I am also a Drupal newbie.

//// OLD

function flexinode_invoke_all($hook, $a1 = NULL, $a2 = NULL, $a3 = NULL) {
  $result = array();
  foreach (flexinode_field_types() as $type) {
    $function = 'flexinode_field_'. $type .'_'. $hook;
    if (function_exists($function)) {
      $result = array_merge($result, $function($a1, $a2, $a3));
    }
  }
  return $result;
}

//// NEW

function flexinode_invoke_all() {
  $args = func_get_args();
  $hook = array_shift($args);
  $return = array();
  foreach (flexinode_field_types() as $type) {
    $function = 'flexinode_field_'. $type .'_'. $hook;
    if (function_exists($function)) {
      $result = call_user_func_array($function, $args);
      if (is_array($result)) {
        $return = array_merge($return, $result);
      }
      else if (isset($result)) {
        $return[] = $result;
      }
    }
  }
  return $return;
}
joshua001’s picture

I'm also a Drupal newbie, but this problem was immediately solved when I chose NOT to run PHP as a CGI.

jenpasch’s picture

udare's code worked for me and I still have my php set to run as a cgi. Thanks!

rainynight65’s picture

udare's code works for me as well.

vkero’s picture

udare, thanks... ur fix worked here too

darius’s picture

I never had the implode warnings, but the empty Settings screen still remains a problem, even with the updated invoke_all() code. I'm running the latest CVS version.

dohertywa’s picture

StatusFileSize
new880 bytes

Running 4.6.3

Fixed this problem with the code from udare, thanks. ;)

Posting a patch if it helps any.

micha_1977’s picture

Title: array_merge and implode warnings, empty Settings screen » pls review the patch
Priority: Normal » Critical
Status: Active » Needs review
micha_1977’s picture

Title: pls review the patch » array_merge and implode warnings, empty Settings screen

..sorry i changed the title

aries’s picture

It works!

dkruglyak’s picture

Status: Needs review » Active

can somebody with cvs access commit the fix? apparently it is not in the HEAD

Bèr Kessels’s picture

Status: Active » Needs work

The last patch is diffed the wrong way arround. Please fix that.

dkruglyak’s picture

Status: Needs work » Reviewed & tested by the community

the patch is not supposed to work after so many changes.

whoever has commit privilege should just manually substitute udare's code and check-in.

Darken-1’s picture

udare's code worked for me!

thanx my friend,
Darken

kurkuma’s picture

udare's code worked for me as well (using drupal 4.6.3 and $Id: flexinode.module,v 1.46.2.3 2005/09/14 01:21:53 killes Exp $).

Thanks.

Marco Palmero’s picture

I had this error

warning: array_merge() [function.array-merge]: Argument #2 is not an array in C:\xxx\xampp\htdocs\xxx\modules\flexinode\flexinode.module on line 762.

warning: implode() [function.implode]: Bad arguments. in C:\xxx\xampp\htdocs\xxx\modules\flexinode\flexinode.module on l

and the code above from udare worked...

I wonder if there are ramifications when I upload this patched code to the server?

robertgarrigos’s picture

StatusFileSize
new898 bytes

This is the right diff patch.

elbarcino’s picture

Hello all....I'm having hte same errors but don't know how to apply the patch. Can anybody advise?

Thanks

mgifford’s picture

StatusFileSize
new1.53 KB

I think this is a simpler patch that addresses both php warnings that are popping up here.

Bèr Kessels’s picture

Status: Reviewed & tested by the community » Needs review

I prefer to have this tested first.

Can someone please review and test?

Bèr Kessels’s picture

Component: Code » flexinode.module (core)
Priority: Critical » Normal

I am bumping this down. Seems to be little interest in debugging a 4.6 version.

Again: all I need is a good review. :)

Bèr Kessels’s picture

bump: I don't actively maintain a 4.6 version of flexinode. But *will* commit this patch if someone tests it :)

urbanlegend’s picture

Issue summary: View changes
Status: Needs review » Closed (outdated)

Bump: Given that this issue has not been updated in 9 years or more, I am closing this ticket as outdated (no longer needed and/or relevant). However, if anyone feels this represents an issue that is still being encountered in the current version of Drupal, please reopen and/or provide additional comments.