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

Issue #2249723 by andrei.dincu: Save xmlsitemap_settings_entity_bundle...

Issue #2249723 by andrei.dincu: Save xmlsitemap_settings_entity_bundle variables in the state system
parent b6e87a97
......@@ -1061,8 +1061,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();
\Drupal::state()->set("xmlsitemap_settings_{$entity}_{$bundle}", $settings);
foreach (\Drupal::languageManager()->getLanguages() as $lang) {
\Drupal::cache()->delete('xmlsitemap:link_info:' . $lang->getId());
}
......@@ -1074,7 +1073,7 @@ function xmlsitemap_link_bundle_settings_save($entity, $bundle, array $settings,
function xmlsitemap_link_bundle_rename($entity, $bundle_old, $bundle_new) {
if ($bundle_old != $bundle_new) {
$settings = xmlsitemap_link_bundle_load($entity, $bundle_old);
\Drupal::config('xmlsitemap.settings')->clear("xmlsitemap_settings_{$entity}_{$bundle_old}");
\Drupal::state()->delete("xmlsitemap_settings_{$entity}_{$bundle_old}");
xmlsitemap_link_bundle_settings_save($entity, $bundle_new, $settings, FALSE);
xmlsitemap_link_update_multiple(array('subtype' => $bundle_new), array('type' => $entity, 'subtype' => $bundle_old));
}
......@@ -1109,7 +1108,7 @@ function xmlsitemap_link_bundle_load($entity, $bundle, $load_bundle_info = TRUE)
$info['info'] = $entity_info['bundles'][$bundle];
}
}
//$info += \Drupal::config('xmlsitemap.settings')->get("xmlsitemap_settings_{$entity}_{$bundle}");
$info += \Drupal::state()->get("xmlsitemap_settings_{$entity}_{$bundle}", array());
$info += array(
'status' => XMLSITEMAP_STATUS_DEFAULT,
'priority' => XMLSITEMAP_PRIORITY_DEFAULT,
......@@ -1118,7 +1117,7 @@ function xmlsitemap_link_bundle_load($entity, $bundle, $load_bundle_info = TRUE)
}
function xmlsitemap_link_bundle_delete($entity, $bundle, $delete_links = TRUE) {
\Drupal::config('xmlsitemap.settings')->clear("xmlsitemap_settings_{$entity}_{$bundle}");
\Drupal::state()->delete("xmlsitemap_settings_{$entity}_{$bundle}");
if ($delete_links) {
xmlsitemap_link_delete_multiple(array('type' => $entity, 'subtype' => $bundle));
}
......
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