Commit 263c6802 authored by catch's avatar catch

Issue #86461 by ergonlogic, davidjdagino, marcingy, emclaughlin, Bakus:...

Issue #86461 by ergonlogic, davidjdagino, marcingy, emclaughlin, Bakus: Truncate long paths and path aliases on admin/build/path.
parent 4beaeab9
......@@ -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.');
}
/**
......
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