Skip to content
Snippets Groups Projects
Commit 263c6802 authored by catch's avatar catch
Browse files

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
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
...@@ -42,8 +42,13 @@ function path_admin_overview($keys = NULL) { ...@@ -42,8 +42,13 @@ function path_admin_overview($keys = NULL) {
$destination = drupal_get_destination(); $destination = drupal_get_destination();
foreach ($result as $data) { foreach ($result as $data) {
$row = array(); $row = array();
$row['data']['alias'] = l($data->alias, $data->source); $row['data']['alias'] = l(truncate_utf8($data->alias, 50, FALSE, TRUE), $data->source, array(
$row['data']['source'] = l($data->source, $data->source, array('alias' => TRUE)); '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) { if ($multilanguage) {
$row['data']['language_name'] = language_name($data->langcode); $row['data']['language_name'] = language_name($data->langcode);
} }
......
...@@ -128,6 +128,18 @@ class PathAliasTestCase extends PathTestCase { ...@@ -128,6 +128,18 @@ class PathAliasTestCase extends PathTestCase {
$this->drupalGet($edit['alias']); $this->drupalGet($edit['alias']);
$this->assertNoText($node1->title, 'Alias was successfully deleted.'); $this->assertNoText($node1->title, 'Alias was successfully deleted.');
$this->assertResponse(404); $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.');
} }
/** /**
......
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