Commit f77dc999 authored by gbyte.co's avatar gbyte.co

Issue #2826556 by chr.fritsch: Schema issues introduced

parent 6e434723
-
path: /
priority: '1.0'
links:
-
path: '/'
priority: '1.0'
......@@ -36,12 +36,16 @@ simple_sitemap.bundle_settings.*.*:
simple_sitemap.custom:
label: 'Custom links'
type: config_object
sequence:
type: mapping
mapping:
path:
label: 'Path'
type: string
priority:
label: 'Priority'
type: string
mapping:
links:
type: sequence
label: 'Custom links'
sequence:
type: mapping
mapping:
path:
label: 'Path'
type: string
priority:
label: 'Priority'
type: string
......@@ -273,3 +273,13 @@ function simple_sitemap_update_8205() {
->getEditable('simple_sitemap.entity_types')
->delete();
}
/**
* Placing custom links in a subkey of simple_sitemap.custom configuration.
*/
function simple_sitemap_update_8206() {
$custom_links = \Drupal::config('simple_sitemap.custom')->get();
unset($custom_links['_core']);
\Drupal::service('config.factory')->getEditable("simple_sitemap.custom")
->setData(['links' => $custom_links])->save();
}
......@@ -380,7 +380,7 @@ class Simplesitemap {
$custom_links[$link_key]['path'] = $path;
$this->addLinkSettings('custom', $settings, $custom_links[$link_key]); //todo: dirty
$this->configFactory->getEditable("simple_sitemap.custom")
->setData($custom_links)->save();
->set('links', $custom_links)->save();
return $this;
}
......@@ -413,8 +413,7 @@ class Simplesitemap {
public function getCustomLinks() {
$custom_links = $this->configFactory
->get('simple_sitemap.custom')
->get();
unset($custom_links['_core']);
->get('links');
return $custom_links;
}
......@@ -448,7 +447,7 @@ class Simplesitemap {
unset($custom_links[$key]);
$custom_links = array_values($custom_links);
$this->configFactory->getEditable("simple_sitemap.custom")
->setData($custom_links)->save();
->set('links', $custom_links)->save();
break;
}
}
......@@ -462,7 +461,7 @@ class Simplesitemap {
*/
public function removeCustomLinks() {
$this->configFactory->getEditable("simple_sitemap.custom")
->setData([])->save();
->set('links', [])->save();
return $this;
}
......
......@@ -26,7 +26,8 @@ class SimplesitemapTest extends WebTestBase {
protected $node2;
protected $privilegedUser;
protected $strictConfigSchema = FALSE; //todo: Fix schema and remove variable
// Uncomment to disable strict schema checks.
// protected $strictConfigSchema = FALSE;
/**
* Implements setup().
......
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