It seem that the code brought into 6.x:

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

Is nearly identical or identical with the code in function content_write_record($table, &$object, $update = array())

Seems that it would be reasonable to just use the core function and eliminate this custom function?

Comments

KarenS’s picture

Status: Active » Postponed (maintainer needs more info)

See the PHP docs -- drupal_write_record() has a problem if you use NULL columns, which we need. Someone should have noted the issue number where that was discovered, I think it was a core patch that never made it in. I'll see if I can find it.

KarenS’s picture

Status: Postponed (maintainer needs more info) » Fixed

Here are the issues, and I'll add it to the PHP docs -- http://drupal.org/node/227677 and http://drupal.org/node/226264.

The fix never did get committed to core, so it seems it is still needed.

KarenS’s picture

Title: replace content_write_record with drupal_write_record » TODO replace content_write_record with drupal_write_record
Status: Fixed » Active

Thinking more, this is really a TODO. I added a TODO to get rid of the duplicate function once the core function gets patched. We'll have to think about how to do that without breaking things for people who aren't current on the latest Drupal core version.

pwolanin’s picture

hook requirements for Drupal core version?

zeta ζ’s picture

Will the .info file need updating to require core 6.3?

(sorry if this is what pwolanin said in #4 – not sure what that means)

pwolanin’s picture

I'm not sure that can be specified in the .info file (though maybe) - there is also a hook_requirements which is usually in the .install file.

KarenS’s picture

Double-checking this one again, it is still not committed, even to D7, let alone D6, so this is still needed.