When updating my module, I had to take data from two tables and merge it into one, using serialize($array) to store an array in a text field. Since this sometimes causes issues with MySQL, i.e. the {} brackets are omitted from serialized strings, I usually use addslashes(serialize($array)) and that works everywhere in my module except in the .install script when the updater performs the query to merge the two old tables into one. The updater strips the slashes, so the data entered into the corresponding table column is missing the {} brackets, as though I hadn't escaped the string at all. So I had to use base64_encode just to get through my schema update, so that data from the 5.x version could be carried over to the 6.x version. In fact, I even tried to use db_query instead of update_sql, and for some reason it did the same thing (stripped the slashes before updating the data). It only does this in the updater, but I can see this causing issues for other module developers who use serialized objects and arrays.
Comments
Comment #1
dpearcefl commentedIs this still an issue using current Drupal 6?
Comment #2
dpearcefl commented