Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
S
simple_sitemap
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
3
Merge Requests
3
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
simple_sitemap
Commits
f77dc999
Commit
f77dc999
authored
Nov 11, 2016
by
Pawel G
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2826556
by chr.fritsch: Schema issues introduced
parent
6e434723
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
18 deletions
+33
-18
config/install/simple_sitemap.custom.yml
config/install/simple_sitemap.custom.yml
+4
-3
config/schema/simple_sitemap.schema.yml
config/schema/simple_sitemap.schema.yml
+13
-9
simple_sitemap.install
simple_sitemap.install
+10
-0
src/Simplesitemap.php
src/Simplesitemap.php
+4
-5
src/Tests/SimplesitemapTest.php
src/Tests/SimplesitemapTest.php
+2
-1
No files found.
config/install/simple_sitemap.custom.yml
View file @
f77dc999
-
path
:
/
priority
:
'
1.0'
links
:
-
path
:
'
/'
priority
:
'
1.0'
config/schema/simple_sitemap.schema.yml
View file @
f77dc999
...
...
@@ -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
simple_sitemap.install
View file @
f77dc999
...
...
@@ -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
();
}
src/Simplesitemap.php
View file @
f77dc999
...
...
@@ -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"
)
->
set
Data
(
$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"
)
->
set
Data
(
$custom_links
)
->
save
();
->
set
(
'links'
,
$custom_links
)
->
save
();
break
;
}
}
...
...
@@ -462,7 +461,7 @@ class Simplesitemap {
*/
public
function
removeCustomLinks
()
{
$this
->
configFactory
->
getEditable
(
"simple_sitemap.custom"
)
->
set
Data
(
[])
->
save
();
->
set
(
'links'
,
[])
->
save
();
return
$this
;
}
...
...
src/Tests/SimplesitemapTest.php
View file @
f77dc999
...
...
@@ -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().
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment