Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
sg_jobs
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TYPO3
sg_jobs
Commits
e8b29c37
Commit
e8b29c37
authored
3 years ago
by
Georgi Mateev
Browse files
Options
Downloads
Patches
Plain Diff
[BUGFIX] Check rootline when generating sitemap
parent
2d714adf
No related branches found
No related tags found
1 merge request
!34
[BUGFIX] Check rootline when generating sitemap
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Classes/Event/Listener/AccessPageListEventListener.php
+4
-1
4 additions, 1 deletion
Classes/Event/Listener/AccessPageListEventListener.php
Classes/Service/SitemapService.php
+6
-3
6 additions, 3 deletions
Classes/Service/SitemapService.php
with
10 additions
and
4 deletions
Classes/Event/Listener/AccessPageListEventListener.php
+
4
−
1
View file @
e8b29c37
...
...
@@ -31,7 +31,10 @@ class AccessPageListEventListener {
*/
public
function
__invoke
(
AccessPageListEvent
$event
)
{
$pageList
=
$event
->
getPageList
();
$additionalPageList
=
$this
->
sitemapService
->
generatePagesList
(
$event
->
getSysLanguageUid
());
$additionalPageList
=
$this
->
sitemapService
->
generatePagesList
(
$event
->
getSysLanguageUid
(),
$event
->
getSite
()
->
getRootPageId
()
);
ArrayUtility
::
mergeRecursiveWithOverrule
(
$pageList
,
$additionalPageList
);
$event
->
setPageList
(
$pageList
);
}
...
...
This diff is collapsed.
Click to expand it.
Classes/Service/SitemapService.php
+
6
−
3
View file @
e8b29c37
...
...
@@ -28,9 +28,10 @@ class SitemapService {
* Generate a pageList array for the sitemap generation
*
* @param int $sysLanguageUid
* @param int $rootPageId
* @return array
*/
public
function
generatePagesList
(
int
$sysLanguageUid
):
array
{
public
function
generatePagesList
(
int
$sysLanguageUid
,
int
$rootPageId
=
0
):
array
{
$pageList
=
[];
// find sites where job detail plugin is added
$queryBuilder
=
GeneralUtility
::
makeInstance
(
ConnectionPool
::
class
)
...
...
@@ -55,11 +56,13 @@ class SitemapService {
)
->
execute
();
$rows
=
$databaseResource
->
fetchAll
();
$context
=
GeneralUtility
::
makeInstance
(
Context
::
class
);
foreach
(
$rows
as
$row
)
{
while
(
$row
=
$databaseResource
->
fetch
()
)
{
try
{
$site
=
GeneralUtility
::
makeInstance
(
SiteFinder
::
class
)
->
getSiteByPageId
(
$row
[
'pid'
]);
if
(
$rootPageId
>
0
&&
$site
->
getRootPageId
()
!==
$rootPageId
)
{
continue
;
}
$jobs
=
$this
->
getJobsByPid
(
$row
[
'pages'
],
$sysLanguageUid
);
foreach
(
$jobs
as
$job
)
{
$url
=
$site
->
getRouter
(
$context
)
->
generateUri
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment