shuber 2004/10/25 19:09:23 CEST
Modified files:
core/src/java/org/jahia/services/pages ContentPage.java
Log:
Bugfix :
- In case the DB contains a page link with a value at -1, we put a warning for the
validation, instead of generation a page not found exception that prevented the
validation from working at all.
Revision Changes Path
1.10 +18 -1 jahia/core/src/java/org/jahia/services/pages/ContentPage.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/jahia/core/src/java/org/jahia/services/pages/ContentPage.java.diff?r1=1.9&r2=1.10&f=h
Index: ContentPage.java
===================================================================
RCS file:
/home/cvs/repository/jahia/core/src/java/org/jahia/services/pages/ContentPage.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- ContentPage.java 7 Oct 2004 18:48:41 -0000 1.9
+++ ContentPage.java 25 Oct 2004 17:09:23 -0000 1.10
@@ -74,6 +74,7 @@
import java.io.Serializable;
import java.util.*;
import org.jahia.exceptions.JahiaForbiddenAccessException;
+import org.jahia.exceptions.JahiaPageNotFoundException;
/**
@@ -3277,8 +3278,24 @@
JahiaPageInfo curPageInfo = (JahiaPageInfo) pageInfoIter.next ();
pageType = curPageInfo.getPageType ();
if (pageType == JahiaPage.TYPE_LINK) {
- ContentPage linkedPage = ServicesRegistry.getInstance
().getJahiaPageService ()
+ ContentPage linkedPage = null;
+ try {
+ ServicesRegistry.getInstance().getJahiaPageService()
.lookupContentPage (curPageInfo.getPageLinkID (), true);
+ } catch (JahiaPageNotFoundException jpnfe) {
+ linkedPage = null;
+ try {
+ activationTestResults.appendWarning(new
+ IsValidForActivationResults(ContentPageKey.
+ PAGE_TYPE,
+ getID(),
+ curPageInfo.getLanguageCode(),
+ "Link doesn't point to a page"));
+ } catch (ClassNotFoundException cnfe) {
+ logger.debug ("Error while creating activation test node
result",
+ cnfe);
+ }
+ }
if (linkedPage != null) {
if (!linkedPage.hasActiveEntries ()) {
logger.debug (