They serve as documentation and we can move to use them steadily.
Probably need some doxygen wrapping.

There are more modules that needs constants - e.g. user module.

CommentFileSizeAuthor
#2 node.constants.patch6.13 KBRobRoy
node-constants.diff799 bytesCvbge

Comments

drumm’s picture

Status: Needs review » Needs work

Needs documentation and actually using them somewhere.

RobRoy’s picture

Version: x.y.z » 5.x-dev
Status: Needs work » Needs review
StatusFileSize
new6.13 KB

Not sure what kind of documentation to put in there. The constants seem pretty self-explanatory. For head so I removed the moderation constants and put the others to use in node.module. There are plenty of places in other modules that could use these, but I'm holding off on that for now as I have a question.

Since they were constants, I put them all in queries like '. NODE_WHATEVER .' instead of using %d, but now I think maybe we should always use %d. Let me know.

Jaza’s picture

Is this really needed? Surely any programmer can understand status = 0 just as easily as status = NODE_NOT_PUBLISHED (perhaps even more easily).

I think that this is unnecessary abstraction for simple boolean values. -1.

RobRoy’s picture

Status: Needs review » Closed (won't fix)

On second thought, Jaza is probably right. Since these are all boolean values, this is probably not necessary. The reason we have it for comments is because it is not as intuitive: 0 = disabled, 1 = read, 2 = read/write. Marking won't fix.