Needs work
Project:
Save Draft
Version:
6.x-1.7
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
14 Nov 2010 at 19:55 UTC
Updated:
14 Mar 2012 at 23:44 UTC
Jump to comment: Most recent
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
Comment #1
austintnacious commentedBTW, strangely enough, the nodes do still display as nodes to both anon and logged-in users. . .
Comment #2
austintnacious commentedAND, on the node edit form page there is no checkbox to set the node status to published. . .
Comment #3
austintnacious commentedI 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.
Comment #4
Anonymous (not verified) commentedShould be fixed in latest release
Comment #6
cybermache commentedI am still seeing this problem in the latest version 6.x.-1.7
Comment #7
Anonymous (not verified) commentedHi
I can't replicate this bug, can you supply a patch?
Thanks
Comment #8
cybermache commented@danjukes
commenting this line $form['options']['status'] = false; @@24 seemed to do the trick for me.
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?Comment #9
Anonymous (not verified) commentedHi,
Thanks could you try $form['options']['status']['#access'] = FALSE; and test to see if that fixes your issue.
Thanks
Comment #10
cybermache commented@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
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
Comment #11
johnhanley commentedI 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.