Enabling this module gives me an error on the Administration > Configuration page:

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

Disabling the module makes it go away. FYI, I'm running Drupal with MAMP on Mac OS 10.7, PHP 5.3.

Comments

arne.skaanes@acm.org’s picture

I get this message several places after module update and/or manually running cron.
Error disappears after I clear cache.

ZenDoodles’s picture

Assigned: Unassigned » ZenDoodles
Status: Active » Needs work

Hm... it seems this is related to hook_requirements. It *should* go away after the initial warning and a cache clear, but let's make sure the new hook_requirements() implementation is not broken.

arne.skaanes@acm.org’s picture

The same error message reappeared after some days, but this time it did not disappear after a cache reset.
My customer is getting worried!

ZenDoodles’s picture

I have a site reporting this error on the status report page as well. It is harmless, but I understand how clients can be. As a temporary fix, you can comment the function twitter_block_requirements() in twitter_block.install to make these errors go away.

Otherwise, we'll have a fix for you soon.

Note: hook_requirements *looks* correct to me. I'm going to have to look at the api docs again to see what I'm missing.

mauhg’s picture

Issue tags: +drupalcr, +#drupalcr
StatusFileSize
new1.08 KB

For some reason, i think some other module implements a requirements with the same name, cURL.
So i change that name and the warnings message disappear, i made a patch and tested in my localhost.
The simpletest module has the same hook_requirements, and have the same $requirements['curl'].

arne.skaanes@acm.org’s picture

I upgraded to Drupal 7.14 and now the messages has disappeared :-)

devin carlson’s picture

Assigned: ZenDoodles » Unassigned
devin carlson’s picture

Status: Needs work » Reviewed & tested by the community
StatusFileSize
new1.08 KB

The patch in #5 solves the issue.

I've attached an updated patch that simply uses the module's name at the beginning of the array key instead of at the end.

alan d.’s picture

@ZenDoodles Why there is an error here.
SimpleTest defines the hook_requirement 'curl' and Drupal can not handle duplicate array keys returned by module_invoke_all(). Simple as that. There is nothing wrong, it is just a clash with another module :)

alan d.’s picture

While bad form to mark our own patches as "reviewed & tested by the community", I would have done that myself!

ZenDoodles’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: -drupalcr, -#drupalcr

Thank you for the patch. Committed to dev. Will be pushing and tagging along with a couple of other issues soon.

Status: Fixed » Closed (fixed)

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