Author: andre
Date: 2009-05-13 17:10:02 +0200 (Wed, 13 May 2009)
New Revision: 35142

Modified:
   mmbase/trunk/html/mmbase/edit/my_editors/inc/relations.jsp
Log:
Fix for a bug when nodemanager name is NULL (probably a virtual nodemanager, 
but not sure where this comes from in MMBase).
And don't show pager when you have nothing to show (in case of extended 
builders)



Modified: mmbase/trunk/html/mmbase/edit/my_editors/inc/relations.jsp
===================================================================
--- mmbase/trunk/html/mmbase/edit/my_editors/inc/relations.jsp  2009-05-13 
14:09:22 UTC (rev 35141)
+++ mmbase/trunk/html/mmbase/edit/my_editors/inc/relations.jsp  2009-05-13 
15:10:02 UTC (rev 35142)
@@ -40,10 +40,9 @@
     c++;
     
     String role  = relationManager.getForwardRole();
+    int relations = node.countRelatedNodes(otherManager, role, searchdir);
     String otherManagerName = otherManager.getName();
-    int relations = node.countRelatedNodes(otherManagerName);
     String maxRelations = relationManager.getStringValue("max");    // max nr. 
of relation
-    
 %>
     <tr>
       <td class="left">&nbsp;</td>
@@ -61,6 +60,7 @@
         </mm:url>"><img src="img/mmbase-search.png" alt="search" width="21" 
height="20" /></a>
       </td>
     </tr>
+    <mm:import id="my_type" reset="true" />
     <mm:listrelationscontainer type="<%= otherManagerName %>" role="<%= role 
%>" searchdir="$searchdir">
     <mm:maxnumber value="$max" />
     <mm:offset value="$offset" />
@@ -69,7 +69,7 @@
       <mm:context>
       <mm:import id="relation" reset="true"><mm:field name="number" 
/></mm:import>
       <mm:relatednode>
-      <mm:nodeinfo type="type" id="my_type" write="false" />
+      <mm:import id="my_type" reset="true"><mm:nodeinfo type="type" 
/></mm:import>
       <mm:compare referid="my_type" value="<%= otherManagerName %>">
         <mm:field name="number" id="relatednode" write="false" />
         <tr>
@@ -123,14 +123,16 @@
     </mm:listrelations>
     <tr>
       <td colspan="3" class="pager"> <!-- max: ${max} size: ${size} offset: 
${offset} -->
-        <mm:isgreaterthan referid="size" value="0">
-          <mm:previousbatches max="1">
-            <a class="pageleft" href="<mm:url referids="nr,_...@offset,max" 
/>">&laquo;&laquo;</a>
-          </mm:previousbatches>
-          <mm:nextbatches max="1">
-            <a class="pageright" href="<mm:url referids="nr,_...@offset,max" 
/>">&raquo;&raquo;</a>
-          </mm:nextbatches>
-        </mm:isgreaterthan>
+        <mm:compare referid="my_type" value="<%= otherManagerName %>">
+          <mm:isgreaterthan referid="size" value="0">
+            <mm:previousbatches max="1">
+              <a class="pageleft" href="<mm:url referids="nr,_...@offset,max" 
/>">&laquo;&laquo;</a>
+            </mm:previousbatches>
+            <mm:nextbatches max="1">
+              <a class="pageright" href="<mm:url referids="nr,_...@offset,max" 
/>">&raquo;&raquo;</a>
+            </mm:nextbatches>
+          </mm:isgreaterthan>
+        </mm:compare>
       </td>
     </tr>       
     </mm:listrelationscontainer>

_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to