Update to Drupal 8.1.1. For more information, see https://www.drupal.org/node/2718713
This commit is contained in:
parent
c0a0d5a94c
commit
9eae24d844
669 changed files with 3873 additions and 1553 deletions
|
@ -160,7 +160,7 @@ class AddHandler extends ViewsFormBase {
|
|||
}
|
||||
else {
|
||||
$form['options']['markup'] = array(
|
||||
'#markup' => '<div class="js-form-item form-item">' . $this->t('There are no @types available to add.', array('@types' => $ltitle)) . '</div>',
|
||||
'#markup' => '<div class="js-form-item form-item">' . $this->t('There are no @types available to add.', array('@types' => $ltitle)) . '</div>',
|
||||
);
|
||||
}
|
||||
// Add a div to show the selected items
|
||||
|
|
|
@ -53,7 +53,7 @@ class ConfigHandlerExtra extends ViewsFormBase {
|
|||
|
||||
$form = array(
|
||||
'options' => array(
|
||||
'#tree' => true,
|
||||
'#tree' => TRUE,
|
||||
'#theme_wrappers' => array('container'),
|
||||
'#attributes' => array('class' => array('scroll'), 'data-drupal-views-scroll' => TRUE),
|
||||
),
|
||||
|
|
|
@ -352,4 +352,3 @@ class RearrangeFilter extends ViewsFormBase {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -3,17 +3,20 @@
|
|||
namespace Drupal\views_ui\Form\Ajax;
|
||||
|
||||
use Drupal\Component\Utility\Html;
|
||||
use Drupal\Core\Ajax\AjaxResponse;
|
||||
use Drupal\Core\Ajax\CloseModalDialogCommand;
|
||||
use Drupal\Core\Ajax\OpenModalDialogCommand;
|
||||
use Drupal\Core\Form\FormBase;
|
||||
use Drupal\Core\Form\FormState;
|
||||
use Drupal\Core\Form\FormStateInterface;
|
||||
use Drupal\Core\Render\BubbleableMetadata;
|
||||
use Drupal\Core\Render\RenderContext;
|
||||
use Drupal\views\Ajax\HighlightCommand;
|
||||
use Drupal\views\Ajax\ReplaceTitleCommand;
|
||||
use Drupal\views\Ajax\ShowButtonsCommand;
|
||||
use Drupal\views\Ajax\TriggerPreviewCommand;
|
||||
use Drupal\views\ViewEntityInterface;
|
||||
use Drupal\views\Ajax;
|
||||
use Drupal\views_ui\Ajax as AjaxUI;
|
||||
use Drupal\Core\Ajax\AjaxResponse;
|
||||
use Drupal\Core\Ajax\CloseModalDialogCommand;
|
||||
use Drupal\views_ui\Ajax\SetFormCommand;
|
||||
use Symfony\Component\HttpFoundation\RedirectResponse;
|
||||
|
||||
/**
|
||||
|
@ -151,10 +154,10 @@ abstract class ViewsFormBase extends FormBase implements ViewsFormInterface {
|
|||
else {
|
||||
$response = new AjaxResponse();
|
||||
$response->addCommand(new CloseModalDialogCommand());
|
||||
$response->addCommand(new Ajax\ShowButtonsCommand(!empty($view->changed)));
|
||||
$response->addCommand(new Ajax\TriggerPreviewCommand());
|
||||
$response->addCommand(new ShowButtonsCommand(!empty($view->changed)));
|
||||
$response->addCommand(new TriggerPreviewCommand());
|
||||
if ($page_title = $form_state->get('page_title')) {
|
||||
$response->addCommand(new Ajax\ReplaceTitleCommand($page_title));
|
||||
$response->addCommand(new ReplaceTitleCommand($page_title));
|
||||
}
|
||||
}
|
||||
// If this form was for view-wide changes, there's no need to regenerate
|
||||
|
@ -248,10 +251,10 @@ abstract class ViewsFormBase extends FormBase implements ViewsFormInterface {
|
|||
// Usually this happens at the same path, but custom paths may be
|
||||
// specified in $form_state.
|
||||
$form_url = $form_state->has('url') ? $form_state->get('url')->toString() : $this->url('<current>');
|
||||
$response->addCommand(new AjaxUI\SetFormCommand($form_url));
|
||||
$response->addCommand(new SetFormCommand($form_url));
|
||||
|
||||
if ($section = $form_state->get('#section')) {
|
||||
$response->addCommand(new Ajax\HighlightCommand('.' . Html::cleanCssIdentifier($section)));
|
||||
$response->addCommand(new HighlightCommand('.' . Html::cleanCssIdentifier($section)));
|
||||
}
|
||||
|
||||
return $response;
|
||||
|
|
|
@ -44,7 +44,7 @@ class CachedDataUITest extends UITestBase {
|
|||
// Test we are redirected to the view listing page.
|
||||
$this->assertUrl('admin/structure/views', array(), 'Redirected back to the view listing page.');
|
||||
|
||||
// Login with another user and make sure the view is locked and break.
|
||||
// Log in with another user and make sure the view is locked and break.
|
||||
$this->drupalPostForm('admin/structure/views/nojs/display/test_view/default/title', array(), t('Apply'));
|
||||
$this->drupalLogin($this->adminUser);
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ class FieldUITest extends UITestBase {
|
|||
$this->assertEqual((string) $result[2], '{{ name }} == Name');
|
||||
|
||||
$result = $this->xpath('//details[@id="edit-options-more"]');
|
||||
$this->assertEqual(empty($result), true, "Container 'more' is empty and should not be displayed.");
|
||||
$this->assertEqual(empty($result), TRUE, "Container 'more' is empty and should not be displayed.");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -107,7 +107,7 @@ class PreviewTest extends UITestBase {
|
|||
$this->assertText("SELECT views_test_data.name AS views_test_data_name\nFROM \n{views_test_data} views_test_data\nWHERE (( (views_test_data.id = '100' ) ))");
|
||||
|
||||
// Test that the statistics and query are rendered above the preview.
|
||||
$this->assertTrue(strpos($this->getRawContent(), 'views-query-info') < strpos($this->getRawContent(), 'view-test-preview') , 'Statistics shown above the preview.');
|
||||
$this->assertTrue(strpos($this->getRawContent(), 'views-query-info') < strpos($this->getRawContent(), 'view-test-preview'), 'Statistics shown above the preview.');
|
||||
|
||||
// Test that statistics and query rendered below the preview.
|
||||
$settings->set('ui.show.sql_query.where', 'below')->save();
|
||||
|
|
|
@ -25,7 +25,7 @@ class RedirectTest extends UITestBase {
|
|||
$random_destination = $this->randomMachineName();
|
||||
$edit_path = "admin/structure/views/view/$view_name/edit";
|
||||
|
||||
$this->drupalPostForm($edit_path, array(), t('Save') , array('query' => array('destination' => $random_destination)));
|
||||
$this->drupalPostForm($edit_path, array(), t('Save'), array('query' => array('destination' => $random_destination)));
|
||||
$this->assertUrl($random_destination, array(), 'Make sure the user got redirected to the expected page defined in the destination.');
|
||||
|
||||
// Setup a view with a certain page display path. If you change the path
|
||||
|
|
|
@ -48,7 +48,7 @@ class TranslatedViewTest extends WebTestBase {
|
|||
'translate interface',
|
||||
];
|
||||
|
||||
// Create and login user.
|
||||
// Create and log in user.
|
||||
$this->adminUser = $this->drupalCreateUser($permissions);
|
||||
$this->drupalLogin($this->adminUser);
|
||||
|
||||
|
|
|
@ -0,0 +1,69 @@
|
|||
<?php
|
||||
|
||||
namespace Drupal\Tests\views_ui\FunctionalJavascript;
|
||||
|
||||
use Drupal\FunctionalJavascriptTests\JavascriptTestBase;
|
||||
|
||||
/**
|
||||
* Tests the JavaScript library caching on consecutive requests.
|
||||
*
|
||||
* @group views_ui
|
||||
*/
|
||||
class LibraryCachingTest extends JavascriptTestBase {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static $modules = ['node', 'views', 'views_ui'];
|
||||
|
||||
/**
|
||||
* Tests if the Views UI dialogs open on consecutive requests.
|
||||
*/
|
||||
public function testConsecutiveDialogRequests() {
|
||||
$admin_user = $this->drupalCreateUser([
|
||||
'administer site configuration',
|
||||
'administer views',
|
||||
'administer nodes',
|
||||
'access content overview',
|
||||
]);
|
||||
|
||||
// Disable automatic live preview to make the sequence of calls clearer.
|
||||
\Drupal::configFactory()->getEditable('views.settings')->set('ui.always_live_preview', FALSE)->save();
|
||||
$this->drupalLogin($admin_user);
|
||||
|
||||
$this->drupalGet('admin/structure/views/view/content');
|
||||
$page = $this->getSession()->getPage();
|
||||
|
||||
// Use the 'Add' link for fields to open a dialog. This will load the proper
|
||||
// dialog libraries.
|
||||
$add_link = $page->findById('views-add-field');
|
||||
$this->assertTrue($add_link->isVisible(), 'Add fields button found.');
|
||||
$add_link->click();
|
||||
$this->getSession()->wait(5000, "jQuery('.ui-dialog-titlebar').length > 0");
|
||||
// Close the dialog and open it again. No no libraries will be loaded, but a
|
||||
// cache entry will be made for not loading any libraries.
|
||||
$page->pressButton('Close');
|
||||
$add_link->click();
|
||||
$this->getSession()->wait(5000, "jQuery('.ui-dialog-titlebar').length > 0");
|
||||
$page->pressButton('Close');
|
||||
|
||||
// Reload the page.
|
||||
$this->drupalGet('admin/structure/views/view/content');
|
||||
$page = $this->getSession()->getPage();
|
||||
|
||||
// Now use the 'Update preview' button to load libraries.
|
||||
$preview = $page->findById('preview-submit');
|
||||
// The first click will load all the libraries.
|
||||
$preview->click();
|
||||
$this->getSession()->wait(5000, "jQuery('.ajax-progress').length === 0");
|
||||
// The second click will not load any new libraries.
|
||||
$preview->click();
|
||||
$this->getSession()->wait(5000, "jQuery('.ajax-progress').length === 0");
|
||||
// Check to see if the dialogs still open.
|
||||
$add_link = $page->findById('views-add-field');
|
||||
$add_link->click();
|
||||
$this->getSession()->wait(5000, "jQuery('.ui-dialog-titlebar').length > 0");
|
||||
$page->pressButton('Close');
|
||||
}
|
||||
|
||||
}
|
|
@ -270,7 +270,7 @@ function views_ui_contextual_links_suppress($set = NULL) {
|
|||
* @see views_ui_contextual_links_suppress_pop()
|
||||
*/
|
||||
function views_ui_contextual_links_suppress_push() {
|
||||
views_ui_contextual_links_suppress(((int) views_ui_contextual_links_suppress())+1);
|
||||
views_ui_contextual_links_suppress(((int) views_ui_contextual_links_suppress()) + 1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -279,7 +279,7 @@ function views_ui_contextual_links_suppress_push() {
|
|||
* @see views_ui_contextual_links_suppress_push()
|
||||
*/
|
||||
function views_ui_contextual_links_suppress_pop() {
|
||||
views_ui_contextual_links_suppress(((int) views_ui_contextual_links_suppress())-1);
|
||||
views_ui_contextual_links_suppress(((int) views_ui_contextual_links_suppress()) - 1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
use Drupal\Component\Utility\SafeMarkup;
|
||||
use Drupal\Core\Form\FormState;
|
||||
use Drupal\Core\Render\Element;
|
||||
use Drupal\Core\Render\Element\Checkboxes;
|
||||
use Drupal\Core\Render\Element\Radios;
|
||||
use Drupal\Core\Url;
|
||||
|
||||
/**
|
||||
|
@ -88,8 +90,8 @@ function template_preprocess_views_ui_build_group_filter_form(&$variables) {
|
|||
|
||||
// Prepare default selectors.
|
||||
$form_state = new FormState();
|
||||
$form['default_group'] = Element\Radios::processRadios($form['default_group'], $form_state, $form);
|
||||
$form['default_group_multiple'] = Element\Checkboxes::processCheckboxes($form['default_group_multiple'], $form_state, $form);
|
||||
$form['default_group'] = Radios::processRadios($form['default_group'], $form_state, $form);
|
||||
$form['default_group_multiple'] = Checkboxes::processCheckboxes($form['default_group_multiple'], $form_state, $form);
|
||||
$form['default_group']['All']['#title'] = '';
|
||||
|
||||
$rows[] = array(
|
||||
|
|
Reference in a new issue