From 79f5da4e9f7deb113cb4fcbbee3dfacc459e80a4 Mon Sep 17 00:00:00 2001 From: dereine <dereine@99340.no-reply.drupal.org> Date: Wed, 10 Oct 2012 15:12:40 -0400 Subject: [PATCH] Issue #1806916 by dawehner: Fixed editing details does not save any property. --- lib/Drupal/views/Tests/UI/StorageTest.php | 47 +++++++++++++++++++++++ views_ui/admin.inc | 2 +- 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 lib/Drupal/views/Tests/UI/StorageTest.php diff --git a/lib/Drupal/views/Tests/UI/StorageTest.php b/lib/Drupal/views/Tests/UI/StorageTest.php new file mode 100644 index 000000000000..328613e1c2f4 --- /dev/null +++ b/lib/Drupal/views/Tests/UI/StorageTest.php @@ -0,0 +1,47 @@ +<?php + +/** + * @file + * Definition of Drupal\views\tests\UI\StorageTest. + */ + +namespace Drupal\views\Tests\UI; + +/** + * Tests the UI of storage properties of views. + */ +class StorageTest extends UITestBase { + + public static function getInfo() { + return array( + 'name' => 'Storage properties', + 'description' => 'Tests the UI of storage properties of views.', + 'group' => 'Views UI', + ); + } + + /** + * Tests changing human_name, description and tag. + * + * @see views_ui_edit_details_form + */ + public function testDetails() { + $view = $this->getBasicView(); + + $path = "admin/structure/views/nojs/edit-details/{$view->storage->name}"; + $edit = array( + 'human_name' => $this->randomName(), + 'tag' => $this->randomName(), + 'description' => $this->randomName(30), + ); + + $this->drupalPost($path, $edit, t('Apply')); + $this->drupalPost(NULL, array(), t('Save')); + $view = views_get_view($view->storage->name); + + foreach (array('human_name', 'tag', 'description') as $property) { + $this->assertEqual($view->storage->{$property}, $edit[$property], format_string('Make sure the property @property got probably saved.', array('@property' => $property))); + } + } + +} diff --git a/views_ui/admin.inc b/views_ui/admin.inc index 91a1539a9e28..ddbacfeb7e04 100644 --- a/views_ui/admin.inc +++ b/views_ui/admin.inc @@ -973,7 +973,7 @@ function views_ui_edit_details_form_submit($form, &$form_state) { // Only save values onto the view if they're actual view properties // (as opposed to 'op' or 'form_build_id'). if (isset($form['details'][$key])) { - $view->$key = $value; + $view->storage->$key = $value; } } $form_state['#page_title'] = views_ui_edit_page_title($view); -- GitLab