diff --git a/src/AliasCleaner.php b/src/AliasCleaner.php --- a/src/AliasCleaner.php +++ b/src/AliasCleaner.php @@ -133,7 +133,7 @@ $config = $this->configFactory->get('pathauto.settings'); if (!isset($separator)) { - $separator = $config->get('separator'); + $separator = (string)$config->get('separator'); } $output = $string; @@ -170,7 +170,7 @@ // Generate and cache variables used in this method. $config = $this->configFactory->get('pathauto.settings'); $this->cleanStringCache = [ - 'separator' => $config->get('separator'), + 'separator' => (string)$config->get('separator'), 'strings' => [], 'transliterate' => $config->get('transliterate'), 'punctuation' => [], @@ -200,7 +200,7 @@ } // Generate and cache the ignored words regular expression. - $ignore_words = $config->get('ignore_words'); + $ignore_words = (string)$config->get('ignore_words'); $ignore_words_regex = preg_replace(['/^[,\s]+|[,\s]+$/', '/[,\s]+/'], ['', '\b|\b'], $ignore_words); if ($ignore_words_regex) { $this->cleanStringCache['ignore_words_regex'] = '\b' . $ignore_words_regex . '\b'; diff --git a/src/Form/PathautoSettingsForm.php b/src/Form/PathautoSettingsForm.php --- a/src/Form/PathautoSettingsForm.php +++ b/src/Form/PathautoSettingsForm.php @@ -150,7 +150,7 @@ $form['enabled_entity_types'][$entity_type_id] = [ '#type' => 'checkbox', '#title' => $entity_type->getLabel(), - '#default_value' => isset($field_definitions['path']) || in_array($entity_type_id, $config->get('enabled_entity_types')), + '#default_value' => isset($field_definitions['path']) || in_array($entity_type_id, (array)$config->get('enabled_entity_types')), '#disabled' => isset($field_definitions['path']) && ($field_definitions['path']->getProvider() != 'pathauto' || $patterns_count), ]; } @@ -252,7 +252,7 @@ $form['safe_tokens'] = [ '#type' => 'textarea', '#title' => $this->t('Safe tokens'), - '#default_value' => implode(', ', $config->get('safe_tokens')), + '#default_value' => implode(', ', (array)$config->get('safe_tokens')), '#description' => $this->t('List of tokens that are safe to use in alias patterns and do not need to be cleaned. For example urls, aliases, machine names. Separated with a comma.'), ];