Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Today, I needed this feature, which has been asked for by a few people: http://drupal.org/node/46517
I've tested the attached patch in PHP 4 & PHP 5.
Comment | File | Size | Author |
---|---|---|---|
#5 | node.module.patch | 504 bytes | mvc |
#3 | node.module.patch | 538 bytes | mvc |
node.module.patch | 575 bytes | mvc | |
Comments
Comment #1
StevenPatzComment #2
drewish CreditAttribution: drewish commentedthe coding standards say false should be capitalized.
Comment #3
mvc@drewish: thanks for the comments. I've changed the capitalization, and generated a new patch against 7.x-dev.
Comment #4
chx CreditAttribution: chx commented// Validate the "authored on" field. As of PHP 5.1.0, strtotime returns FALSE instead of -1 upon failure.
Drupal 7 is PHP 5.2 only. You can simplify the condition and as a side affect get access to negative timestamps. Win-win.
Comment #5
mvc@chx: good catch. I've updated that now.
Comment #6
obsidiandesign CreditAttribution: obsidiandesign commentedApplies correctly to HEAD. Tested with 1969-01-01 for authored date, and date is accepted into db & displays correctly. Also, all Node SimpleTests run successfully after applying this patch. +1 for RTBC.
Comment #7
Anonymous (not verified) CreditAttribution: Anonymous commentedThe last submitted patch failed testing.
Comment #8
mvcThe status of this issue was never changed, but this fix is in DRUPAL-7-0-UNSTABLE-2 (which is why the patch currently fails automated testing), so I'm going to mark this issue fixed.