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

NeoID’s picture

Status: Active » Fixed

Problem was another form_alter in another module... :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

eL’s picture

Status: Closed (fixed) » Active

I 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?

michelle’s picture

Status: Active » Postponed (maintainer needs more info)

Well, 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

eL’s picture

On line 388 I have:

$teaser_js_build = array_search('node_teaser_js', $form['body_field']['#after_build']);

michelle’s picture

Can you confirm that your forum nodes have body fields?

Michelle

eL’s picture

I think yes. There is common text body field, like on other nodes by default present.

michelle’s picture

Status: Postponed (maintainer needs more info) » Active

Well, 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

michelle’s picture

Status: Active » Fixed

I just went ahead and added the sanity check.

Michelle

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.