Once I protect a node, I can't un-protect it. I created a node and assigned it a password, but later I decided that the node didn't need to be protected. When I edit the node and uncheck the "Node is protected" box, the node always reverts to protected status, no matter how many times I uncheck the box and re-save the node.

Any ideas?

Comments

beanti’s picture

Same here, anybody got an idea?

skippy13’s picture

Edit protected_node.module, and go to line 120. It should be a closing curly brace. Add the following after it:

else {
     db_query('DELETE FROM {protected_nodes} WHERE nid = %d', $node->nid);
}

That will delete from the protected_nodes table the node ID if the value of is_protected is zero or false.

This is not the best long-term solution, because it will always try to delete from the protected_nodes table, regardless of whether that node was protected or not. I don't think that's too big of a deal, since it'll be a null operation: the node doesn't exist in the DB, the DB will determine that, and nothing will be deleted. But it is another DB hit, so if you have an extremely busy site, or a very slow DB, it's something to keep in mind.

mtolmacs’s picture

Assigned: Unassigned » mtolmacs
Status: Active » Fixed

HEAD fixes this. Please test.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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