diff --git a/_sql/migrations/935-add-listing-layout-config.php b/_sql/migrations/935-add-listing-layout-config.php new file mode 100644 index 00000000000..2722efc3f07 --- /dev/null +++ b/_sql/migrations/935-add-listing-layout-config.php @@ -0,0 +1,76 @@ +addSql(sprintf( + "UPDATE `s_core_config_elements` SET `value` = '%s' WHERE `name` = 'cacheControllers'", + serialize($tags) + )); + + if ($modus == self::MODUS_INSTALL) { + return; + } + + $values = $this->connection->query("SELECT v.id, v.value FROM s_core_config_values v INNER JOIN s_core_config_elements e ON e.id = v.element_id WHERE e.name = 'cacheControllers'") + ->fetchAll(PDO::FETCH_ASSOC); + + foreach ($values as $row) { + $value = unserialize($row['value']); + $value = explode("\n", $value); + $value[] = 'frontend/listing/layout 0'; + $value = implode("\n", $value); + $value = serialize($value); + + $sql = sprintf("UPDATE `s_core_config_values` SET `value` = '%s' WHERE id = " . (int) $row['id'], $value); + $this->addSql($sql); + } + } +}