diff --git a/src/Plugin/monitoring/SensorPlugin/DatabaseAggregatorSensorPlugin.php b/src/Plugin/monitoring/SensorPlugin/DatabaseAggregatorSensorPlugin.php index b025cf9..b34e3e8 100644 --- a/src/Plugin/monitoring/SensorPlugin/DatabaseAggregatorSensorPlugin.php +++ b/src/Plugin/monitoring/SensorPlugin/DatabaseAggregatorSensorPlugin.php @@ -537,7 +537,7 @@ class DatabaseAggregatorSensorPlugin extends DatabaseAggregatorSensorPluginBase $query->range(0, 1)->execute(); } catch (\Exception $e) { - $form_state->setErrorByName("verbose_fields][$key][field", t('The field %field does not exist in the table "%table".', ['%field' => $field_name, '%table' => $table])); + $form_state->setErrorByName("verbose_fields][$key][field_key", t('The field %field does not exist in the table "%table".', ['%field' => $field_name, '%table' => $table])); continue; } } diff --git a/src/Tests/MonitoringCoreWebTest.php b/src/Tests/MonitoringCoreWebTest.php index 3deb4c5..d27ead0 100644 --- a/src/Tests/MonitoringCoreWebTest.php +++ b/src/Tests/MonitoringCoreWebTest.php @@ -53,7 +53,7 @@ class MonitoringCoreWebTest extends MonitoringTestBase { $this->assertTrue($message == 'Session opened for .', 'Found replaced message in output.'); $this->assertText('Session opened for ' . $test_user->label()); // Remove variables from the fields and assert message has no replacements. - $this->drupalPostForm('admin/config/system/monitoring/sensors/user_successful_logins', ['verbose_fields[variables][field]' => ''], t('Save')); + $this->drupalPostForm('admin/config/system/monitoring/sensors/user_successful_logins', ['verbose_fields[variables][field_key]' => ''], t('Save')); $this->drupalGet('admin/reports/monitoring/sensors/user_successful_logins'); $xpath = $this->xpath('//fieldset[@id="edit-verbose"]/div[@class="fieldset-wrapper"]/table/tbody/tr[@class="entity odd"]'); $wid = (string) $xpath[0]->td[0]; @@ -61,8 +61,7 @@ class MonitoringCoreWebTest extends MonitoringTestBase { $this->assertTrue($wid == 6, 'Found WID in verbose output (WID == 6)'); $this->assertTrue($message == 'Session opened for %name.', 'Found unreplaced message in output.'); // Test field validation. - $this->drupalPostForm('admin/config/system/monitoring/sensors/user_successful_logins', ['verbose_fields[2][field]' => 'horstname'], t('Save')); - $this->assertText('1 error has been found: Field'); + $this->drupalPostForm('admin/config/system/monitoring/sensors/user_successful_logins', ['verbose_fields[2][field_key]' => 'horstname'], t('Save')); $this->assertText('The field horstname does not exist in the table "watchdog".'); }