When I published a node, I cannot unpublish it. The first time I encountered this was after I started using Scheduler.

Any ideas how I can unpublish a node?

CommentFileSizeAuthor
#6 node.module.gz23.85 KBHans Lodder

Comments

eric-alexander schaefer’s picture

Can you please explain step by step how you tried to unpublish a node and what went wrong?

Hans Lodder’s picture

By all means. We are in a habit to publish each Saturday a new story. I do this with the help of Scheduler.

Last Friday I made a mistake, I created the story without Scheduling it. So I edited the story and removed the Publish click. That did not work. The story remained published. I solved it by deleting the story, and create it again.

Then I remembered form some time ago, August 2009, that I used Scheduler to Unpublish a story. That did not work either.

Before I started using Scheduler I was able to publish and unpublish stories by marking the publish click in a story.

So I am interested in how to recover that functionality again.

Is there a way you can help me?

Kind regards,

Hans Lodder

eric-alexander schaefer’s picture

This is really weird. It should be the other way around. If you enter a publish-on time scheduler should unpublish the story on saving (because scheduling the publication for a already published story makes no sense).

Please try this if possible:
- disable scheduler module
- create a dummy story and make sure "published" is selected
- save
- edit the story and unselect "published"
- save

Is the story now unpublished?

(now delete the story and enable scheduler)

Hans Lodder’s picture

You provided a good advice. I disabled Scheduler and created and edited the dummy story. It remains published. The Drupal message is that the changed story is saved, but it does not save the unpublish mark.

So it is not a problem in Scheduler.

I performed my test as user/1, so I should have all necessary authorizations. The check mark can be set, so obviously it exists as a field in the database. I do not think I ever experienced problems upgrading either Drupal or Scheduler.

Do you have any ideas what the real problem could be, or how I can find it?

Kind regards, and thanks in advance,

Hans Lodder

eric-alexander schaefer’s picture

I assume you have some PHP experience. Tell me if you don't, I will then provide you with a test file.

Insert this line at the begining of node_load(), node_save() and node_submit() in modules/node/node.module (after $node = (object)$node; if present):

watchdog('DEBUG', 'function_name/node->status = %status', array('%status' => $node->status), WATCHDOG_DEBUG);

(replace "function_name" with the name of the function, like node_load)

Hans Lodder’s picture

StatusFileSize
new23.85 KB

Yes. I think I can perform this PHP edit task. I include my new node.module file.

I again unpublished my dummy page. This is what I read in error log:

content 28/06/2010 - 11:34 story: updated dummy. webmaster view
action 28/06/2010 - 11:34 Set Story dummy to published. webmaster

And yes, it is still published.

What are my next steps?

Kind regards, hans

eric-alexander schaefer’s picture

Are there any lines in the log with "DEBUG" in the type columns when you try to unpublish a node?

Hans Lodder’s picture

Hi Eric!

No, only from the module db-maintenance. My exact steps:

1. Show recent log entries

Latest entry: user 30/06/2010 - 07:54 Deleted user: queuemoacax ... webmaster

2. Add story (and publish; show log entries)

Latest entry: content 30/06/2010 - 08:27 story: added dummy. webmaster view

3. Unpublish story

Latest entry:

content 30/06/2010 - 08:28 story: updated dummy. webmaster view
nodewords 30/06/2010 - 08:28 User webmaster changed the meta tags for ... webmaster
action 30/06/2010 - 08:28 Set Story dummy to published. webmaster

4. Edit story (published still set)

5. Delete story

Latest entry:

content 30/06/2010 - 08:29 story: deleted dummy. webmaster
content 30/06/2010 - 08:28 story: updated dummy. webmaster view
nodewords 30/06/2010 - 08:28 User webmaster changed the meta tags for ... webmaster

6. List all recent log entries (including 1st shown)

content 30/06/2010 - 08:29 story: deleted dummy. webmaster
content 30/06/2010 - 08:28 story: updated dummy. webmaster view
nodewords 30/06/2010 - 08:28 User webmaster changed the meta tags for ... webmaster
action 30/06/2010 - 08:28 Set Story dummy to published. webmaster
content 30/06/2010 - 08:27 story: added dummy. webmaster view
nodewords 30/06/2010 - 08:27 User webmaster changed the meta tags for ... webmaster
action 30/06/2010 - 08:27 Set Story dummy to published. webmaster
user 30/06/2010 - 07:54 Deleted user: queuemoacax ... webmaster

I can only agree with 1 of your 1st comments: Very weird indeed.

I gather you checked whether my php-changes were in-line with your suggestions.

I appreciate your help. Is there anything else I can do?

Regards, hans

Hans Lodder’s picture

I am deeply ashamed for myself!

In the edited code I used the wrong comment statement. As a result the watchdog code never was called and executed. Today i discovered that.

If I unpublish a node the watchdog output is:

content 06/07/2010 - 11:31 story: updated dummy. webmaster view
nodewords 06/07/2010 - 11:31 User webmaster changed the meta tags for ... webmaster
DEBUG 06/07/2010 - 11:31 node_save/node->status = 1 webmaster
action 06/07/2010 - 11:31 Set Story dummy to published. webmaster
DEBUG 06/07/2010 - 11:31 node_sumbmit/node->status = 0 webmaster
DEBUG 06/07/2010 - 11:31 node_load/node->status = webmaster

Does this output make sense to you?

Kind regards, hans

eric-alexander schaefer’s picture

This is really weird. According to the second line from the bottom the state of the node is correctly getting set to 0 at submit.But then an action (possibly node_publish_action) gets triggered which sets the node back to published. But I have no idea what caused this. I would probably try to disable module by module until the unpublishing works again to find out which module does that.

Tambitch’s picture

I had the same problems and it went away when I disabled the core-module "Trigger"

lhubbert’s picture

Thanks, Tambitch. Disabling Trigger worked for me too. Thank goodness, I thought I had a long weekend of work ahead of me.

eric-alexander schaefer’s picture

Status: Active » Fixed
Hans Lodder’s picture

Title: Cannot unpublish a node » Cannot unpublish a node (Reported Drupal core error)

Hi!

Did someone report this error as an error in the Drupal Core / Optional programs?

Regards, hans

hvalentim’s picture

Same problem here. Suddenly it was impossible to unpublish a node. Disabled Trigger and it started working fine.

Status: Fixed » Closed (fixed)

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

kalilo’s picture

Thanks, I had the same problem, solved it by disabling Trigger.

mrP’s picture

Project: Scheduler » Drupal core
Version: 6.x-1.7 » 6.22
Component: Miscellaneous » trigger.module

+1

stumbled on this post and disabling trigger solved my unpublish woes.