Closed (fixed)
Project:
Ubercart
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
10 Jun 2009 at 18:52 UTC
Updated:
1 Jul 2009 at 16:40 UTC
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 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 commentedTax admin still works, as does granting file download access. Committed.
Comment #3
rszrama commentedNice trick... didn't know about that'n. I wonder why the cache system doesn't use that. : P