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
6e434723
Commit
6e434723
authored
Nov 10, 2016
by
Pawel G
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2816023
: Unpublished translations are appearing in sitemap
parent
1c231627
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
19 deletions
+19
-19
src/Batch/BatchUrlGenerator.php
src/Batch/BatchUrlGenerator.php
+19
-19
No files found.
src/Batch/BatchUrlGenerator.php
View file @
6e434723
...
...
@@ -130,11 +130,6 @@ class BatchUrlGenerator {
continue
;
}
// Do not include paths inaccessible to anonymous users.
if
(
!
$url_object
->
access
(
$this
->
anonUser
))
{
continue
;
}
$path
=
$url_object
->
getInternalPath
();
// Do not include paths that have been already indexed.
...
...
@@ -180,10 +175,6 @@ class BatchUrlGenerator {
}
$url_object
=
Url
::
fromUserInput
(
$custom_path
[
'path'
],
[
'absolute'
=>
TRUE
]);
if
(
!
$url_object
->
access
(
$this
->
anonUser
))
{
continue
;
}
$path
=
$url_object
->
getInternalPath
();
if
(
$this
->
batchInfo
[
'remove_duplicates'
]
&&
$this
->
pathProcessed
(
$path
))
{
continue
;
...
...
@@ -283,22 +274,31 @@ class BatchUrlGenerator {
$translation_languages
=
!
is_null
(
$entity
)
&&
$this
->
batchInfo
[
'skip_untranslated'
]
?
$entity
->
getTranslationLanguages
()
:
$this
->
languages
;
// Entity is not translated.
if
(
!
is_null
(
$entity
)
&&
isset
(
$translation_languages
[
'und'
]))
{
$alternate_urls
[
$this
->
defaultLanguageId
]
=
$url_object
->
setOption
(
'language'
,
$this
->
languages
[
$this
->
defaultLanguageId
])
->
toString
();
if
(
$url_object
->
access
(
$this
->
anonUser
))
{
$url_object
->
setOption
(
'language'
,
$this
->
languages
[
$this
->
defaultLanguageId
]);
$alternate_urls
[
$this
->
defaultLanguageId
]
=
$url_object
->
toString
();
}
}
else
{
foreach
(
$translation_languages
as
$language
)
{
if
(
!
is_null
(
$entity
)
&&
$this
->
batchInfo
[
'skip_untranslated'
])
{
// Including only translated variants of entity.
if
(
!
is_null
(
$entity
)
&&
$this
->
batchInfo
[
'skip_untranslated'
])
{
foreach
(
$translation_languages
as
$language
)
{
$translation
=
$entity
->
getTranslation
(
$language
->
getId
());
if
(
!
$translation
->
access
(
'view'
))
{
continue
;
if
(
$translation
->
access
(
'view'
,
$this
->
anonUser
))
{
$url_object
->
setOption
(
'language'
,
$language
);
$alternate_urls
[
$language
->
getId
()]
=
$url_object
->
toString
();
}
}
$alternate_urls
[
$language
->
getId
()]
=
$url_object
->
setOption
(
'language'
,
$language
)
->
toString
();
}
// Not an entity or including all untranslated variants.
elseif
(
$url_object
->
access
(
$this
->
anonUser
))
{
foreach
(
$translation_languages
as
$language
)
{
$url_object
->
setOption
(
'language'
,
$language
);
$alternate_urls
[
$language
->
getId
()]
=
$url_object
->
toString
();
}
}
}
...
...
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