if (key.equals("to_media")) {
try {
System.err.println("ASKED FOR MEDIA");
- return getUploadedMediaForContent();
+ SimpleList t = getUploadedMediaForContent();
+ //SimpleHash o = t.next();
+
+ if (t == null) {
+ System.err.println("NULL -- LIST "+this.getId());
+ } else {
+ SimpleHash o = (SimpleHash)t.next();
+ System.err.println("SCALAR: "+o.get("url"));
+ }
+
+ t.rewind();
+ //return getUploadedMediaForContent();
+ return t;
}
catch (Exception ex) {
System.err.println("ASKED EXCE");
//upMediaSimpleHash.put("url", mediaHandler.getURL(upMedia, mediaType));
// ################# TODO: this is broken cause of field checking
// in Entity. must find a workaround
- modelRoot.put("url", mediaHandler.getURL(upMedia, mediaType));
+ modelRoot.put("url", new SimpleScalar(mediaHandler.getURL(upMedia, mediaType)));
modelRoot.put("is_published", upMedia.getValue("is_published"));
//upMedia.setValueForProperty("url",
//mediaHandler.getURL(upMedia, mediaType));