Ok so I just using this module for D7. And I noticed that we are using a negate to change the status. I proposing to change it into 1 or 0. Since there are modules who save the status with int (like apacheSOLR I'm using right now). Which will generate error when a content unpublished.
So instead of :

$node-status = !$node->status;

I think this would be better :

$node->status==1 ? $node->status=0 : $node->status=1;

Using this module on d7b3. Thanks for the module

Comments

sylv3st3r’s picture

Oh also the title for user permission have typo :

'unpublish any content' => array(
      'title' => t('Publish any content'),
      'restrict access' => TRUE,
    ));

The title should be "Unpublish any content"

aaronbauman’s picture

I think you're right that $node->status should be an int.
A more graceful way to accomplish this would be with php's xor operator:

$node->status = $node->status ^ 1;

I will roll this up into dev when I get a chance.

aaronbauman’s picture

Version: 7.x-1.0-beta1 » 7.x-1.x-dev
Status: Active » Fixed

Various changes committed to d7 DEV

Status: Fixed » Closed (fixed)

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