Skip to content
Snippets Groups Projects
Commit 79f5da4e authored by Daniel Wehner's avatar Daniel Wehner Committed by Tim Plunkett
Browse files

Issue #1806916 by dawehner: Fixed editing details does not save any property.

parent 3be81150
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
<?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)));
}
}
}
...@@ -973,7 +973,7 @@ function views_ui_edit_details_form_submit($form, &$form_state) { ...@@ -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 // Only save values onto the view if they're actual view properties
// (as opposed to 'op' or 'form_build_id'). // (as opposed to 'op' or 'form_build_id').
if (isset($form['details'][$key])) { if (isset($form['details'][$key])) {
$view->$key = $value; $view->storage->$key = $value;
} }
} }
$form_state['#page_title'] = views_ui_edit_page_title($view); $form_state['#page_title'] = views_ui_edit_page_title($view);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment