Loading core/modules/views/src/Plugin/views/sort/SortPluginBase.php +1 −1 Original line number Diff line number Diff line Loading @@ -230,7 +230,7 @@ public function validateExposeForm($form, FormStateInterface $form_state) { 'expose', 'field_identifier', ]); if (!preg_match('/^[a-zA-z][a-zA-Z0-9_~.\-]*$/', $field_identifier)) { if (!preg_match('/^[a-zA-Z][a-zA-Z0-9_~.\-]*$/', $field_identifier)) { $form_state->setErrorByName('expose][field_identifier', $this->t('This identifier has illegal characters.')); return; } Loading core/modules/views_ui/tests/src/Functional/ExposedFormUITest.php +4 −1 Original line number Diff line number Diff line Loading @@ -150,10 +150,13 @@ public function testExposedAdminUi() { $this->submitForm($edit, 'Apply'); $this->assertSession()->pageTextContains('Sort field identifier field is required.'); // Try with an invalid identifier. // Try with an invalid identifiers. $edit['options[expose][field_identifier]'] = 'abc&! ###08.'; $this->submitForm($edit, 'Apply'); $this->assertSession()->pageTextContains('This identifier has illegal characters.'); $edit['options[expose][field_identifier]'] = '^abcde'; $this->submitForm($edit, 'Apply'); $this->assertSession()->pageTextContains('This identifier has illegal characters.'); // Use a valid identifier. $edit['options[expose][field_identifier]'] = $this->randomMachineName() . '_-~.'; Loading Loading
core/modules/views/src/Plugin/views/sort/SortPluginBase.php +1 −1 Original line number Diff line number Diff line Loading @@ -230,7 +230,7 @@ public function validateExposeForm($form, FormStateInterface $form_state) { 'expose', 'field_identifier', ]); if (!preg_match('/^[a-zA-z][a-zA-Z0-9_~.\-]*$/', $field_identifier)) { if (!preg_match('/^[a-zA-Z][a-zA-Z0-9_~.\-]*$/', $field_identifier)) { $form_state->setErrorByName('expose][field_identifier', $this->t('This identifier has illegal characters.')); return; } Loading
core/modules/views_ui/tests/src/Functional/ExposedFormUITest.php +4 −1 Original line number Diff line number Diff line Loading @@ -150,10 +150,13 @@ public function testExposedAdminUi() { $this->submitForm($edit, 'Apply'); $this->assertSession()->pageTextContains('Sort field identifier field is required.'); // Try with an invalid identifier. // Try with an invalid identifiers. $edit['options[expose][field_identifier]'] = 'abc&! ###08.'; $this->submitForm($edit, 'Apply'); $this->assertSession()->pageTextContains('This identifier has illegal characters.'); $edit['options[expose][field_identifier]'] = '^abcde'; $this->submitForm($edit, 'Apply'); $this->assertSession()->pageTextContains('This identifier has illegal characters.'); // Use a valid identifier. $edit['options[expose][field_identifier]'] = $this->randomMachineName() . '_-~.'; Loading