tolmi,

The test to know whether a node is protected uses db_affected_rows() which always returns 0 on a SELECT. (which makes sense since SELECT does not affect anything... and of course, MySQL has the opposite problem which is at times it returns 0 when you do an UPDATE which does not affect a row because the values are the same...)

Anyway, there are many different solutions, the one I propose is in the attached patch. Without that patch, the module is not functional in PostgreSQL (i.e. it looks like the node is not protected even though there is a row there and when updating you get an SQL error saying that the row already exists and thus you cannot INSERT INTO.)

Thank you.
Alexis Wilke

CommentFileSizeAuthor
#2 protected_node-postgresql-6.x.patch547 bytesAlexisWilke

Comments

claar’s picture

Am I blind, or did you forget to attach the patch? I'm seeing the same behavior here.

AlexisWilke’s picture

StatusFileSize
new547 bytes

No no... it's here, look:

AlexisWilke’s picture

Status: Needs review » Fixed

Okay, this is now checked in.
http://drupalcode.org/project/protected_node.git/commit/e94ae30
Thank you.
Alexis

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.