Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix preprints listing in sections page #639

Open
wants to merge 1 commit into
base: stable-3_4_0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions pages/preprints/SectionsHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,6 @@ public function section($args, $request)
exit;
}

$submissions = [];
foreach ($submissions as $submission) {
$submissions[] = $submission;
}

$showingStart = $collector->offset + 1;
$showingEnd = min($collector->offset + $collector->count, $collector->offset + count($submissions));
$nextPage = $total > $showingEnd ? $page + 1 : null;
Expand All @@ -120,6 +115,7 @@ public function section($args, $request)
'section' => $section,
'sectionPath' => $sectionPath,
'preprints' => $submissions,
'authorUserGroups' => Repo::userGroup()->getCollector()->filterByRoleIds([\PKP\security\Role::ROLE_ID_AUTHOR])->filterByContextIds([$context->getId()])->getMany()->remember(),
'showingStart' => $showingStart,
'showingEnd' => $showingEnd,
'total' => $total,
Expand Down
6 changes: 3 additions & 3 deletions templates/frontend/pages/sections.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@

{* Pagination *}
{if $prevPage > 1}
{capture assign="prevUrl"}{url router=PKPApplication::ROUTE_PAGE page="section" op="view" path=$sectionPath|to_array:$prevPage}{/capture}
{capture assign="prevUrl"}{url router=PKPApplication::ROUTE_PAGE page="preprints" op="section" path=$sectionPath|to_array:$prevPage}{/capture}
{elseif $prevPage === 1}
{capture assign="prevUrl"}{url router=PKPApplication::ROUTE_PAGE page="section" op="view" path=$sectionPath}{/capture}
{capture assign="prevUrl"}{url router=PKPApplication::ROUTE_PAGE page="preprints" op="section" path=$sectionPath}{/capture}
{/if}
{if $nextPage}
{capture assign="nextUrl"}{url router=PKPApplication::ROUTE_PAGE page="section" op="view" path=$sectionPath|to_array:$nextPage}{/capture}
{capture assign="nextUrl"}{url router=PKPApplication::ROUTE_PAGE page="preprints" op="section" path=$sectionPath|to_array:$nextPage}{/capture}
{/if}
{include
file="frontend/components/pagination.tpl"
Expand Down