Installed module on latest D6 release. On a view page that listed nodes I received the following error:
notice: Undefined index: type in publishcontent/publishcontent.module on line 158.
notice: Undefined index: #value in in publishcontent/publishcontent.module on line 158.
I needed this working ASAP so I added the following code which seems to have resolved it:
Added the following to publishcontent.module, line 153:
#Fix for Undefined index error
if(!isset($form['type']) || !isset($form['type']['#value'])) {
return FALSE;
}
// Below is the full function with the code added.
/**
* Implementation of hook_form_alter()
*
* allow to use the 'Publishing options' on the edit/add page
*/
function publishcontent_form_alter(&$form, $form_state, $form_id) {
#Fix for Undefined index error
if(!isset($form['type']) || !isset($form['type']['#value'])) {
return FALSE;
}
if (!user_access('administer nodes')
&& $form['type']['#value'] .'_node_form' == $form_id
&& (_publishcontent_unpublish_access($form['#node']) ||
_publishcontent_publish_access($form['#node']))) {
$form['options']['#access'] = TRUE;
unset($form['options']['promote']);
unset($form['options']['sticky']);
unset($form['options']['revision']);
}
}
If others experience this bug, I would be happy to submit patch.
Comments
Comment #1
malaussene commentedHi ngmaloney,
which form/url generate this notice?
Comment #2
ngmaloney commentedIt was on any node edit page.
Comment #3
aaronbaumanfixed in dev
http://drupal.org/cvs?commit=373962