When trying to create a new issue the following error shows:

warning: array_merge() [function.array-merge]: Argument #2 is not an array in /data/wwwroot/hattrick.nethyperon.com/ho/modules/project/issue.inc on line 321.
warning: Invalid argument supplied for foreach() in /data/wwwroot/hattrick.nethyperon.com/ho/includes/form.inc on line 473.

The pulldown list of projects is empty.

I am using PHP5 so this might be the cause.

Comments

kong’s picture

I got the same error messages too. But I don't think it's because of PHP version.

If you take a look at the code, it looks like the errors are from project_projects_select_options().

It looks like the function tries to fetch the project name which has issues field = 1. But by default the issues field is set to 0 for newly created project. So the function cannot find any project with issues = 1 and it will return nothing to array-merge(), which expects to get an array as argument.

nethyperon’s picture

Method is correct, but it has to do with the taxonomy module being enabled. If it's not, the error is gone.

dan_aka_jack’s picture

I also can't select a project from the drop down list. I submitted a bug report here:

http://drupal.org/node/44572

Perhaps both this current bug report and my bug report are both symptoms of this bug? :

http://drupal.org/node/38120

Thanks,
Jack

dan_aka_jack’s picture

Method is correct, but it has to do with the taxonomy module being enabled. If it's not, the error is gone.

Hmm... that's interesting... but I (for one) absolutely require the taxonomy module. Disabling it is not an option.

markus_petrux’s picture

Status: Active » Needs review

In project.module find:

function project_projects_select_options($key_prefix = NULL) {

and after that add:

  $projects = array();

If for whatever reason no project is found in the DB, you at least can return an empty array, rather than null. The array_merge problem soved.

PS: Changed status, but no patch. The code suggestion is here. Want a patch? let me know. I just choose the quickest path for me atm. ;)

nedjo’s picture

Status: Needs review » Fixed

Thanks, fix committed.

Anonymous’s picture

Status: Fixed » Closed (fixed)