If the admin has not save the content type edit forms after installing this module then there will be a permission for every content even though they will not have publish button enabled.

This is because

    // First we need to check if there are a publish button for the content
    // type.
    if (variable_get('publish_button_content_type_' . $type->type, TRUE)) {

This value defaults to NULL when determining whether a button should be shown
if (variable_get('publish_button_content_type_' . $form['#node']->type) == TRUE) {

Here is a patch

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

MiSc’s picture

Status: Needs review » Reviewed & tested by the community

Sorry for my lack of response, tested!

MiSc’s picture

Status: Reviewed & tested by the community » Fixed

And committed to latest dev :-)

Status: Fixed » Closed (fixed)

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

coredumperror’s picture

Status: Closed (fixed) » Active

This fix broke Features which have saved publish button permissions.

Because publish_button_permission() only defines a content type's publish button permission if that content type has been saved with that option enabled, anything external to Publish Button which cares about that permission will get screwed if the permission suddenly vanishes.

I haven't found any evidence of best practices to support this feeling, but I don't think that it's a good idea to use conditionally defined permissions. If your module could define a permission, it should always define it, so that external things like Features don't barf if your module suddenly stops defining the permission.

MiSc’s picture

@coredumperror, seems like a good point. I think it over.

MiSc’s picture

Status: Active » Closed (works as designed)

I decided to stay with the fix, permissions that are not used should not be in the permissions in the first place. Please reopen if this seems totally wrong.

MiSc’s picture

Issue summary: View changes

just fixed grammar