Scarab commit: svn commit: r10862 - branches/release/0.22/src/java/org/tigris/scarab/screens/ViewIssue.java

Johannes Höchstädter <[email protected]>
Newsgroups gmane.comp.java.scarab.cvs
Message-ID <[email protected]>
Author: jhoech
Date: 2009-12-21 06:58:17-0800
New Revision: 10862

Modified:
   branches/release/0.22/src/java/org/tigris/scarab/screens/ViewIssue.java

Log:
FIX - Issues from other modules are now accessible again by issue id only (quick access bar).

Modified: branches/release/0.22/src/java/org/tigris/scarab/screens/ViewIssue.java
Url: http://scarab.tigris.org/source/browse/scarab/branches/release/0.22/src/java/org/tigris/scarab/screens/ViewIssue.java?view=diff&pathrev=10862&r1=10861&r2=10862
==============================================================================
--- branches/release/0.22/src/java/org/tigris/scarab/screens/ViewIssue.java	(original)
+++ branches/release/0.22/src/java/org/tigris/scarab/screens/ViewIssue.java	2009-12-21 06:58:17-0800
@@ -88,8 +88,12 @@
         Issue issue = null;
         
         String id = data.getParameters().getString("id");
-		issue = getReferredIssue(id == null ? null : id.trim(), (ScarabModule)scarabR.getCurrentModule());
-
+		try{
+			issue = getReferredIssue(id == null ? null : id.trim(), (ScarabModule)scarabR.getCurrentModule());
+		}
+		catch(Exception e){
+			//ignore, this case will be handled later: issue == null
+		}
         boolean hasViewPermission = false;
         boolean hasDeletePermission = false;
         // Deleted issues will appear to not have existed before
@@ -144,26 +148,15 @@
             }
         }
     	
-        if (module != null)
-        { // Will prefix with module's code if ID is just a number
-        	if(!idCount.toString().equals(id)){
-        		if(module.getCode().concat(idCount.toString()).equals(id)){
-        			//id is full qualified issue id (includes prefix)
-        			issue = IssueManager.getIssueById(id);
-        		}
-        		else{
-        			//invalid suffix in issue id
-        			issue = null;
-        		}
-        	}
-        	else{
-        		//id is number only
-            	issue = IssueManager.getIssueById(id, module.getCode());
-        	}
-        	
+        if(!idCount.toString().equals(id)){
+        	issue = IssueManager.getIssueById(id);
+        }
+        else if(module != null && idCount.toString().equals(id)){
+        	//try if id is number only
+            issue = IssueManager.getIssueById(id, module.getCode());
         }
         else{
-        	//no module is given, business of hope
+        	//business of hope
         	issue = IssueManager.getIssueById(id);
         }

------------------------------------------------------
http://scarab.tigris.org/ds/viewMessage.do?dsForumId=3577&dsMessageId=2432003
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.