From 701b0d809ab26f38d1a98c35a1c5550022057f52 Mon Sep 17 00:00:00 2001
From: damiankloip <damian@damoweb.co.uk>
Date: Sun, 26 Aug 2012 15:13:12 +0200
Subject: [PATCH] Amended ViewStorageController::save for display settings

---
 lib/Drupal/views/ViewStorageController.php | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/lib/Drupal/views/ViewStorageController.php b/lib/Drupal/views/ViewStorageController.php
index 9f8944f4ae10..305ffa5cf5ae 100644
--- a/lib/Drupal/views/ViewStorageController.php
+++ b/lib/Drupal/views/ViewStorageController.php
@@ -51,9 +51,9 @@ public function save(StorableInterface $entity) {
     $this->preSave($entity);
     $this->invokeHook('presave', $entity);
 
-    // TODO: This temp measure will be removed once we have a better way or
+    // @todo: This temp measure will be removed once we have a better way or
     // separation of storage and the executed view.
-    $properties = array (
+    $config_properties = array (
       'disabled',
       'api_version',
       'name',
@@ -65,8 +65,17 @@ public function save(StorableInterface $entity) {
       'display',
     );
 
-    foreach ($properties as $property) {
-      $config->set($property, $entity->$property);
+    foreach ($config_properties as $property) {
+      if ($property == 'display') {
+        $displays = array();
+        foreach ($entity->display as $key => $display) {
+          $displays[$key] = $display->display_options;
+        }
+        $config->set('display', $displays);
+      }
+      else {
+        $config->set($property, $entity->$property);
+      }
     }
 
     if (!$config->isNew()) {
-- 
GitLab