Hello community,

here is the log from the commit of package ghc-yesod-form for openSUSE:Factory 
checked in at 2017-02-21 13:46:16
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-yesod-form (Old)
 and      /work/SRC/openSUSE:Factory/.ghc-yesod-form.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ghc-yesod-form"

Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-yesod-form/ghc-yesod-form.changes    
2016-12-10 18:26:57.440724466 +0100
+++ /work/SRC/openSUSE:Factory/.ghc-yesod-form.new/ghc-yesod-form.changes       
2017-02-21 13:46:17.266668712 +0100
@@ -1,0 +2,5 @@
+Sun Feb  5 19:31:59 UTC 2017 - [email protected]
+
+- Update to version 1.4.10 with cabal2obs.
+
+-------------------------------------------------------------------

Old:
----
  yesod-form-1.4.9.tar.gz

New:
----
  yesod-form-1.4.10.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ghc-yesod-form.spec ++++++
--- /var/tmp/diff_new_pack.6zEAx8/_old  2017-02-21 13:46:18.026561508 +0100
+++ /var/tmp/diff_new_pack.6zEAx8/_new  2017-02-21 13:46:18.030560945 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package ghc-yesod-form
 #
-# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -19,7 +19,7 @@
 %global pkg_name yesod-form
 %bcond_with tests
 Name:           ghc-%{pkg_name}
-Version:        1.4.9
+Version:        1.4.10
 Release:        0
 Summary:        Form handling support for Yesod Web Framework
 License:        MIT

++++++ yesod-form-1.4.9.tar.gz -> yesod-form-1.4.10.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yesod-form-1.4.9/ChangeLog.md 
new/yesod-form-1.4.10/ChangeLog.md
--- old/yesod-form-1.4.9/ChangeLog.md   2016-11-14 06:18:27.000000000 +0100
+++ new/yesod-form-1.4.10/ChangeLog.md  2017-02-02 08:54:00.000000000 +0100
@@ -1,3 +1,7 @@
+## 1.4.10
+
+* Fixed `identifyForm` to properly return `FormMissing` for empty forms. 
[#1072](https://github.com/yesodweb/yesod/issues/1072)
+
 ## 1.4.9
 
 * Added a `ToValue` instance for `Enctype` 
[#1296](https://github.com/yesodweb/yesod/pull/1296)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yesod-form-1.4.9/Yesod/Form/Functions.hs 
new/yesod-form-1.4.10/Yesod/Form/Functions.hs
--- old/yesod-form-1.4.9/Yesod/Form/Functions.hs        2016-11-14 
06:18:27.000000000 +0100
+++ new/yesod-form-1.4.10/Yesod/Form/Functions.hs       2017-02-02 
08:54:00.000000000 +0100
@@ -62,7 +62,7 @@
 import Yesod.Core.Handler (defaultCsrfParamName)
 import Network.Wai (requestMethod)
 import Text.Hamlet (shamlet)
-import Data.Monoid (mempty)
+import Data.Monoid (mempty, (<>))
 import Data.Maybe (listToMaybe, fromMaybe)
 import qualified Data.Map as Map
 import qualified Data.Text.Encoding as TE
@@ -336,13 +336,13 @@
     -- Create hidden <input>.
     let fragment' =
           [shamlet|
-            <input type=hidden name=#{identifyFormKey} value=#{identVal}>
+            <input type=hidden name=#{identifyFormKey} 
value=identify-#{identVal}>
             #{fragment}
           |]
 
     -- Check if we got its value back.
     mp <- askParams
-    let missing = (mp >>= Map.lookup identifyFormKey) /= Just [identVal]
+    let missing = (mp >>= Map.lookup identifyFormKey) /= Just ["identify-" <> 
identVal]
 
     -- Run the form proper (with our hidden <input>).  If the
     -- data is missing, then do not provide any params to the
@@ -350,7 +350,11 @@
     -- doing this avoids having lots of fields with red errors.
     let eraseParams | missing   = local (\(_, h, l) -> (Nothing, h, l))
                     | otherwise = id
-    eraseParams (form fragment')
+    ( res', w) <- eraseParams (form fragment')
+
+    -- Empty forms now properly return FormMissing. 
[#1072](https://github.com/yesodweb/yesod/issues/1072)
+    let res = if missing then FormMissing else res'
+    return ( res, w)
 
 identifyFormKey :: Text
 identifyFormKey = "_formid"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yesod-form-1.4.9/yesod-form.cabal 
new/yesod-form-1.4.10/yesod-form.cabal
--- old/yesod-form-1.4.9/yesod-form.cabal       2016-11-14 06:18:27.000000000 
+0100
+++ new/yesod-form-1.4.10/yesod-form.cabal      2017-02-02 08:54:00.000000000 
+0100
@@ -1,5 +1,5 @@
 name:            yesod-form
-version:         1.4.9
+version:         1.4.10
 license:         MIT
 license-file:    LICENSE
 author:          Michael Snoyman <[email protected]>


Reply via email to