Skip to content

Commit

Permalink
Fix page=0 by eliminating the root cause: wrong usage of c:forEach loop.
Browse files Browse the repository at this point in the history
  • Loading branch information
poikilotherm authored and pdurbin committed Jun 11, 2019
1 parent 7b53c62 commit e4946bc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/main/webapp/search-include-pager.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@
</li>
<c:forEach begin="#{Math:max(1,SearchIncludeFragment.page-Math:max(2,SearchIncludeFragment.page-SearchIncludeFragment.totalPages+4))}"
end="#{Math:min(SearchIncludeFragment.totalPages,SearchIncludeFragment.page+Math:max(2,5-SearchIncludeFragment.page))}"
varStatus="pageStatus">
<li class="#{SearchIncludeFragment.page == pageStatus.index ? 'active' : ''}">
var="pIter">
<li class="#{SearchIncludeFragment.page == pIter ? 'active' : ''}">
<h:outputLink value="#{widgetWrapper.wrapURL(page)}">
<h:outputText value="#{pageStatus.index}">
<h:outputText value="#{pIter}">
<f:convertNumber pattern="###,###" />
</h:outputText>
<span class="#{SearchIncludeFragment.page == pageStatus.index ? 'sr-only' : ''}">
<h:outputText value="#{SearchIncludeFragment.page == pageStatus.index ? bundle['dataverse.results.paginator.current'] : ''}"/>
<span class="#{SearchIncludeFragment.page == pIter ? 'sr-only' : ''}">
<h:outputText value="#{SearchIncludeFragment.page == pIter ? bundle['dataverse.results.paginator.current'] : ''}"/>
</span>
<f:param name="q" value="#{SearchIncludeFragment.query}"/>
<c:forEach items="#{SearchIncludeFragment.filterQueries}" var="clickedFilterQuery" varStatus="status">
Expand All @@ -58,7 +58,7 @@
<f:param name="types" value="#{SearchIncludeFragment.selectedTypesString}"/>
<f:param name="sort" value="#{SearchIncludeFragment.sortField}"/>
<f:param name="order" value="#{SearchIncludeFragment.sortOrder}"/>
<f:param name="page" value="#{pageStatus.index}"/>
<f:param name="page" value="${pIter}"/>
</h:outputLink>
</li>
</c:forEach>
Expand Down

0 comments on commit e4946bc

Please sign in to comment.