This is an automated email from the ASF dual-hosted git repository.
dklco pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-whiteboard.git
The following commit(s) were added to refs/heads/master by this push:
new 3e3c303 Fixing a null pointer on the page and fixing pagination
3e3c303 is described below
commit 3e3c30394573ec38c0dfaa23221ed877628e9789
Author: Dan Klco <[email protected]>
AuthorDate: Fri Mar 9 14:56:06 2018 -0500
Fixing a null pointer on the page and fixing pagination
---
cms/core/src/main/java/org/apache/sling/cms/core/models/Page.java | 4 +++-
.../jcr_root/apps/reference/components/general/list/pagination.jsp | 4 ++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/cms/core/src/main/java/org/apache/sling/cms/core/models/Page.java
b/cms/core/src/main/java/org/apache/sling/cms/core/models/Page.java
index 27c6aa6..065f59e 100644
--- a/cms/core/src/main/java/org/apache/sling/cms/core/models/Page.java
+++ b/cms/core/src/main/java/org/apache/sling/cms/core/models/Page.java
@@ -69,7 +69,9 @@ public class Page extends AbstractContentModel {
if (taxonomy != null) {
for (String item : taxonomy) {
Resource resource =
this.resource.getResourceResolver().getResource(item);
-
keywords.add(resource.getValueMap().get(CMSConstants.PN_TITLE, String.class));
+ if (resource != null) {
+
keywords.add(resource.getValueMap().get(CMSConstants.PN_TITLE, String.class));
+ }
}
}
return keywords.toArray(new String[keywords.size()]);
diff --git
a/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/list/pagination.jsp
b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/list/pagination.jsp
index d41de6b..cd8277d 100644
---
a/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/list/pagination.jsp
+++
b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/list/pagination.jsp
@@ -29,7 +29,7 @@
</c:when>
<c:otherwise>
<li
class="${listConfig.valueMap.pageItemClass}">
- <a
class="${listConfig.valueMap.pageLinkClass}" href="?page=0"><</a>
+ <a
class="${listConfig.valueMap.pageLinkClass}" href="?page=${list.currentPage -
1}"><</a>
</li>
</c:otherwise>
</c:choose>
@@ -50,7 +50,7 @@
</c:when>
<c:otherwise>
<li
class="${listConfig.valueMap.pageItemClass}">
- <a
class="${listConfig.valueMap.pageLinkClass}" href="?&page=${list.currentPage +
1}">></a>
+ <a
class="${listConfig.valueMap.pageLinkClass}" href="?page=${list.currentPage +
1}">></a>
</li>
</c:otherwise>
</c:choose>
--
To stop receiving notification emails like this one, please contact
[email protected].