Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
sg_news
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD 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_news
Commits
92d7a47d
Commit
92d7a47d
authored
6 years ago
by
Fabian Galinski
Browse files
Options
Downloads
Patches
Plain Diff
[BUGFIX] The previous duplicate news entries bugfix was just working for 66%
parent
fda21e41
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Classes/Controller/ListByCategoryController.php
+1
-1
1 addition, 1 deletion
Classes/Controller/ListByCategoryController.php
Classes/Controller/OverviewController.php
+3
-9
3 additions, 9 deletions
Classes/Controller/OverviewController.php
with
4 additions
and
10 deletions
Classes/Controller/ListByCategoryController.php
+
1
−
1
View file @
92d7a47d
...
...
@@ -102,7 +102,7 @@ class ListByCategoryController extends AbstractController {
$numberOfPages
=
(
$newsPerPage
<=
0
?
0
:
ceil
(
$newsCount
/
$newsPerPage
));
$headerSet
=
FALSE
;
$offset
=
$this
->
calculatePaginationOffset
(
$currentPageBrowserPage
);
$offset
=
$this
->
calculatePaginationOffset
(
$currentPageBrowserPage
,
$newsPerPage
);
$news
=
$this
->
newsRepository
->
findAllSortedNewsByCategories
(
$categoryUids
,
$newsPerPage
,
$offset
,
$this
->
settings
[
'sortBy'
],
$tagUids
,
$startTime
,
$endTime
...
...
This diff is collapsed.
Click to expand it.
Classes/Controller/OverviewController.php
+
3
−
9
View file @
92d7a47d
...
...
@@ -239,7 +239,7 @@ class OverviewController extends AbstractController {
$newsCount
=
$this
->
newsRepository
->
newsCountByCategories
(
$categoryIds
,
$tagIds
,
$startTime
,
$endTime
);
$numberOfPages
=
(
$newsLimitPerCategory
<=
0
?
0
:
ceil
(
$newsCount
/
$newsLimitPerCategory
));
// Redo this function, until one variable get the amount of newsLimitPerTag. Reduces the amount of ajax calls. Needed because of languagevisibility.
if
(
$maxNewsPerCategory
<
$newsLimitPerCategory
&&
count
(
$allNews
)
<
$newsLimitPerCategory
)
{
if
(
$maxNewsPerCategory
<
$newsLimitPerCategory
&&
\
count
(
$allNews
)
<
$newsLimitPerCategory
)
{
$nextPage
=
$currentPageBrowserPage
+
1
;
if
(
$nextPage
<=
$numberOfPages
)
{
$this
->
setPageBrowserPage
(
$nextPage
);
...
...
@@ -445,13 +445,11 @@ class OverviewController extends AbstractController {
$this
->
view
->
assign
(
'selectedTag'
,
$selectedTag
);
$this
->
view
->
assign
(
'selectedCategory'
,
$selectedCategory
);
$offset
=
$this
->
calculatePaginationOffset
(
$currentPageBrowserPage
);
$newsPerPage
=
(
int
)
$this
->
settings
[
'newsLimit'
];
$offset
=
$this
->
calculatePaginationOffset
(
$currentPageBrowserPage
,
$newsPerPage
);
$startTime
=
(
int
)
$this
->
settings
[
'starttime'
];
$endTime
=
(
int
)
$this
->
settings
[
'endtime'
];
if
(
$this
->
settings
[
'onlyNewsWithinThisPageSection'
])
{
/** @noinspection PhpUndefinedMethodInspection */
$categories
=
$this
->
categoryRepository
->
findByPid
(
$GLOBALS
[
'TSFE'
]
->
id
);
...
...
@@ -511,7 +509,7 @@ class OverviewController extends AbstractController {
$numberOfPages
=
(
$newsPerPage
<=
0
?
0
:
ceil
(
$newsCount
/
$newsPerPage
));
// Redo this function, until one variable get the amount of newsLimitPerTag. Reduces the amount of ajax calls. Needed because of languagevisibility.
if
(
count
(
$newsMetaData
)
<
$newsPerPage
)
{
if
(
\
count
(
$newsMetaData
)
<
(
$newsPerPage
-
1
)
)
{
$nextPage
=
$currentPageBrowserPage
+
1
;
if
(
$nextPage
<=
$numberOfPages
)
{
$this
->
setPageBrowserPage
(
$nextPage
);
...
...
@@ -542,10 +540,6 @@ class OverviewController extends AbstractController {
* @return void
*/
protected
function
setPageBrowserPage
(
$newPage
)
{
if
(
!
isset
(
$_GET
[
'tx_sgnews_pagebrowser'
][
'currentPage'
]))
{
return
;
}
$_GET
[
'tx_sgnews_pagebrowser'
][
'currentPage'
]
=
$newPage
;
}
}
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