When enabling the module I get these 5 warnings:

* warning: array_merge() [function.array-merge]: Argument #2 is not an array in /.../sites/all/modules/activity/activity.module on line 121.
* warning: array_merge() [function.array-merge]: Argument #1 is not an array in /.../sites/all/modules/activity/activity.module on line 121.
* warning: array_merge() [function.array-merge]: Argument #2 is not an array in /.../sites/all/modules/activity/activity.module on line 121.
* warning: array_merge() [function.array-merge]: Argument #1 is not an array in /.../sites/all/modules/activity/activity.module on line 121.
* warning: array_merge() [function.array-merge]: Argument #2 is not an array in /.../sites/all/modules/activity/activity.module on line 121.

Comments

Scott Reynolds’s picture

Strange are you still having this with the most recent dev version? it appears some modules hook_activity_info isn't setup the right way.

walker2238’s picture

I having the exact same issue. except on line 125.

Scott Reynolds’s picture

Status: Active » Needs review

ok so applied a quick fix cause I can't replicate the problem, but the code in that spot was messy.
http://drupal.org/cvs?commit=207674

I think that will solve it. Please let me know and if it does fix mark this ticket as fixed.

Jotas’s picture

I'm afraid it doesn't fix it. Now I get the warning on line 125

Scott Reynolds’s picture

Ok then please give me a detailed information of your system. Modules installed and php version (you can retrieve that here: admin/reports/status)

and I need the listing of all the Available activity types from here: admin/settings/activity/create

Scott Reynolds’s picture

Status: Needs review » Active

marking as still active :-( sry this is giving you trouble

Jotas’s picture

Thanks Scott,

I give you the datails:

PHP version: 5.2.9

Modules:
Administration menu 6.x-1.3
Advanced help 6.x-1.2
AHAH Response 6.x-1.0
Author Pane 6.x-1.0
Birthdays 6.x-1.0
Calendar 6.x-2.1
Checkbox Validate 6.x-1.1
Content Construction Kit (CCK) 6.x-2.2
Content Profile 6.x-1.0-beta3
Date 6.x-2.1
Read More link 6.x-3.0
Facebook-style Statuses 6.x-2.0-beta2
FCKeditor - WYSIWYG HTML editor 6.x-1.3
FileField 6.x-3.0
Fivestar 6.x-1.15
Flexifield 6.x-1.0-alpha2
GMap Module 6.x-1.1-rc1
Google Analytics 6.x-2.2
Guestbook 6.x-1.1
ImageAPI 6.x-1.6
ImageCache 6.x-2.0-beta9
ImageCache Profiles 6.x-1.0
ImageField 6.x-3.0
Imagefield Crop 6.x-1.0-beta3
IMCE 6.x-1.2
Invite 6.x-2.0-alpha1
Legal 6.x-2.2-beta4
Location 6.x-3.1-rc1
me aliases 6.x-2.6
Mollom 6.x-1.7
Organic groups 6.x-1.3
Pathauto 6.x-1.1
Privatemsg 6.x-1.0-rc2
Poormanscron 6.x-1.0
Translation template extractor 6.x-2.2
Service links 6.x-1.0
StatCounter 6.x-1.0
Tagadelic 6.x-1.2
Token 6.x-1.11
User Relationships 6.x-1.0-beta10
User Stats 6.x-1.0-rc1
Views 6.x-2.5
Voting API 6.x-2.0-rc2

* warning: Invalid argument supplied for foreach() in /../sites/all/modules/activity/activity.admin.inc on line 223.
* warning: Invalid argument supplied for foreach() in /../sites/all/modules/activity/activity.admin.inc on line 223.
* warning: Invalid argument supplied for foreach() in /../sites/all/modules/activity/activity.admin.inc on line 223.

Available Activity Types
Please choose which type of activity you would like to record.
Comment
Node
User

walker2238’s picture

Well I traced down the issue. And it is indeed another module. Facebook status 6.x-2.0-beta2

sirkitree’s picture

So it is probably Author pane which is throwing this error, but that's just a guess. Author pane had integration with Activity1 (I think) and implements the hook_activity_info(). Activity2 uses the same hook but expects different results. Therefor we're either going to have to change the hook name, or have it announce an API version like Views2 does. I think the latter is more desirable.

For now, if you could search your code base for this hook and let me know what exactly what module implements it, that would help us come up with a solution.

Thanks!

walker2238’s picture

From Facebook status 6.x-2.0-beta2...

/**
 * Implementation of hook_activity_info().
 */
function facebook_status_activity_info() {
  $token_types['facebook_status'] = t('Facebook-style Statuses');
  //Note that we do not define the role of the user who updated the status. That's because it would usually make for very confused messages.
  return array(
    'ops' => array('update' => t('Submit Status Update')),
    'types' => $token_types,
    'roles' => array(
      'owner' => array(
        '#name' => t('Owner'),
        '#description' => t('The user who owns the status.'),
        '#default' => 'You have an [operation]d status.',
      ),
      'all' => array(
        '#name' => t('All'),
        '#description' => t('Everyone who can see status updates.'),
        '#default' => '[owner] has an [operation]d status.',
      ),
    ),
  );
}
Scott Reynolds’s picture

Title: warning: array_merge() [function.array-merge]: Argument #2 is not an array » Create a check for hook_activity_info() api version 2.0

Ya so the syntax from activity 1.x to 2.x for hook_activity_info() has changed. We need to write some code to handle the old synatax.

sirkitree’s picture

Status: Active » Needs review
StatusFileSize
new7.7 KB

Here's a patch that implements something a little more like what View2 does with it's hook_views_api()

This also take care of loading other files which is part of #446482: Inclusion of $module.activity.inc files

Please review before I commit this one as it's a major change and we need to remember to update documentation as well before it is committed

Scott Reynolds’s picture

Only thing I see is probably should us drupal_ucfirst

$options[$hook] = ucfirst(str_replace(

sirkitree’s picture

Status: Needs review » Fixed

fixed a few instances of ucfirst to drupal_ucfirst and ucwords to drupal_ucfirst

http://drupal.org/cvs?commit=210420

Status: Fixed » Closed (fixed)

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