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.

CommentFileSizeAuthor
schema_serialze.patch2.83 KBIsland Usurper
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Island Usurper’s picture

I 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.

Island Usurper’s picture

Status: Needs review » Fixed

Tax admin still works, as does granting file download access. Committed.

rszrama’s picture

Nice trick... didn't know about that'n. I wonder why the cache system doesn't use that. : P

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.