// Now fetch the aliases corresponding to these system paths.
// We order by ASC and overwrite array keys to ensure the correct
// alias is used when there are multiple aliases per path.
$cache['map'][$path_language]=db_query("SELECT source, alias FROM {url_alias} WHERE source IN (:system) AND language IN (:language, '') ORDER BY language ASC, pid ASC",array(
$cache['map'][$path_language]=db_query("SELECT source, alias FROM {url_alias} WHERE source IN (:system) AND language IN (:language, :language_none) ORDER BY language ASC, pid ASC",array(
':system'=>$cache['system_paths'],
':language'=>$path_language
':language'=>$path_language,
':language_none'=>LANGUAGE_NONE,
))->fetchAllKeyed();
// Keep a record of paths with no alias to avoid querying twice.
// Get the most fitting result falling back with alias without language
$alias=db_query("SELECT alias FROM {url_alias} WHERE source = :source AND language IN (:language, '') ORDER BY language DESC, pid DESC",array(
$alias=db_query("SELECT alias FROM {url_alias} WHERE source = :source AND language IN (:language, :language_none) ORDER BY language DESC, pid DESC",array(
// Get the most fitting result falling back with alias without language
if($source=db_query("SELECT source FROM {url_alias} WHERE alias = :alias AND language IN (:language, '') ORDER BY language DESC, pid DESC",array(
if($source=db_query("SELECT source FROM {url_alias} WHERE alias = :alias AND language IN (:language, :language_none) ORDER BY language DESC, pid DESC",array(
':alias'=>$path,
':language'=>$path_language))
':language'=>$path_language,
':language_none'=>LANGUAGE_NONE))
->fetchField()){
$cache['map'][$path_language][$source]=$path;
}
...
...
@@ -186,7 +189,7 @@ function drupal_cache_system_paths() {
* An aliased path if one was found, or the original path if no alias was
'#markup'=>'<p>'.t('%title is part of a book outline, and has associated child pages. If you proceed with deletion, the child pages will be relocated automatically.',array('%title'=>$node->title[FIELD_LANGUAGE_NONE][0]['value'])).'</p>',
'#markup'=>'<p>'.t('%title is part of a book outline, and has associated child pages. If you proceed with deletion, the child pages will be relocated automatically.',array('%title'=>$node->title[LANGUAGE_NONE][0]['value'])).'</p>',
'#weight'=>-10,
);
}
...
...
@@ -1129,7 +1129,7 @@ function book_node_export($node, $children = '') {
$description=t('%title has associated child pages, which will be relocated automatically to maintain their connection to the book. To recreate the hierarchy (as it was before removing this page), %title may be added again using the Outline tab, and each of its former child pages will need to be relocated manually.',$title);
@@ -110,7 +110,7 @@ class BookTestCase extends DrupalWebTestCase {
// Check previous, up, and next links.
if($previous){
$this->assertRaw(l('‹ '.$previous->title[FIELD_LANGUAGE_NONE][0]['value'],'node/'.$previous->nid,array('attributes'=>array('class'=>array('page-previous'),'title'=>t('Go to previous page')))),t('Previous page link found.'));
$this->assertRaw(l('‹ '.$previous->title[LANGUAGE_NONE][0]['value'],'node/'.$previous->nid,array('attributes'=>array('class'=>array('page-previous'),'title'=>t('Go to previous page')))),t('Previous page link found.'));
}
if($up){
...
...
@@ -118,7 +118,7 @@ class BookTestCase extends DrupalWebTestCase {
}
if($next){
$this->assertRaw(l($next->title[FIELD_LANGUAGE_NONE][0]['value'].' ›','node/'.$next->nid,array('attributes'=>array('class'=>array('page-next'),'title'=>t('Go to next page')))),t('Next page link found.'));
$this->assertRaw(l($next->title[LANGUAGE_NONE][0]['value'].' ›','node/'.$next->nid,array('attributes'=>array('class'=>array('page-next'),'title'=>t('Go to next page')))),t('Next page link found.'));
}
// Compute the expected breadcrumb.
...
...
@@ -140,8 +140,8 @@ class BookTestCase extends DrupalWebTestCase {
// Check printer friendly version.
$this->drupalGet('book/export/html/'.$node->nid);
$this->assertText($node->title[FIELD_LANGUAGE_NONE][0]['value'],t('Printer friendly title found.'));
$this->assertRaw(check_markup($node->body[FIELD_LANGUAGE_NONE][0]['value'],$node->body[FIELD_LANGUAGE_NONE][0]['format']),t('Printer friendly body found.'));
$this->assertText($node->title[LANGUAGE_NONE][0]['value'],t('Printer friendly title found.'));
$this->assertRaw(check_markup($node->body[LANGUAGE_NONE][0]['value'],$node->body[LANGUAGE_NONE][0]['format']),t('Printer friendly body found.'));
$number++;
}
...
...
@@ -154,7 +154,7 @@ class BookTestCase extends DrupalWebTestCase {