When I install this module the following errors are reported in the system report log and on the status report page.

Warning: strcmp() expects parameter 2 to be string, array given in _system_sort_requirements() (line 2771 of /home/netfluen/public_html/modules/system/system.module).
Warning: strcmp() expects parameter 2 to be string, array given in _system_sort_requirements() (line 2771 of /home/netfluen/public_html/modules/system/system.module).
Warning: strcmp() expects parameter 1 to be string, array given in _system_sort_requirements() (line 2771 of /home/netfluen/public_html/modules/system/system.module).
Warning: usort() [function.usort]: Array was modified by the user comparison function in system_status() (line 2309 of /home/netfluen/public_html/modules/system/system.admin.inc).

Despite the fact that Linkedin correctly passes the user login via the linked page, the user is transferred with the following errors on the user registration page:

Linkedin debug : 401 : No LinkedIn account is associated with this user
Linkedin debug : 401 : No LinkedIn account is associated with this user
No user associated with this LinkedIn account. Please register.

When I uninstall the linkedin module the system errors go away.

I have uninstalled and reinstalled this module and openid, fb and twitter modules but the dependence of these errors seems be entirely on the linkedin module. I do not have to activate the authentication, profile integration and status update modules to get the errors. But the errors still occur when I have fully installed and configured all components.

Comments

grahamshepherd’s picture

When I progressively disable user authentication blocks and functions on the configuration page the following error is also reported:

Warning: Invalid argument supplied for foreach() in _block_rehash() (line 389 of /home/netfluen/public_html/modules/block/block.module).

This error goes away when I disable and uninstall the authentication and profile integration modules.

However the system module error reports persist.

mgifford’s picture

kladrian’s picture

StatusFileSize
new1.28 KB

Hello,

I have a similar issue and I'm posting here because I think they might be related.

Visiting /admin/config after the installation of this module I get these warnings:

Warning: strcmp() expects parameter 2 to be string, array given in strcmp() (line 2784 of /modules/system/system.module).
Warning: strcmp() expects parameter 1 to be string, array given in strcmp() (line 2784 of /modules/system/system.module).
Warning: usort() Array was modified by the user comparison function in usort() (line 2314 of modules/system/system.admin.inc).

I tracked down the problem to the source and I found this:
the core module simpletest implements hook_requirements() adding as requirements the "curl"key (line 25 of modules/simpletest/simpletest.install )
and also linkedin module do the same in sites/all/modules/linkedin/linkedin.install.
Warnings are generated by usort function called in system_status function (line 2314 of modules/system/system.admin.inc) that gets as parameter the $requirements array.
$requirements array is generated by the above line
$requirements = module_invoke_all('requirements', 'runtime');
that contains an array_merge_recursive instruction that turn a string into an array as soon as it finds 2 equal keys.
Now, the usort function needs 2 strings to do it's job but it receives a string and an array instead.
One possible solution is to comment out the requirement of curl in linkedin.install.

If you run PHP 5.2.4 you don't get a warning as in php 5.3.x but a segmentation fault and a "Page not found" in admin/config

davad’s picture

Status: Active » Needs review

Thanks for the patch.

ce84465’s picture

Greetings. I"m a Drupal newbie and this is one of the issues that i'm having with this module. How do I install the patch?

thank you,
Ken

davad’s picture

http://drupal.org/patch/apply

If you're on Linux or OSX, it's a simple command from the command line. If you're on Windows, you might need an IDE like Eclipse installed. This patch is simple enough that you could apply it by hand if you wanted.

ce84465’s picture

Awesome! Thanks davad! Has there been any issue with the patch?

Ken

socialnicheguru’s picture

Make the change from 'curl' to 'curl_linkedin'

 $has_curl = function_exists('curl_init');
  $requirements['curl_linkedin'] = array(
    'title' => $t('cURL Linkedin'),
    'value' => $has_curl ? $t('Enabled') : $t('Not found'),
  );
  if (!$has_curl) {
    $requirements['curl_linkedin']['severity'] = REQUIREMENT_ERROR;
    $requirements['curl_linkedin']['description'] = $t('Linkedin module could ...

if multiple modules require the same component it reeks havoc with _system_sort_requirements

This is an example.
https://www.drupal.org/node/933684

Arun Murugadoss - Drupal Geeks’s picture

Make the $requirements['curl'] variable change from 'curl' to 'curl_linkedin' in the linkedin.install file solved the issue.

deanflory’s picture

Thanks SocialNicheGuru! #8 worked for me.

This 4 year old issue really needs some attention from the maintainer.

socialnicheguru’s picture

StatusFileSize
new1.07 KB

This is the patch to change curl to curl_linkedin

xurizaemon’s picture

+1, suggest we prefix rather than suffix the namespace since that feels "more drupal-y"

attached amended copy of prev patch, uses "linkedin_curl" instead of "curl_linkedin"

keep credit to @SocialNicheGuru plz