Skip to content

Commit

Permalink
Issue #3103010 by AndrewsizZ, No Sssweat, jungle, Lendude, jshimota01…
Browse files Browse the repository at this point in the history
…: Machine Name needs further clarification

(cherry picked from commit 0e336272b34944ee1259359f5783093b237326d7)
  • Loading branch information
xjm committed May 3, 2020
1 parent 0586687 commit e26a568
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1868,7 +1868,7 @@ public function validateOptionsForm(&$form, FormStateInterface $form_state) {
case 'display_id':
if ($form_state->getValue('display_id')) {
if (preg_match('/[^a-z0-9_]/', $form_state->getValue('display_id'))) {
$form_state->setError($form['display_id'], $this->t('Display name must be letters, numbers, or underscores only.'));
$form_state->setError($form['display_id'], $this->t('Display machine name must contain only lowercase letters, numbers, or underscores.'));
}

foreach ($this->view->displayHandlers as $id => $display) {
Expand Down
2 changes: 1 addition & 1 deletion modules/views_ui/tests/src/Functional/ViewEditTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function testOtherOptions() {

// Test the form validation with invalid IDs.
$machine_name_edit_url = 'admin/structure/views/nojs/display/test_view/test_1/display_id';
$error_text = t('Display name must be letters, numbers, or underscores only.');
$error_text = t('Display machine name must contain only lowercase letters, numbers, or underscores.');

// Test that potential invalid display ID requests are detected
try {
Expand Down

0 comments on commit e26a568

Please sign in to comment.