After extending doesn’t return to published state automatically
CoPut - March 22, 2008 - 11:45
| Project: | Auto Expire |
| Version: | 6.x-1.0-rc1 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | marcvangend |
| Status: | closed |
Description
On expiration, a node becomes unpublished, but after extending doesn’t return to published state automatically. This looks confusing and I think it should return to published state or shouldn’t become unpublished in the first place.

#1
#2
Here I use most primitive solution: I publish it back when node going to be extended. Actually I'm not sure if it brings some side effects or not. Maybe publishing and unpublishing nodes is not very good way to hide expired nodes from users?
#3
I think that publishing and unpublishing is the best way to hide expired nodes. I see no need to create a module-specific flag when nodes already have this functionality built in.
The 'primitive' solution (setting status = 1 directly in the database, as used in the patch above) has the advantage of better performance (at least in theory, I don't know if anyone would notice). The other method would be to do a node_load, set $node->status to 1 and do a node_save. There are two advantages to that approach: since hooks are invoked, other modules get a chance to act on the (un)publishing of a node. It would also mean that we don't have to worry about the difference between mysql and postgresql queries. I prefer the second method.
#4
subscribe
#5
patch tested by myself...looks good to be committed.
#6
Patch committed to the Drupal 5 branch, still to be ported to D6.
#7
included 6.x-1.0-rc1.
#8
Automatically closed -- issue fixed for 2 weeks with no activity.