mraible commented on code in PR #169:
URL: https://github.com/apache/roller/pull/169#discussion_r3891439162


##########
app/src/main/webapp/themes/frontpage/_blogdirectory.vm:
##########
@@ -1,8 +1,14 @@
-#if($model.getRequestParameter("letter"))
-        #set($chosenLetter = $model.getRequestParameter("letter"))
-    #end
+#set($weblogLetterMap = $site.getWeblogHandleLetterMap())
 
-    #set($weblogLetterMap = $site.getWeblogHandleLetterMap())
+    ## Accept only a known A-Z key; otherwise render the full listing, exactly
+    ## as a missing parameter does.
+    #set($requestedLetter = $model.getRequestParameter("letter"))
+    #if($requestedLetter && $requestedLetter.length() == 1)

Review Comment:
   Nit: the `length() == 1` check and `$candidateLetter` collapse to 
`#if($requestedLetter && 
$weblogLetterMap.containsKey($requestedLetter.toUpperCase()))`, since every key 
is one character. Keep the `null` guard, `TreeMap.containsKey(null)` throws.



##########
app/src/main/webapp/themes/frontpage/directory.vm:
##########
@@ -31,10 +31,15 @@
 
             <div id="tabContent">
                 <div id="directory">
-                #if($model.getRequestParameter("weblog"))
-                    #set($handle = $model.getRequestParameter("weblog"))
-                    <a href="?letter=$utils.left($handle,1)">Back to blog 
directory</a>
-                    #set($profileWeblog = $site.getWeblog($handle))
+                ## Render the profile only for a weblog that exists, and build
+                ## the back-link from the resolved weblog's own handle.
+                #set($profileWeblog = false)

Review Comment:
   Nit: nothing sets `$profileWeblog` before this and Velocity 2.4 assigns 
`null` from `#set`, so the initialiser is a no-op. If it's kept for the ROL-689 
precedent in `weblog.vm`, a comment saying so would help.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to