Closed (fixed)
Project:
Scheduler
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
5 Feb 2011 at 13:15 UTC
Updated:
20 Feb 2011 at 10:30 UTC
Here's the next in the comparison of D6 hook_nodeapi with D7 hook_node_{op}. This one is more complicated because the op values of 'validate' and 'presave' in D6 execute exactly the same code in hook_nodeapi(). However, in D7, this has been split out into separate parts. This is the correct thing to do, but we need to verify that it has been done right.
Attached is a line-by-line comparison of the code. Discussion will follow.
| Comment | File | Size | Author |
|---|---|---|---|
| comparison of node validate and presave.jpg | 908 KB | jonathan1055 |
Comments
Comment #1
jonathan1055 commentedis now
and likewise for unpublish_on
Comment #2
eric-alexander schaefer commented1. OK.
2. That's fine with me.
3. Looks Ok to me.
4. This could be the reason why the NOT NULL stuff with views is not working. Will be right back...
Comment #3
eric-alexander schaefer commented4. It's OK. The unused values have been zero in D6 too. The views filter problem must be somewhere else.
So both hooks look OK. They are now much cleaner since they are separate functions.
Comment #4
jonathan1055 commentedGood.
For a future enhancement, I'd really like to see the 'no date set' value represented as Null not zero. Zero is a date (1st Jan 1970, I know I am being pedantic here). I know that !empty() considers the value of zero to be empty, and that is maybe why we've been getting away with it, but it would be safer to have Null so that tests on whether the value is null would also give the desired answer. It would clean up code and make viewing the node data clearer.
Let's get D7 1.0 released, then continue this discussion, if you think it merits it?