Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
KarenS CreditAttribution: KarenS commentedSee 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.
Comment #2
KarenS CreditAttribution: KarenS commentedHere 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.
Comment #3
KarenS CreditAttribution: KarenS commentedThinking 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.
Comment #4
pwolanin CreditAttribution: pwolanin commentedhook requirements for Drupal core version?
Comment #5
zeta ζ CreditAttribution: zeta ζ commentedWill the .info file need updating to require core 6.3?
(sorry if this is what pwolanin said in #4 – not sure what that means)
Comment #6
pwolanin CreditAttribution: pwolanin commentedI'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.
Comment #7
KarenS CreditAttribution: KarenS commentedDouble-checking this one again, it is still not committed, even to D7, let alone D6, so this is still needed.