I have enabled the E_NOTICE level, and I always get a warning
notice: Undefined index: #node in D:\develop\xampp\htdocs\drupal\modules\advanced_forum\advanced_forum.module on line 318.

function advanced_forum_form_alter(&$form, &$form_state, $form_id) {
  if (advanced_forum_type_is_in_forum($form['#node']->type)) {
  //  [...]

advanced_forum_type_is_in_forum allways makes a call to advanced_forum_get_forum_types
maybe some of these calls can be avoid just checking #node

function advanced_forum_form_alter(&$form, &$form_state, $form_id) {
  if (isset($form['#node']) && advanced_forum_type_is_in_forum($form['#node']->type)) {
  //  [...]

Hope it helps.

Comments

michelle’s picture

Thanks, I'll have a look at that next time I work on AF.

Michelle

michelle’s picture

Status: Needs review » Fixed

I just looked at the code that's there and it's:

if (!empty($form['#node']->type) && advanced_forum_type_is_in_forum($form['#node']->type)) {

So it looks like it already got fixed at some point since alpha 1.

Michelle

Status: Fixed » Closed (fixed)

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