Patch (to be ported)
Project:
Content moderation
Version:
6.x-1.9
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Aug 2011 at 17:07 UTC
Updated:
16 Sep 2011 at 16:25 UTC
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
Comment #1
eugenmayer commentedlooks abvious, thanks Crell. How i hate this pure FAPI-madness..
Comment #2
Crell commentedTo be ported, does that mean it's fixed in 6.x-1.x-dev?
Comment #3
eugenmayer commentedmeans, the patch needs to get applied, so its not part of dev yet.
Comment #4
marc delay commented::edit:: - upon closer reading Crell already states that the code should all be inside the
if ($form_id == 'node-form') {
check