This project has moved. For the latest updates, please go here.

Post Rendering when IsPublished=False

Jul 11, 2010 at 4:33 AM

So I'm currently running on Graffiti 1.2 so it's possible this is resolved in the 1.3 builds. I've set about 29 posts in my DB to IsPublished=0. I verify that when viewing the tag page which they were all tagged with they're no longer rendered in the summary view. If however I browse directly to one of them, the post continues to render. Is there any other flag I need to toggle? If not, IMO this is a bug - does this still exist in the 1.3 builds?

Coordinator
Jul 12, 2010 at 6:53 PM

That should be all you need to change. When you view your control panel, where do those posts show up (which tab are they under)? Also, did you update these directly in the DB, or did you use the control panel to change their published state?

I do know for a fact that any post not marked as "Published" in 1.3 is not visible on the site. Not sure off-hand if that specific field is what is used, because 1.3 has a Status field, since there are more than two states (Published, Draft, Pending Review, Requires Changes). I honestly can't remember if 1.2 had the same thing.

The way this functions in 1.3 is something of a bug in my mind, actually. If I'm logged in, I think the system should allow me to at least view these posts, even if they don't show up in the site navigation. If you want to use Graffiti as a publishing system, and make use of the other statuses (Pending Review, Requires Changes), having the ability to actually view the post as it is going to display on the site is invaluable.

Coordinator
Jul 12, 2010 at 6:55 PM
charlesboyung wrote:

The way this functions in 1.3 is something of a bug in my mind, actually. If I'm logged in, I think the system should allow me to at least view these posts, even if they don't show up in the site navigation. If you want to use Graffiti as a publishing system, and make use of the other statuses (Pending Review, Requires Changes), having the ability to actually view the post as it is going to display on the site is invaluable.

+1 -- I have run into this very issue several times.

Jul 12, 2010 at 6:59 PM
I just issued an update against the IsPublished column directly in the DB (as I needed to touch about 50 rows). There is also a status column. I was logged in when I browsed directly to them - I suppose it's possible there is a bypass if the cookie is there?
Coordinator
Jul 12, 2010 at 7:32 PM
You may want to update one in the control panel and see if it works as expected then. And if it does, compare the records in the db to see what is different. I'm pretty sure you'll need to update status as well, but not sure without looking what value you need.

Sent from my iPhone

On Jul 12, 2010, at 2:00 PM, "bdesmondMVP" <notifications@codeplex.com> wrote:

From: bdesmondMVP

I just issued an update against the IsPublished column directly in the DB (as I needed to touch about 50 rows). There is also a status column. I was logged in when I browsed directly to them - I suppose it's possible there is a bypass if the cookie is there?
Coordinator
Jul 12, 2010 at 11:46 PM

I've had this problem in the past with 1.2 but it may have been my impatience. This does work as expected in 1.3 but takes a minute to show up correctly for me after the IsPublished flag is flipped. Maybe the value is temporarily cached at the server. How do you change that flag without editing the db directly? If you re-publish as a draft, this just makes the newer version a draft and the previous remains published, which is fine if we could unpublish it as well. I've been working around this by future-dating the post.

+1 I agree that an authenticated user should be able to view drafts

Jul 14, 2010 at 6:12 PM
Edited Jul 14, 2010 at 6:44 PM
I've been confused about what really happens with a typical post life cycle as it applies to revisions, drafts, published etc, so I thought I'd do some testing with the latest build of 1.3. Thought I'd share my results:

(1) - new post saved as draft
posts table row created containing this draft
status = 2
ispublished = false
no record created in versionstore table
Admin Tab - Drafts, Visible to public - No

(2) - edited the post/still a draft
new revision created in versionstore table
posts table still contains original draft
status = 2
ispublished = false
Admin Tab - Drafts, Visible to public - No

(3) - publish the post
new revision created in versionstore table
posts table now contains published revision
status = 1
ispublished = true
Admin Tab - Posts, Visible to public - Yes

(4) - saved as draft again
new revision created in versionstore table
posts table still contains last published revision
status = 2
ispublished = true
Admin Tab - Drafts, Visible to public - Yes

(5) - deleted(soft)
versionstore table still contains revisions
posts table still contains last published revision
status = 2
ispublished = true
isdeleted = true
Admin Tab - Deleted, Visible to public - No

(6) - undeleted
same as 5 except isdeleted = false
Admin Tab - Drafts, Visible to public - Yes

(7) - deleted(soft) again
same as 5
Admin Tab - Deleted, Visible to public - No

(8) - deleted(destroy)
revisions removed from versionstore table
post removed from posts table
Gone for good
Jul 14, 2010 at 7:02 PM
Edited Jul 14, 2010 at 7:03 PM
Having posted the above table, some thoughts on the subject:

I agree we should be able to view drafts
I agree we should be able to completely unpublish a post or revision
In addition, I'd like to be able to delete any or all revisions. Sure we can delete them directly in the versionstore table, but revision counts remain unchanged in the posts table
Coordinator
Jul 14, 2010 at 9:45 PM

Thanks for the info.

There is also the issue of files when editing a template for example. Versions should be deleted along with the file through graffiti admin, but what if you have entries in the version store and then delete the file via ftp? The only way to clear it out at that point is to recreate the file or edit the db, and you may never know how many entries are orphaned if you dont look for them. Having a way to clean those out would be ideal.