snoopdave commented on code in PR #244:
URL: https://github.com/apache/roller/pull/244#discussion_r4558193803
##########
app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileView.java:
##########
@@ -193,6 +193,19 @@ public String createNewDirectory() {
*
* @return String The result of the action.
*/
+ /**
+ * Returns the weblog's default media folder, creating it if it is missing.
+ * Weblogs created by old Roller versions may not have one.
+ */
+ private MediaFileDirectory defaultDirectory(MediaFileManager manager)
throws WebloggerException {
Review Comment:
🤖Claude: fixed in d9253ab94: the helper is gone (see the next thread), so
`execute()` keeps its own Javadoc.
##########
app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileImageChooser.java:
##########
@@ -100,6 +100,11 @@ public String execute() {
if (directory == null) {
directory =
manager.getDefaultMediaFileDirectory(getActionWeblog());
}
+ if (directory == null) {
Review Comment:
🤖Claude: fixed in d9253ab94: added
`MediaFileManager.getOrCreateDefaultMediaFileDirectory(weblog)`, which gets the
folder or creates it and flushes. `MediaFileView`, `MediaFileImageChooser`,
`EntryEdit`, `MediaFileAdd`, the JPA upgrade code, `MetaWeblogAPIHandler` and
both places in `MediaCollection` now use it. A test removes the default folder
and checks that it is created once and then reused. A GET to the library or
chooser still writes a row for such a weblog; avoiding that would take a
one-time migration, which I have not done.
##########
app/src/main/java/org/apache/roller/weblogger/ui/rendering/servlets/PageServlet.java:
##########
@@ -504,6 +505,17 @@ public void doGet(HttpServletRequest request,
HttpServletResponse response)
log.debug("Looking up renderer");
renderer = RendererManager.getRenderer(page,
pageRequest.getDeviceType());
+ } catch (RenderingException e) {
Review Comment:
🤖Claude: fixed in d9253ab94: `RendererManager.findRenderer` returns null
when no factory can render the template (`getRenderer` still throws for its
other callers). `PageServlet` and `PreviewServlet` share one
`NoRenderer.sendNotFound` helper, and the unreachable `catch (Exception)` is
gone. It logs the "no content" warning only when the template has no standard
rendition; otherwise it logs at debug, because the factory has already logged
the cause. Added tests for both cases.
--
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]