Commit fa2b7196 authored by webchick's avatar webchick

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

parent 71ee49de
......@@ -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.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment