1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-16 11:44:42 +02:00

Fix issue processwire/processwire-issues#1225 plus some other small upgrades to the FieldsTableTools notices

This commit is contained in:
Ryan Cramer
2020-08-20 10:02:16 -04:00
parent 9e9cc31051
commit 0dda488739
3 changed files with 14 additions and 16 deletions

View File

@@ -294,8 +294,8 @@ class PagesNames extends Wire {
$format = empty($options['format']) ? '' : $options['format'];
}
/** @var Languages|null $languages */
$languages = $this->wire('languages');
$languages = $this->wire()->languages;
$sanitizer = $this->wire()->sanitizer;
$options = array_merge($defaults, $options);
if(!strlen($format)) $format = $this->defaultPageNameFormat($page);
@@ -354,7 +354,7 @@ class PagesNames extends Wire {
$name = wireDate($format);
$formatType = 'date';
} else if($this->wire('sanitizer')->fieldName($format) === $format) {
} else if($sanitizer->fieldName($format) === $format) {
// single field name or predefined string
// this can also return null, which falls back to if() statement below
$name = (string) $page->getUnformatted($format);
@@ -395,8 +395,7 @@ class PagesNames extends Wire {
if(strlen($name) > $this->nameMaxLength) $name = $this->adjustNameLength($name);
$utf8 = $this->wire('config')->pageNameCharset === 'UTF8';
$sanitizer = $this->wire('sanitizer');
$utf8 = $this->wire()->config->pageNameCharset === 'UTF8';
$name = $utf8 ? $sanitizer->pageNameUTF8($name) : $sanitizer->pageName($name, Sanitizer::translate);
if($language) $languages->unsetLanguage();