You are here

function panels_page_update_6001 in Panels 6.2

Ensures the presence of appropriate whitespace in access strings.

Due to some developer oversight, the delimiter used in {panels_page}.access was changed from ', ' to ',' in earlier versions of the Panels 2.x branch. This function makes absolutely sure that any such malformed entries are properly formed, but does not harm any entries that were already properly delimited.

File

panels_page/panels_page.install, line 298

Code

function panels_page_update_6001() {
  $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();
}