diff -u b/modules/demo/src/Tests/TMGMTDemoTest.php b/modules/demo/src/Tests/TMGMTDemoTest.php --- b/modules/demo/src/Tests/TMGMTDemoTest.php +++ b/modules/demo/src/Tests/TMGMTDemoTest.php @@ -50,7 +50,7 @@ $this->clickLink(t('Translate')); $this->drupalPostForm(NULL, $edit, t('Request translation')); $this->assertText(t('2 jobs need to be checked out.')); - // Check to see if no items selected and the error message pops on sources. + // Check to see if no items are selected and the error message pops up. $this->drupalPostForm('admin/tmgmt/sources', array(), t('Request translation')); $this->assertUniqueText(t("You didn't select any source objects")); } diff -u b/src/Form/SourceOverviewForm.php b/src/Form/SourceOverviewForm.php --- b/src/Form/SourceOverviewForm.php +++ b/src/Form/SourceOverviewForm.php @@ -153,10 +153,15 @@ * {@inheritdoc} */ public function validateForm(array &$form, FormStateInterface $form_state) { - if (!$form_state->getValue('values')) { + $items = &$form['items']['#value']; + $issearch = FALSE; + if ($_POST['op'] == t('Search')) { + $issearch = TRUE; + } + if (empty($items) && !$issearch) { $form_state->setError($form, t("You didn't select any source objects")); } - $plugin = $form_state->get('plugin'); + $plugin = $form_state->get('plugin'); $item_type = $form_state->get('item_type'); // Execute the validation method on the source plugin controller. $source_ui = $this->sourceManager->createUIInstance($plugin);