Scarab commit: svn commit: r10403 - trunk: . src/webapp/WEB-INF/templates/macros

[email protected]
Newsgroups gmane.comp.java.scarab.cvs
Message-ID <[email protected]>
Author: ronvoe122
Date: 2006-12-28 07:31:19-0800
New Revision: 10403

Modified:
   trunk/   (props changed)
   trunk/src/webapp/WEB-INF/templates/macros/MITListMacro.vm

Log:
Merged revisions 10377 via svnmerge from 
http://scarab.tigris.org/svn/scarab/branches/release/b21

........
  r10377 | dabbous | 2006-12-10 17:30:20 +0100 (So, 10 Dez 2006) | 6 lines
  
  sometimes th ecurrent session attribute (needed by the query matrix)
  is not set (maybe due to uninitialised new sesion?)
  If this happens the MITListMacro fails with a NPE.
  this patch avoid the NPE and ensures the session attribute is set
  correctly. note: it stll may be possible that te NPE occurs
  becasue the user's current module is lost. to be checked!
........


Modified: trunk/src/webapp/WEB-INF/templates/macros/MITListMacro.vm
Url: http://scarab.tigris.org/source/browse/scarab/trunk/src/webapp/WEB-INF/templates/macros/MITListMacro.vm?view=diff&rev=10403&p1=trunk/src/webapp/WEB-INF/templates/macros/MITListMacro.vm&p2=trunk/src/webapp/WEB-INF/templates/macros/MITListMacro.vm&r1=10402&r2=10403
==============================================================================
--- trunk/src/webapp/WEB-INF/templates/macros/MITListMacro.vm	(original)
+++ trunk/src/webapp/WEB-INF/templates/macros/MITListMacro.vm	2006-12-28 07:31:19-0800
@@ -36,9 +36,16 @@
 
 #set ($currentModule = $scarabR.CurrentModule)
 #set ($availableAttributes = $currentModule.AllOptionAttributes)
+
 #set ($sessionAttributeKey  = "attribute_id_$currentModule.moduleId" ) 
-#set ($currentAttributeName = $scarabR.getSessionAttribute($sessionAttributeKey) )
-#set ($currentAttributeOptions = $currentModule.getAllAttributeOptions($currentAttributeName))
+#if  ($scarabR.hasSessionAttribute($sessionAttributeKey))
+    #set ($currentAttributeKey = $scarabR.getSessionAttribute($sessionAttributeKey) )
+#else
+    #set ($currentAttributeKey = $availableAttributes.get(0).AttributeId )
+    #set ($dummy = $scarabR.setSessionAttribute($sessionAttributeKey, $currentAttributeKey))
+#end
+
+#set ($currentAttributeOptions = $currentModule.getAllAttributeOptions($currentAttributeKey))
 #set ($currentRmits = $user.getAllRModuleIssueTypes($currentModule))
 #set ($savedLists = $user.MITLists)
 #set ($isMoreThanOne = $currentRmits.size() > 1)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.