When attempting to delete a case state on Drupal 5.0RC1 - I get the following error:

* warning: array_merge() [function.array-merge]: Argument #1 is not an array in /home/drupal-5.0-rc1/includes/menu.inc on line 415.
* warning: Missing argument 1 for drupal_get_form() in /home/drupal-5.0-rc1/includes/form.inc on line 49.
* warning: Missing argument 1 for drupal_retrieve_form() in /home/drupal-5.0-rc1/includes/form.inc on line 178.
* warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, '' was given in /home/drupal-5.0-rc1/includes/form.inc on line 217.

CommentFileSizeAuthor
#10 ct5-patch.txt2.02 KBcbutera

Comments

jo1ene’s picture

Title: Can't Delete a case state » Can't Delete or Edit a case state

I get this when trying to edit a case state. I did not attempt to delete one. I could add one just fine. PHP 5.0.3

morbus iff’s picture

Can you try this in RC2? I am unable to reproduce this.

cbutera’s picture

Same exact error on Drupal RC2 - here's my status report:
Drupal 5.0-RC2
Configuration file Protected
Cron maintenance tasks Last run 4 min 49 sec ago
You can run cron manually.
Database schema Up to date
File system Writable (public download method)
MySQL database 5.0.22
PHP 5.1.6
Unicode library PHP Mbstring Extension
Web server Apache/2.2.0 (Fedora)

morbus iff’s picture

Interesting. The one thing different is that I'm PHP 4, not 5. Thanks for the update.

morbus iff’s picture

Two questions:

* does admin/settings/casetracker cause any errors?
* willing to modify some code to test?

In the hook_menu of Case Tracker, I use various callbacks for the Case State forms, such like:

      'callback'           => 'drupal_get_form',
      'callback arguments' => 'casetracker_case_state_edit',

There's three mentions of this (and one more for admin/casetracker/settings). If you're willing to modifying the source, could you try changing the callback_arguments to look like this:

      'callback arguments' => array('WHATEVERITWASBEFORE'),

PHP 5 is really really really anal about doing array_* functions on something that isn't an array.

jo1ene’s picture

The array merge stuff is usualy PHP5.

I am using RC2.

The settings page is fine.

I found all instances of a non-array callback arguments and type cast them as arrays as you suggest. Ex:

    $items[] = array(
      'access'             => user_access('administer case tracker'),
      'callback'           => 'drupal_get_form',
      'callback arguments' => array('casetracker_case_state_edit'),
      'path'               => 'admin/content/casetracker/state/add',
      'title'              => t('Add case state'),
      'type'               => MENU_LOCAL_TASK,
    );

No dice. I still get the same exact error.

morbus iff’s picture

Could you, with your array() modifications in place, go to admin/build/menu first (to refresh the menu cache), THEN try to reproduce the bug? Forgot to mention it.

jo1ene’s picture

I had a hunch there may have been a cache issue, but going to the menu admin page didn't register as a solution.

This worked for me.

jacauc’s picture

Probably should've looked here before posting this: http://drupal.org/node/109071

cbutera’s picture

Status: Active » Needs review
StatusFileSize
new2.02 KB

Worked for me as well. Attached is a patch.

morbus iff’s picture

Status: Needs review » Fixed

Fixed in DRUPAL-5 and will show up in next release.

criz’s picture

thanks for that patch! works great...

Anonymous’s picture

Status: Fixed » Closed (fixed)
Jkello’s picture

Version: 5.x-1.0 » 5.x-1.2-beta2

I am using 5.x-1.2-beta2

when i edit or delete states, it also have the same errors.

Please assist.

Thanks!