When enabling content_moderation, I get this error:

notice: Undefined index: #node in /shared/vash/sandboxes/garfield/drupal6/www/sites/all/modules/content_moderation/content_moderation.module on line 352.

It then shows up on all forms, period.

Looking at the code, the offending snippet is:

function content_moderation_form_alter(&$form, $form_state, $form_id)  {
  if (!_content_moderation_moderate_node_type($form['#node']->type)) {
    // Dont moderate this content type.
    return;
  }

  if ($form['#id'] == 'node-form') {
    // ...
  }
}

The node type check needs to be inside the form id check, because otherwise $form['#node'] doesn't exist.

Comments

eugenmayer’s picture

Status: Active » Patch (to be ported)

looks abvious, thanks Crell. How i hate this pure FAPI-madness..

Crell’s picture

To be ported, does that mean it's fixed in 6.x-1.x-dev?

eugenmayer’s picture

means, the patch needs to get applied, so its not part of dev yet.

marc delay’s picture

::edit:: - upon closer reading Crell already states that the code should all be inside the
if ($form_id == 'node-form') {
check