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 :)
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | content_lock_schema_api_install.patch | 4.36 KB | kars-t |
| #1 | content_lock_schema_api_install.patch | 4.43 KB | kars-t |
Comments
Comment #1
kars-t commented5th time my file isn't attached to the post... :(
Comment #2
kars-t commentedAnd my favourite mistake with patches. Resubmitting with correct path...
Comment #3
eugenmayer commentedWell 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!
Comment #4
eugenmayer commentedapplied, thanks!