Commit e110e4ad authored by andrei.dincu's avatar andrei.dincu

Issue #2249723 by andrei.dincu: Set context as array in .install file

parent cd0ef70d
......@@ -357,7 +357,7 @@ function xmlsitemap_install() {
$sitemap = \Drupal::entityManager()->getStorage('xmlsitemap')->create(array(
'id' => xmlsitemap_sitemap_get_context_hash($context),
));
$sitemap = $sitemap->setContext(serialize($context));
$sitemap = $sitemap->setContext($context);
$sitemap = $sitemap->setLabel(\Drupal::state()->get('base_url'));
$sitemap->save();
\Drupal::state()->setMultiple(array(
......
......@@ -394,7 +394,8 @@ function xmlsitemap_sitemap_load_multiple($smids = array(), array $conditions =
return array();
}
foreach ($sitemaps as &$sitemap) {
$sitemap->setContext(unserialize($sitemap->getContext()));
$sitemap->setContext($sitemap->getContext());
//$sitemap->setContext(unserialize($sitemap->getContext()));
$uri = xmlsitemap_sitemap_uri($sitemap);
$sitemap->setContext(serialize($sitemap->getContext()));
$sitemap->uri = $uri;
......@@ -1071,7 +1072,7 @@ function xmlsitemap_link_bundle_settings_save($entity, $bundle, array $settings,
\Drupal::config('xmlsitemap.settings')->set("xmlsitemap_settings_{$entity}_{$bundle}", $settings);
\Drupal::config('xmlsitemap.settings')->save();
foreach (\Drupal::languageManager()->getLanguages() as $lang) {
\Drupal::cache()->delete('xmlsitemap:link_info:' . $lang->getId());
\Drupal::cache()->delete('xmlsitemap:link_info:' . $lang->getId());
}
\Drupal::cache()->deleteAll();
//cache_clear_all('xmlsitemap:link_info:', 'cache', TRUE);
......@@ -1740,7 +1741,6 @@ function xmlsitemap_user_create_link(UserInterface &$account) {
return $account->xmlsitemap;
}
/**
* Implements hook_form_FORM_ID_alter().
*
......@@ -1753,7 +1753,6 @@ function xmlsitemap_form_user_form_alter(&$form, $form_state) {
xmlsitemap_add_form_link_options($form, 'user', 'user', \Drupal::currentUser()->id());
}
/**
* Implements hook_form_FORM_ID_alter().
*
......
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