I can't figure it out.
Using phpmyadmin, I can look at the node table and confirm that all the relevant nodes have status=1 (published).
I have used Type Defaults to set the default for status to "Published"
On the Content Type Edit / Settings page, again I have the "Workflow Settings" set to default to "Published.

However, when I go to edit a node of the relevant type, the status is given as "not published" and if I try to catch these nodes in a views display using a filter on the status (pub/unpub) the nodes do not appear.
Although they have status=1 in the DB they are still somehow unpublished.

Help?

Comments

austintnacious’s picture

BTW, strangely enough, the nodes do still display as nodes to both anon and logged-in users. . .

austintnacious’s picture

AND, on the node edit form page there is no checkbox to set the node status to published. . .

austintnacious’s picture

Title: Is there any chance that Type Defaults is causing problems with node > status » Save Draft causes some strange issues
Project: Util » Save Draft
Version: 6.x-3.0 » 6.x-1.5
Component: Type defaults » Code
Category: support » bug

I started out thinking this might have been an problem with the Type Default contrib to the Util module.

But I realize now the problem is caused by Save Draft.

With Save Draft installed, even when a node has status=1 in the DB, somehow in the process of taking control of the "published" checkbox Save Draft is forcing nodes to be seen as unpublished in certain circumstances.

E.g. a published node (status=1) will appear as normal in node view, but will not appear in views displays with filters for published nodes (i.e. views perceives the nodes as unpublished), etc.

Anonymous’s picture

Status: Active » Fixed

Should be fixed in latest release

Status: Fixed » Closed (fixed)

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

cybermache’s picture

Version: 6.x-1.5 » 6.x-1.7
Status: Closed (fixed) » Active

I am still seeing this problem in the latest version 6.x.-1.7

Anonymous’s picture

Status: Active » Needs work

Hi

I can't replicate this bug, can you supply a patch?

Thanks

cybermache’s picture

@danjukes
commenting this line $form['options']['status'] = false; @@24 seemed to do the trick for me.

function save_draft_form_alter(&$form, &$form_state, $form_id) {
  $form_id = substr($form_id, -9);
  if ($form_id == 'node_form' && user_access('save draft')) {
//    $form['options']['status'] = false;
    if (isset($form['nid']['#value'])) {

Not sure what it's there for but ran through some tests of saving drafts, publishing drafts, etc. and no errors so far. Can you confirm the need or not of this line of code?

thanks

Or should that line to read $form['options']['status']['#access'] = TRUE; instead?

Anonymous’s picture

Hi,

Thanks could you try $form['options']['status']['#access'] = FALSE; and test to see if that fixes your issue.

Thanks

cybermache’s picture

@danjukes
Using $form['options']['status']['#access'] = FALSE; creates the same problem. I'm not sure why you are wanting this to be set to FALSE since in my limited PHP knowledge wouldn't you want #access to be set to TRUE from the previous IF statement if ($form_id == 'node_form' && user_access('save draft')) {. This is asking if the page is a node form and the user viewing it has 'save draft' permission, correct? Perhaps this IF statement needs to be edited then, if $form['options']['status']['#access'] must equal FALSE.

using
$form['options']['status']['#access'] = TRUE;
brings the Published option back and keeps that value with the node after saving.

changing user_access to !user_access and changing TRUE to FALSE

if ($form_id == 'node_form' && !user_access('save draft')) {
    $form['options']['status']['#access'] = FALSE;

correction this snippet above actually removes the "Save as Draft" button

also brings back the Published option in the node_form and keeps this value with the node.

Anything else you'd like me to try? Any thoughts on why you are not able to replicate this bug? By chance are you aware of other modules that tend to "not play nice" with Save Draft? I could check to see if I am using anyone of those then.

thanks

johnhanley’s picture

I just installed this handy niche module for the first time today and immediately noticed this issue.

It appears the existence of $form['options']['status'] is required otherwise the status will always display as "Not published" when editing a node. Note this doesn't alter the actual status of the node, just the publish status message.

Simply removing/disabling line 23 ($form['options']['status'] = false;) resolves the problem.

One could hide the checkbox option with CSS or disable it with the #disabled attribute, but this seems completely unnecessary. There's no harm in leaving the original (albeit redundant) checkbox option under "Publishing options". Besides, users without "administer nodes" permission won't see it anyway.