1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-25 23:56:41 +02:00

Various updates primarily aimed at simplifying the check for presence of LanguageSupportPageNames module

This commit is contained in:
Ryan Cramer
2021-10-04 11:13:25 -04:00
parent f61feb56fd
commit 3cf1ba5cab
18 changed files with 173 additions and 113 deletions

View File

@@ -2586,8 +2586,7 @@ class PageFinder extends Wire {
}
}
if($langNames) {
/** @var LanguageSupportPageNames $module */
$module = $modules->getModule('LanguageSupportPageNames');
$module = $this->languages->pageNames();
if($module) $selectorValue = $module->updatePath($selectorValue);
}
$parts = explode('/', rtrim($selectorValue, '/'));
@@ -3369,8 +3368,8 @@ class PageFinder extends Wire {
*/
protected function supportsLanguagePageNames() {
if($this->supportsLanguagePageNames === null) {
$modules = $this->wire()->modules;
$this->supportsLanguagePageNames = $this->languages && $modules->isInstalled('LanguageSupportPageNames');
$languages = $this->languages;
$this->supportsLanguagePageNames = $languages && $languages->hasPageNames();
}
return $this->supportsLanguagePageNames;
}