]> gitweb @ CieloNegro.org - Rakka.git/blobdiff - Rakka/Storage/Repos.hs
implemented language link editor (partly)
[Rakka.git] / Rakka / Storage / Repos.hs
index 76889d7e0ad5fac702041a17b4bb787fe8a491a5..b74f48cb36bb862c92399bb595fd38557996813b 100644 (file)
@@ -179,10 +179,10 @@ loadPageInRepository repos name rev
                                                      -> True
                           , entityRevision   = pageRev
                           , entityLastMod    = zonedTimeToUTC lastMod
-                          , entitySummary    = lookup "rakka:summary" props
+                          , entitySummary    = fmap decodeString (lookup "rakka:summary" props)
                           , entityOtherLang  = fromMaybe M.empty
                                              $ fmap
-                                                   (M.fromList . fromJust . deserializeStringPairs)
+                                                   (M.fromList . fromJust . deserializeStringPairs . decodeString)
                                                    (lookup "rakka:otherLang" props)
                           , entityContent    = content                                             
                           , entityUpdateInfo = undefined
@@ -315,13 +315,13 @@ putPageIntoRepository repos userID page
                setNodeProp path "rakka:isFeed"    (encodeFlag $ entityIsFeed page)
                setNodeProp path "rakka:isLocked"  (encodeFlag $ entityIsLocked page)
                setNodeProp path "rakka:isBinary"  (encodeFlag $ entityIsBinary page)
-               setNodeProp path "rakka:summary"   (entitySummary page)
+               setNodeProp path "rakka:summary"   (fmap encodeString $ entitySummary page)
                setNodeProp path "rakka:otherLang" (let otherLang = entityOtherLang page
                                                    in
                                                      if M.null otherLang then
                                                          Nothing
                                                      else
-                                                         Just (serializeStringPairs $ M.toList otherLang))
+                                                         Just (encodeString $ serializeStringPairs $ M.toList otherLang))
                applyTextLBS path Nothing (entityContent page)
 
       encodeFlag :: Bool -> Maybe String
@@ -409,7 +409,7 @@ loadAttachmentInRepository repos pName aName rev
       path = mkAttachmentPath pName aName
 
       loadAttachment' :: Rev a
-      loadAttachment' = getFileContents path >>= return . deserializeFromString
+      loadAttachment' = getFileContents path >>= return . deserializeFromString . decodeString
 
 
 putAttachmentIntoRepository :: Attachment a =>