diff --git a/src/main/java/org/olat/modules/webFeed/manager/FeedFileStorge.java b/src/main/java/org/olat/modules/webFeed/manager/FeedFileStorge.java index aacd7b503768d273c04bf05f081e8c6a42444a69..89bc79a45e069a35ec807564d1e1a112a7c4e7b9 100644 --- a/src/main/java/org/olat/modules/webFeed/manager/FeedFileStorge.java +++ b/src/main/java/org/olat/modules/webFeed/manager/FeedFileStorge.java @@ -121,6 +121,20 @@ public class FeedFileStorge { public LocalFolderImpl getResourceContainer(OLATResourceable ores) { return fileResourceManager.getFileResourceRootImpl(ores); } + + public VFSContainer getOrCreateResourceMediaContainer(OLATResourceable ores) { + VFSContainer mediaContainer = null; + + if (ores != null) { + VFSContainer resourceDir = getResourceContainer(ores); + mediaContainer = (VFSContainer) resourceDir.resolve(MEDIA_DIR); + if (mediaContainer == null) { + mediaContainer = resourceDir.createChildContainer(MEDIA_DIR); + } + } + + return mediaContainer; + } /** * Get the top most folder of a feed. diff --git a/src/main/java/org/olat/modules/webFeed/manager/FeedManagerImpl.java b/src/main/java/org/olat/modules/webFeed/manager/FeedManagerImpl.java index 73d6e9093f645950562cd4dc0534319449b466e4..86ce9d48519ce7bf5bf37386fb265271040dad51 100644 --- a/src/main/java/org/olat/modules/webFeed/manager/FeedManagerImpl.java +++ b/src/main/java/org/olat/modules/webFeed/manager/FeedManagerImpl.java @@ -653,6 +653,10 @@ public class FeedManagerImpl extends FeedManager { try { VFSItem item =feedFileStorage.getOrCreateFeedMediaContainer(feed); item = item.resolve(fileName); + if (item == null) { + item = feedFileStorage.getOrCreateResourceMediaContainer(feed); + item = item.resolve(fileName); + } if (thumbnailSize != null && thumbnailSize.getHeight() > 0 && thumbnailSize.getWidth() > 0 && item.canMeta() == VFSConstants.YES) { item = item.getMetaInfo().getThumbnail(thumbnailSize.getWidth(), diff --git a/src/main/java/org/olat/modules/webFeed/ui/blog/_content/info.html b/src/main/java/org/olat/modules/webFeed/ui/blog/_content/info.html index 4b9a9f5c33b43c72b606d781a528d08b521766f1..cf2913ca49a647eabe1dcf8753919afa59200aa5 100644 --- a/src/main/java/org/olat/modules/webFeed/ui/blog/_content/info.html +++ b/src/main/java/org/olat/modules/webFeed/ui/blog/_content/info.html @@ -9,13 +9,13 @@ #if ($helper.getImageUrl($feed) && $helper.getImageUrl($feed) != "") <img class="o_media" src="$helper.getImageUrl($feed)?thumbnail=180x121{$!supressCache}" alt="Blog Image" /> #end - <div class="o_block"> + <div class="o_block "> #if ($!feed.getAuthor()) <div class="o_author">$r.translate("feed.author"): $r.escapeHtml($feed.getAuthor())</div> #end <div class="o_date">$r.translate("feed.last.change") $!helper.getLastModified($feed)</div> #if ($!feed.getDescription() && $feed.getDescription() != "") - <div class="o_desc o_info">$!helper.getFeedDescriptionForBrowser($feed)</div> + <div class="o_desc o_info clearfix">$!helper.getFeedDescriptionForBrowser($feed)</div> #end #if (!$feed.isUndefined())