Commit 84f56b3f authored by John Fiala's avatar John Fiala
Browse files

Issue #1889918 by jcfiala,Boobaa:Changed the bad url error message to include the field's label.

parent 26a2ba35
......@@ -383,7 +383,7 @@ function _link_validate(&$item, $delta, $field, $entity, $instance, $langcode, &
&& !$instance['required'])) {
// Validate the link.
if (link_validate_url(trim($item['url'])) == FALSE) {
form_set_error($field['field_name'] . '][' . $langcode . ']['. $delta .'][url', t('Not a valid URL.'));
form_set_error($field['field_name'] . '][' . $langcode . ']['. $delta .'][url', t('The value provided for %field is not a valid URL.', array('%field' => $instance['label'])));
}
// Require a title for the link if necessary.
if ($instance['settings']['title'] == 'required' && strlen(trim($item['title'])) == 0) {
......
......@@ -135,7 +135,7 @@ class LinkUITest extends DrupalWebTestcase {
);
$this->drupalPost(NULL, $edit, t('Save'));
if ($input['type'] == self::LINK_INPUT_TYPE_BAD_URL) {
$this->assertRaw(t('Not a valid URL.'), 'Not a valid URL: ' . $input['href']);
$this->assertRaw(t('The value provided for %field is not a valid URL.', array('%field' => $name)), 'Not a valid URL: ' . $input['href']);
continue;
}
else {
......
......@@ -104,7 +104,7 @@ class LinkValidateTest extends LinkValidateTestCase {
);
$this->drupalPost(NULL, $edit, t('Save'));
$this->assertText(t('Not a valid URL.'));
$this->assertText(t('The value provided for @field is not a valid URL.', array('@field' => $name)));
}
/**
......@@ -149,7 +149,7 @@ class LinkValidateTest extends LinkValidateTestCase {
);
$this->drupalPost(NULL, $edit, t('Save'));
$this->assertText(t('Not a valid URL.'));
$this->assertText(t('The value provided for @field is not a valid URL.', array('@field' => $name)));
}
......@@ -199,8 +199,7 @@ class LinkValidateTest extends LinkValidateTestCase {
);
$this->drupalPost(NULL, $edit, t('Save'));
$this->assertNoText(t('Not a valid URL.'));
$this->assertNoText(t('The value provided for @field is not a valid URL.', array('@field' => $name)));
}
/**
......@@ -242,7 +241,7 @@ class LinkValidateTest extends LinkValidateTestCase {
$this->drupalPost('node/'. $this->nodes[0]->nid .'/edit', $edit, t('Save'));
//$this->pass($this->content);
$this->assertNoText(t('Not a valid URL.'));
$this->assertNoText(t('The value provided for %field is not a valid URL.', array('%field' => $name)));
// Make sure we get a new version!
$node = node_load($this->nodes[0]->nid, NULL, TRUE);
......
Supports Markdown
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