Closed (fixed)
Project:
Rules
Version:
7.x-2.x-dev
Component:
Rules Engine
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
2 Apr 2012 at 13:56 UTC
Updated:
14 May 2012 at 09:40 UTC
Jump to comment: Most recent file
Comments
Comment #1
fagoimplemented: http://drupalcode.org/project/rules.git/commit/ff728b9
As the entity api specifies that durations have to be represented in seconds, we cannot really change the storage format of duration and properly differentiate between e.g. 86400 * 30 seconds or "1 month". However, usually 1 month will be the desired duration so we'll just go with the higher units (years, months, days) if the number of (stored) seconds is high enough. For that I've baked in the assumption that 1 day == 24hours, 1 month == 30 days and 1 year == 12 months.
Comment #3
mh86 commentedUnfortunately the changes do not work in PHP 5.2, as there the date modify function returns NULL instead of the DateTime object (see http://www.php.net/manual/en/datetime.modify.php), leading to a PHP error in 5.2.
Attached patch fixes the code for PHP versions prior to 5.3
Comment #4
fagothanks, committed.