Commit 52db265b authored by neclimdul's avatar neclimdul Committed by pifagor

Issue #3117561 by phoang, piyuesh23, neclimdul, ilgnerfagundes: Update the path_alias table

parent 534177b1
......@@ -160,8 +160,8 @@ class XmlSitemapGenerator implements XmlSitemapGeneratorInterface {
* {@inheritdoc}
*/
public function getPathAlias($path, $language) {
$query = $this->connection->select('url_alias', 'u');
$query->fields('u', ['source', 'alias']);
$query = $this->connection->select('path_alias', 'u');
$query->fields('u', ['path', 'alias']);
if (!isset(static::$aliases)) {
$query->condition('langcode', LanguageInterface::LANGCODE_NOT_SPECIFIED, '=');
static::$aliases[LanguageInterface::LANGCODE_NOT_SPECIFIED] = $query->execute()->fetchAllKeyed();
......@@ -169,7 +169,7 @@ class XmlSitemapGenerator implements XmlSitemapGeneratorInterface {
if ($language !== LanguageInterface::LANGCODE_NOT_SPECIFIED && static::$lastLanguage != $language) {
unset(static::$aliases[static::$lastLanguage]);
$query->condition('langcode', $language, '=');
$query->orderBy('pid');
$query->orderBy('id');
static::$aliases[$language] = $query->execute()->fetchAllKeyed();
static::$lastLanguage = $language;
}
......@@ -224,7 +224,7 @@ class XmlSitemapGenerator implements XmlSitemapGeneratorInterface {
// Add memory for storing the url aliases.
if ($this->config->get('prefetch_aliases')) {
$aliases = $this->connection->query("SELECT COUNT(pid) FROM {url_alias}")->fetchField();
$aliases = $this->connection->query("SELECT COUNT(id) FROM {path_alias}")->fetchField();
$optimal_limit += $aliases * 250;
}
}
......
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