You are here

function panels_page_update_5001 in Panels 5.2

Strips out any whitespace in the access string.

Due to developer oversight, the format of access field string changed from ', ' to ',' for several months of the -dev version. Ordinarily, we do not accommodate changes made in the -dev version in later update functions, as it both promotes bad habits on the part of module users and tends to create database inconsistencies. However, in this case, the improper delimiter was in place for long enough that it merits correction, especially because the correction can be made non-destructively and transparently for any site that never used the bad -dev.

File

panels_page/panels_page.install, line 31

Code

function panels_page_update_5001() {
  $result = db_query('SELECT pid, access from {panels_page}');
  while ($row = db_fetch_object($result)) {
    $access = str_replace(' ', '', $row->access);
    $row->access = implode(', ', explode(',', $access));
    db_query("UPDATE {panels_page} SET access = '%s' WHERE pid = %d", $row->access, $row->pid);
  }
  return array();
}