Loading core/modules/dblog/src/Plugin/views/filter/DblogTypes.php +9 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ namespace Drupal\dblog\Plugin\views\filter; use Drupal\Core\Form\FormStateInterface; use Drupal\views\Plugin\views\filter\InOperator; /** Loading @@ -21,4 +22,12 @@ public function getValueOptions() { return $this->valueOptions; } /** * {@inheritDoc} */ protected function valueForm(&$form, FormStateInterface $form_state) { parent::valueForm($form, $form_state); $form['value']['#access'] = !empty($form['value']['#options']); } } core/modules/dblog/tests/src/Functional/DbLogTest.php +2 −0 Original line number Diff line number Diff line Loading @@ -724,12 +724,14 @@ public function testFilter() { $this->drupalGet('admin/reports/dblog', ['query' => ['order' => 'Type']]); $this->assertSession()->statusCodeEquals(200); $this->assertSession()->pageTextContains('Operations'); $this->assertSession()->fieldExists('edit-type'); // Clear all logs and make sure the confirmation message is found. $this->clearLogsEntries(); // Confirm that the logs should be cleared. $this->submitForm([], 'Confirm'); $this->assertSession()->pageTextContains('Database log cleared.'); $this->assertSession()->fieldNotExists('edit-type'); } /** Loading Loading
core/modules/dblog/src/Plugin/views/filter/DblogTypes.php +9 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ namespace Drupal\dblog\Plugin\views\filter; use Drupal\Core\Form\FormStateInterface; use Drupal\views\Plugin\views\filter\InOperator; /** Loading @@ -21,4 +22,12 @@ public function getValueOptions() { return $this->valueOptions; } /** * {@inheritDoc} */ protected function valueForm(&$form, FormStateInterface $form_state) { parent::valueForm($form, $form_state); $form['value']['#access'] = !empty($form['value']['#options']); } }
core/modules/dblog/tests/src/Functional/DbLogTest.php +2 −0 Original line number Diff line number Diff line Loading @@ -724,12 +724,14 @@ public function testFilter() { $this->drupalGet('admin/reports/dblog', ['query' => ['order' => 'Type']]); $this->assertSession()->statusCodeEquals(200); $this->assertSession()->pageTextContains('Operations'); $this->assertSession()->fieldExists('edit-type'); // Clear all logs and make sure the confirmation message is found. $this->clearLogsEntries(); // Confirm that the logs should be cleared. $this->submitForm([], 'Confirm'); $this->assertSession()->pageTextContains('Database log cleared.'); $this->assertSession()->fieldNotExists('edit-type'); } /** Loading