Hi Eugen,

I made a patch so the module.install uses schame api. http://drupal.org/node/146843

I am not 100% sure the updates work but the base install will. If I find time I will write a simpletest for your module or maybe motivate you todo so at DC Essen! ;D

Schema API is a very usefull thing and I did really wondered you didn't use it. Please take a look at the field descriptions and at the updates so this is RTBC :)

Later on we can remove stuff like

db_query("INSERT INTO {content_lock} (nid, uid, timestamp) VALUES (%d, %d, %d)", $nid, $uid, time());

and use http://api.drupal.org/api/function/drupal_write_record/6

drupal_write_record('content_lock', $lock);

for INSERT and UPDATE which is much safer and nicer to handle :)

Comments

kars-t’s picture

StatusFileSize
new4.43 KB

5th time my file isn't attached to the post... :(

kars-t’s picture

StatusFileSize
new4.36 KB

And my favourite mistake with patches. Resubmitting with correct path...

eugenmayer’s picture

Well thanks for the patch Karsten. The implementation of that content_lock module is rather old...i did not know about drupal_write_record past then.
There is no doubt about the use of the schema API.

I will apply this patch, thanks!

eugenmayer’s picture

Status: Needs review » Fixed

applied, thanks!

Status: Fixed » Closed (fixed)

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