From d8b1f9788c74ea5d7dc4f1f45432649d9601106a Mon Sep 17 00:00:00 2001 From: ros Date: Mon, 21 Jun 2021 16:00:55 +0200 Subject: [PATCH] feat(course material): small empty-bug fixed --- src/Application.hs | 1 + src/Handler/Material.hs | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Application.hs b/src/Application.hs index d9a64a0f9..d1d7195f2 100644 --- a/src/Application.hs +++ b/src/Application.hs @@ -714,3 +714,4 @@ addPWEntry User{ userAuthentication = _, ..} (Text.encodeUtf8 -> pw) = db' $ do + diff --git a/src/Handler/Material.hs b/src/Handler/Material.hs index 88e496565..ad378b383 100644 --- a/src/Handler/Material.hs +++ b/src/Handler/Material.hs @@ -107,7 +107,6 @@ getMaterialListR tid ssh csh = do seeAllModificationTimestamps <- hasWriteAccessTo $ CourseR tid ssh csh MaterialNewR -- ordinary users should not see modification dates older than visibility MsgRenderer mr <- getMsgRenderer table <- runDB $ do - --cid <- getKeyBy404 $ TermSchoolCourseShort tid ssh csh let row2material = view $ _dbrOutput . _1 . _entityVal psValidator = def & defaultSorting [SortDescBy "last-edit"] & forceFilter "may-access" (Any True) @@ -156,7 +155,7 @@ getMaterialListR tid ssh csh = do Just needle -> (E.castString (material E.^. MaterialName) `E.ilike` (E.%) E.++. E.val needle E.++. (E.%))) , (singletonMap "searchTypeAndDescription". FilterColumn $ \material criterion -> case getLast (criterion :: Last Text) of Nothing -> E.val True :: E.SqlExpr (E.Value Bool) - Just needle -> (E.castString (material E.^. MaterialType) `E.ilike` (E.%) E.++. E.val needle E.++. (E.%)) + Just needle -> (E.maybe (E.val mempty) E.castString (material E.^. MaterialType) `E.ilike` (E.%) E.++. E.val needle E.++. (E.%)) E.||. (E.maybe (E.val mempty) (E.castString.esqueletoMarkupOutput) (material E.^. MaterialDescription) `E.ilike` (E.%) E.++. E.val needle E.++. (E.%))) ] , dbtFilterUI = \mPrev -> mconcat $ catMaybes