bugfixx: When a user selects topics in an open posting, the applicable topic pages...
[mir.git] / source / mircoders / producer / ProducerList.java
index 55adfcd..5a4195c 100755 (executable)
@@ -104,7 +104,9 @@ abstract public class ProducerList extends Producer {
             try {
                 //media to content
                 EntityList currentMediaList = DatabaseContentToMedia.getInstance().getUploadedMedia(currentContent);
-                if (currentMediaList!=null && currentMediaList.getCount()>=1) {
+                SimpleList contentList = (SimpleList)mergeData.get("contentlist");
+                SimpleHash contentHash = (SimpleHash)contentList.get(k);
+                                                               if (currentMediaList!=null && currentMediaList.getCount()>=1) {
                   SimpleList mediaListAudio = new SimpleList();
                   SimpleList mediaListImages = new SimpleList();
                   SimpleList mediaListVideo = new SimpleList();
@@ -139,29 +141,32 @@ abstract public class ProducerList extends Producer {
                       } //end if is_published
                     } //end if media_type != null
                   } //end for
-                  SimpleList contentList = (SimpleList)mergeData.get("contentlist");
-                  SimpleHash contentHash = (SimpleHash)contentList.get(k);
+
+
                   contentHash.put("to_media_audio", mediaListAudio);
                   contentHash.put("to_media_images", mediaListImages);
                   contentHash.put("to_media_video", mediaListVideo);
                   contentHash.put("to_media_other", mediaListOther);
                 } //end if currentMediaList != null
+                                                       
+                                                               //content to html
+                                                               if(((SimpleScalar)contentHash.get("is_html")).getAsString().equals("0") ){
+                                                                       SimpleScalar tempScalar = (SimpleScalar)contentHash.get("description");
+                                                                       String temp = tempScalar.getAsString();
+                                                                       if(temp!=null && temp.length()>0){
+                                                                               temp = StringUtil.createHTML(temp);
+                                                                               temp = StringUtil.decodeHTMLinTags(temp);
+                                                                               contentHash.put("description",temp);
+                                                                       }
+                                                               } else {
+                                                                       SimpleScalar tempScalar = (SimpleScalar)contentHash.get("description");
+                                                                       String temp = tempScalar.getAsString();
+                                                                       if(temp!=null && temp.length()>0){
+                                                                               temp = StringUtil.decodeHTMLinTags(temp);
+                                                                               contentHash.put("description",temp);
+                                                                       }
+                                                               }
 
-                //content to html
-                if(currentContent.getValue("is_html").equals("0")){
-                  String temp = (String)currentContent.getValue("description");
-                  if(temp!=null && temp.length()>0){
-                    temp = StringUtil.createHTML(temp);
-                    temp = StringUtil.decodeHTMLinTags(temp);
-                    currentContent.setValueForProperty("description",temp);
-                  }
-                } else {
-                  String temp = (String)currentContent.getValue("description");
-                  if(temp!=null && temp.length()>0){
-                    temp = StringUtil.decodeHTMLinTags(temp);
-                    currentContent.setValueForProperty("description",temp);
-                  }
-                }
             } catch (Exception e) {
                 logHTML(htmlout, "Producer.List id " +currentContent.getId()+ " seems corrupt, skipping it :: "+e.toString());
                 theLog.printError("Producer.List id " +currentContent.getId()+ " seems corrupt, skipping it :: "+e.toString());