[drupal-docs] [bug] nodeapi print faults

Fool2 drupal-docs at drupal.org
Wed Oct 12 17:47:01 UTC 2005


Issue status update for 
http://drupal.org/node/33871
Post a follow up: 
http://drupal.org/project/comments/add/33871

 Project:      Documentation
 Version:      <none>
 Component:    Developer Guide
 Category:     bug reports
 Priority:     normal
 Assigned to:  Anonymous
 Reported by:  Fool2
 Updated by:   Fool2
 Status:       active

case 'update':
      if ($node->moderate && user_access('access submission
queue')) {
        print theme('box', t('Post queued'), t('The post is
queued for approval.
        You can check the votes in the <a
href="%queue">submission
        queue</a>.', array('%queue' => url('queue'))));
      }
      elseif ($node->moderate) {
        print theme('box', t('Post queued'), t('The post is
queued for approval.
        The editors will decide whether it should be
published.'));
      }
      else {
        print theme('box', t('Post published'), t('The post is
published.'));
      }
      break;


The above code is listed under hook_nodeapi on drupaldocs.  But when
one attempts to print in a similar fashion using the update case from
within a module calling the nodeapi hook,  you get a "cannot modify
header information..." error.  


Upon closer examination, the doc is at fault.  The above code proposes
methods that are impossible in 4.6.3. It should be changed to
drupal_set_message.




Fool2




More information about the drupal-docs mailing list