Issue #86461 by ergonlogic, davidjdagino, marcingy, emclaughlin, Bakus: Truncate long paths and path aliases on admin/build/path.
parent
4beaeab9fe
commit
263c6802b9
|
@ -42,8 +42,13 @@ function path_admin_overview($keys = NULL) {
|
|||
$destination = drupal_get_destination();
|
||||
foreach ($result as $data) {
|
||||
$row = array();
|
||||
$row['data']['alias'] = l($data->alias, $data->source);
|
||||
$row['data']['source'] = l($data->source, $data->source, array('alias' => TRUE));
|
||||
$row['data']['alias'] = l(truncate_utf8($data->alias, 50, FALSE, TRUE), $data->source, array(
|
||||
'attributes' => array('title' => $data->alias),
|
||||
));
|
||||
$row['data']['source'] = l(truncate_utf8($data->source, 50, FALSE, TRUE), $data->source, array(
|
||||
'alias' => TRUE,
|
||||
'attributes' => array('title' => $data->source),
|
||||
));
|
||||
if ($multilanguage) {
|
||||
$row['data']['language_name'] = language_name($data->langcode);
|
||||
}
|
||||
|
|
|
@ -128,6 +128,18 @@ class PathAliasTestCase extends PathTestCase {
|
|||
$this->drupalGet($edit['alias']);
|
||||
$this->assertNoText($node1->title, 'Alias was successfully deleted.');
|
||||
$this->assertResponse(404);
|
||||
|
||||
// Create a really long alias.
|
||||
$edit = array();
|
||||
$edit['source'] = 'node/' . $node1->nid;
|
||||
$alias = $this->randomName(128);
|
||||
$edit['alias'] = $alias;
|
||||
// The alias is shortened to 50 characters counting the elipsis.
|
||||
$truncated_alias = substr($alias, 0, 47);
|
||||
$this->drupalPost('admin/config/search/path/add', $edit, t('Save'));
|
||||
$this->assertNoText($alias, 'The untruncated alias was not found.');
|
||||
// The 'truncated' alias will always be found.
|
||||
$this->assertText($truncated_alias, 'The truncated alias was found.');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue