Closed (fixed)
Project:
Drupal core
Version:
5.1
Component:
node system
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
30 Apr 2006 at 07:57 UTC
Updated:
7 Jul 2007 at 16:45 UTC
Jump to comment: Most recent file
system:FC5
PHP:5.1.2
error:"warning: array_merge_recursive() [function.array-merge-recursive]: Argument #2 is not an array in /var/www/html/web47/modules/node.module on line 1605"
error path:"?q=node/8888/edit"
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | node_66.patch | 813 bytes | chx |
Comments
Comment #1
huyl commentedfix node.module on line 1605 to:
"$form = array_merge_recursive($form, array(node_invoke($node, 'form')));"
Comment #2
killes@www.drop.org commentedwhich node type does the node 8888 have?
Comment #3
huyl commentedIt's a sample number.
Comment #4
huyl commentedThis node type is "aggregator2-item",create by aggregator2 modules at 4.6.X.
yes,"page" and "blog" type no this warning.
Comment #5
asimmonds commentedMost 4.6 modules will not work with 4.7. Try using the CVS version of the aggregator2 module, which looks like it has been updated somewhat for 4.7. This module has not been branched for 4.7 yet, so it could be a little unstable.
Comment #6
gerhard killesreiter commentedplease move this to aggregator2.module, it seems to be broken.
Comment #7
huyl commentedI agree,but it's better if can take node system more strong.
Comment #8
chx commentedI will relentless reject any proposals to make core more bloated to somewhat resist against broken modulen. Nah. Fix your code and leave core as it is.
Comment #9
adrinux commentedIt's probably worth mentioning I also just got this error. This resulted from trying to edit old blog posts that were created using the blog module whilst the blog module was disabled. Once I enabled the old blog module the error disappeared, and I was able to edit the posts.
So this is basically a configuration error, not a bug as such, and should be easily corrected - as long as the module used to create the content is updated to the current Drupal version!
I'll be moving the problem content into 'story' nodes before disabling blog module again.
Comment #10
nsyll commentedthe same problem when i try to make my oun node
at the end of hook_form i used
$output = drupal_get_form('myclient', $form);
return $output;
Comment #11
z.stolar commentedI just got this error with Drupal 5, and I see the code has not changed in Drupal 5.1 .
The problem occures when a module tries to add a content-type, but it does'nt use hook_form. The error is generated by the function array_merge_recursive, which expects to recieve a list of arrays.
If a certain module defines a content-type, but does not add anything special to its form, then node_invoke does not return anything, and the function breaks. The solution for this issue could be to return an empty array, by default:
This is classes critical, because while it might be not the ideal Drupal way, it's not unresonable for a module to add a content-type with no customed form fields (e.g. only a title and a body).
However, there seem to be another problem because, although the form has default values (has_title=>true for example), they don't render for module provided content-types, but that's a story for another issue.
Comment #12
chx commentedLadies and gentlemen, behold this issue! See the first reports which is "This is broken" without offering too much information (a reasonable assumption was that they returned strings) vs "this is how to reproduce and that's why it's broken". The first resulted in 'go away', the second? A patch. Similar constructs can be found in node_load.
Comment #13
BioALIEN commentedchx, while I agree with you - the patch does need some review first before its RTBC ;)
Comment #14
z.stolar commentedCan you be a bit more descriptive? Did you find any faults in it, ways to improve it?
Comment #15
pwolanin commentedDoes it pass the E_ALL test?
Maybe the patch should be like:
Comment #16
pwolanin commentedSince it's an uncommon case (other than the obvious case of disabling the module as mentioned above), i don't think it's critical.
Comment #17
pwolanin commentedthe patch in #12 seems to have already been applied to HEAD and 5.x, perhaps as part of another patch?
Comment #18
(not verified) commented