Skip to content
Snippets Groups Projects
Commit a445a574 authored by Tim Steiner's avatar Tim Steiner
Browse files

Fix importing menu links that end with a trailing slash.

git-svn-id: file:///tmp/wdn_thm_drupal/branches/drupal-7.x@111 20a16fea-79d4-4915-8869-1ea9d5ebf173
parent a953290a
No related branches found
No related tags found
No related merge requests found
......@@ -209,6 +209,9 @@ class Unl_Migration_Tool
}
if ($fragmentPos = strrpos($path, '#') !== FALSE) {
$path = substr($path, 0, $fragmentPos);
}
if (substr($path, -1) == '/') {
$path = substr($path, 0, -1);
}
$nodeId = array_search($path, $this->_nodeMap, TRUE);
$item['link_path'] = 'node/' . $nodeId;
......@@ -239,9 +242,11 @@ class Unl_Migration_Tool
$path = '';
}
if (($fragmentPos = strrpos($path, '#')) !== FALSE) {
echo "strrpos() = $fragmentPos\n";
$path = substr($path, 0, $fragmentPos);
}
if (substr($path, -1) == '/') {
$path = substr($path, 0, -1);
}
$nodeId = array_search($path, $this->_nodeMap, TRUE);
$item['link_path'] = 'node/' . $nodeId;
echo '[' . $nodeId . '] => ' . $path . PHP_EOL;
......
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