From a369a0e3dd43121108859840a191114765f18405 Mon Sep 17 00:00:00 2001 From: Daniel Wehner <daniel.wehner@erdfisch.de> Date: Fri, 17 Aug 2012 15:52:31 +0200 Subject: [PATCH] Issue #1736458: Remove a couple of debug messages in wizard tests. --- .../Plugin/views/wizard/WizardPluginBase.php | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php b/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php index d084b7e43bb4..5884c1eccd37 100644 --- a/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php +++ b/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php @@ -750,12 +750,19 @@ protected function default_display_sorts_user($form, $form_state) { $column = $column[0]; } - $sorts[$column] = array( - 'id' => $column, - 'table' => $table, - 'field' => $column, - 'order' => $sort, - ); + // If the input is invalid, for example when the #default_value contains + // created from node, but the wizard type is another base table, make + // sure it is not added. This usually don't happen if you have js + // enabled. + $data = views_fetch_data($table); + if (isset($data[$column]['sort'])) { + $sorts[$column] = array( + 'id' => $column, + 'table' => $table, + 'field' => $column, + 'order' => $sort, + ); + } } return $sorts; -- GitLab