Skip to content
Snippets Groups Projects
Commit fa2b7196 authored by Angie Byron's avatar Angie Byron
Browse files

#678536 by jhodgdon: Improve error message when adding forum topic directly to container.

parent 71ee49de
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -286,7 +286,7 @@ function forum_node_validate($node, $form) {
':vid' => $term->vid,
))->fetchField();
if ($used && in_array($term->tid, $containers)) {
form_set_error('taxonomy_forums', t('The item %forum is only a forum container. Select one of the forums below it.', array('%forum' => $term->name)));
form_set_error('taxonomy_forums', t('The item %forum is a forum container, not a forum. Select one of the forums below instead.', array('%forum' => $term->name)));
}
}
}
......
......@@ -281,12 +281,12 @@ class ForumTestCase extends DrupalWebTestCase {
$type = t('Forum topic');
if ($container) {
$this->assertNoRaw(t('@type %title has been created.', array('@type' => $type, '%title' => $title)), t('Forum topic was not created'));
$this->assertRaw(t('The item %title is only a forum container.', array('%title' => $forum['name'])), t('Error message was shown'));
$this->assertRaw(t('The item %title is a forum container, not a forum.', array('%title' => $forum['name'])), t('Error message was shown'));
return;
}
else {
$this->assertRaw(t('@type %title has been created.', array('%title' => $title, '@type' => $type)), t('Forum topic was created'));
$this->assertNoRaw(t('The item %title is only a forum container.', array('%title' => $forum['name'])), t('No error message was shown'));
$this->assertNoRaw(t('The item %title is a forum container, not a forum.', array('%title' => $forum['name'])), t('No error message was shown'));
}
// Retrieve node object.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment