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.
drupal_write_record() is one of those cool functions in Drupal 6 that saves a lot of typing, but only if hook_schema() is actually correct. One of the cool things it does is to serialize certain fields for you before saving it to the database. Unfortunately, none of our columns are specified to be serialized.
Patch adds 'serialize' => TRUE
to those columns that need it. There's no need for any database updates since all of those columns are already appropriately sized text columns.
Comment | File | Size | Author |
---|---|---|---|
schema_serialze.patch | 2.83 KB | Island Usurper | |
Comments
Comment #1
Island Usurper CreditAttribution: Island Usurper commentedI actually remembered that we are using drupal_write_record() in a few places already, so I reviewed those places and took out the code that serialized those fields beforehand. I've also added code in one spot to unserialize the data when it's loaded from the database. This was in a private uc_file function, but I don't think that field is ever used afterwards, so it's not a big deal.
As we start converting other places to use drupal_write_record(), it should be easy to remember to delete the serialize() statements but leave the unserialize()s.
Comment #2
Island Usurper CreditAttribution: Island Usurper commentedTax admin still works, as does granting file download access. Committed.
Comment #3
rszrama CreditAttribution: rszrama commentedNice trick... didn't know about that'n. I wonder why the cache system doesn't use that. : P