Project:Publish Content
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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

#1

Hi ngmaloney,

which form/url generate this notice?

#2

It was on any node edit page.

#3

Version:6.x-1.1» 6.x-1.x-dev
Status:active» fixed

fixed in dev
http://drupal.org/cvs?commit=373962

#4

Status:fixed» closed (fixed)

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