On a PHP 5 system, enabling comments and visiting a comment adding screen causes an array_merge error for me. The patch included prevents this from happening on my system.

CommentFileSizeAuthor
#4 menu.inc_4.patch902 bytesax
menu.inc_3.patch801 bytesThox

Comments

m3avrck’s picture

Status: Needs review » Reviewed & tested by the community

Confirmed error on PHP5 here. Patch does indeed fix problem, which not only creates the warning, but prevents rest of page from showing since output occured before the headers were sent.

killes@www.drop.org’s picture

I think this error was caused by a callback argument in comment.module that was a string. this has been fixed a few days ago. So I think we won't need this patch. Can somebody confirm this?

killes@www.drop.org’s picture

Ok, I've been convinced that this is nto the same error. In fact, there is no callback arguement set and that is why it errors out. Please commit.

ax’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new902 bytes

an alternative patch that goes to the root of the problem (i think) and prevents that empty array wrongly to be set at the first place. there is no 'callback arguments' key in the 'comment/reply' menu item, so it shoudn't be set (to NULL) neither (to not fool later array_key_exists() checks).

please consider this instead.

ax’s picture

to be completely sure, there probably should be similar isset() checks around both of

$_menu['items'][$mid]['access'] = $item['access'];
$_menu['items'][$mid]['callback'] = $item['callback'];

as both keys aren't required in menu items (according to drupaldocs.org).

moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community

ax's brief patch looks good to me. a few days ago, i tried to track this down for a while but failed. nice work thox and ax.

m3avrck’s picture

Tested and confirmed, patch works on PHP5, great find ax!

killes@www.drop.org’s picture

Correct, ax' patch is the better one, eliminating the root cause.

Thox’s picture

Yep, +1 on ax's patch. I'm glad someone understands the menu system ;)

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to HEAD. Thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)