Hi,
For some reason I suddently get this error when trying to add a forum content type. Does anyone have an idea on what I may do so solve this?
warning: array_search() [function.array-search]: Wrong datatype for second argument in /...sites/all/modules/advanced_forum/advanced_forum.module on line 380.
Comments
Comment #1
NeoID commentedProblem was another form_alter in another module... :)
Comment #3
eL commentedI have:
warning: array_search() expects parameter 2 to be array, null given in /data/web/virtuals/virtual/www/sites/all/modules/advanced_forum/advanced_forum.module on line 388.
What to do with this?
Comment #4
michelleWell, NeoID said it was from another module. No idea what one as he didn't say. I don't know what's on line 388 in your copy so I don't even have a guess. Pasting that line would be a good start.
Michelle
Comment #5
eL commentedOn line 388 I have:
$teaser_js_build = array_search('node_teaser_js', $form['body_field']['#after_build']);
Comment #6
michelleCan you confirm that your forum nodes have body fields?
Michelle
Comment #7
eL commentedI think yes. There is common text body field, like on other nodes by default present.
Comment #8
michelleWell, there is by default but the question is whether something else was removing it. For that to be null, that means either the body is missing totally or the #after_build is. Checking if the body is missing is the simpler of the two. If that's present, that means #after_build is missing. I don't know what would cause that to happen and will have to do some digging. That's not going to happen any time soon. If you need it band-aided sooner, you can always wrap that bit of code in
if (!is_null($form['body_field']['#after_build'])) {}.Michelle
Comment #9
michelleI just went ahead and added the sanity check.
Michelle