Commit 3daf77ab authored by gbyte.co's avatar gbyte.co

Clean up a few classes

parent a3228b48
......@@ -38,7 +38,7 @@ function simple_sitemap_form_alter(&$form, $form_state, $form_id) {
$form['#attached']['library'][] = 'simple_sitemap/fieldsetSummaries';
}
$f->displayEntitySettings($form['simple_sitemap']);
$f->displayRegenerateNow($form['simple_sitemap']);
$f->displayRegenerateNow($form['simple_sitemap']); // todo: do not show setting when creating new bundle
// Add submission handler.
if (isset($form['actions']['submit']['#submit'])) {
......
......@@ -238,8 +238,7 @@ class Batch {
self::registerError(self::PATH_DOES_NOT_EXIST_OR_NO_ACCESS, ['@faulty_path' => $custom_path['path']], 'warning');
continue;
}
$options = ['absolute' => TRUE, 'language' => $languages[Simplesitemap::getDefaultLangId()]];
$url_object = Url::fromUserInput($custom_path['path'], $options);
$url_object = Url::fromUserInput($custom_path['path'], ['absolute' => TRUE]);
if (!$url_object->access($anon_user))
continue;
......
......@@ -362,10 +362,6 @@ class Simplesitemap {
return FALSE;
}
public static function getDefaultLangId() {
return \Drupal::languageManager()->getDefaultLanguage()->getId();
}
/**
* Returns objects of entity types that can be indexed by the sitemap.
*
......
......@@ -157,7 +157,7 @@ class SitemapGenerator {
* @return string sitemap chunk
*/
private static function generateSitemapChunk($links) {
$default_language_id = Simplesitemap::getDefaultLangId();
$default_language_id = \Drupal::languageManager()->getDefaultLanguage()->getId();
$writer = new XMLWriter();
$writer->openMemory();
......
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