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
1
Merge Requests
1
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
b712dfe9
Commit
b712dfe9
authored
Sep 17, 2018
by
Pawel G
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix generating different bundles of one entity type
parent
44a75bbd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
src/Plugin/simple_sitemap/UrlGenerator/EntityUrlGenerator.php
...Plugin/simple_sitemap/UrlGenerator/EntityUrlGenerator.php
+7
-8
No files found.
src/Plugin/simple_sitemap/UrlGenerator/EntityUrlGenerator.php
View file @
b712dfe9
...
...
@@ -111,12 +111,11 @@ class EntityUrlGenerator extends UrlGeneratorBase {
}
}
$entityTypeQuery
=
$this
->
entityTypeManager
->
getStorage
(
$entity_type_name
)
->
getQuery
();
$entityTypeStorage
=
$this
->
entityTypeManager
->
getStorage
(
$entity_type_name
);
$keys
=
$sitemap_entity_types
[
$entity_type_name
]
->
getKeys
();
foreach
(
$bundles
as
$bundle_name
=>
$bundle_settings
)
{
$bundleQuery
=
$entityTypeQuery
;
// Skip this bundle if it is to be generated in a different sitemap variant.
if
(
NULL
!==
$this
->
sitemapVariant
&&
isset
(
$bundle_settings
[
'variant'
])
&&
$bundle_settings
[
'variant'
]
!==
$this
->
sitemapVariant
)
{
...
...
@@ -132,19 +131,19 @@ class EntityUrlGenerator extends UrlGeneratorBase {
$this
->
moduleHandler
->
alter
(
'simple_sitemap_bundle_settings'
,
$bundle_settings
,
$bundle_context
,
$sitemap_variant
);
if
(
!
empty
(
$bundle_settings
[
'index'
]))
{
$query
=
$entityTypeStorage
->
getQuery
();
$keys
=
$sitemap_entity_types
[
$entity_type_name
]
->
getKeys
();
if
(
empty
(
$keys
[
'id'
]))
{
$
bundleQ
uery
->
sort
(
$keys
[
'id'
],
'ASC'
);
$
q
uery
->
sort
(
$keys
[
'id'
],
'ASC'
);
}
if
(
!
empty
(
$keys
[
'bundle'
]))
{
$
bundleQ
uery
->
condition
(
$keys
[
'bundle'
],
$bundle_name
);
$
q
uery
->
condition
(
$keys
[
'bundle'
],
$bundle_name
);
}
if
(
!
empty
(
$keys
[
'status'
]))
{
$
bundleQ
uery
->
condition
(
$keys
[
'status'
],
1
);
$
q
uery
->
condition
(
$keys
[
'status'
],
1
);
}
foreach
(
$
bundleQ
uery
->
execute
()
as
$entity_id
)
{
foreach
(
$
q
uery
->
execute
()
as
$entity_id
)
{
$data_sets
[]
=
[
'entity_type'
=>
$entity_type_name
,
'id'
=>
$entity_id
,
...
...
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