mmistakes / minimal-mistakes

:triangular_ruler: Jekyll theme for building a personal site, blog, project documentation, or portfolio.
https://mmistakes.github.io/minimal-mistakes/
MIT License
12.24k stars 25.36k forks source link

Staticman v2 stopped working #1590

Closed lsolesen closed 6 years ago

lsolesen commented 6 years ago

The Staticman v2 used to work correctly up until two days ago where this was added, https://github.com/vih/historie/commit/2f654c14115d8aefde2df1448ec07f622453716c - and as far as I can tell, I have not made any breaking changes since. https://github.com/vih/historie/commits/gh-pages

I get this - which seems to be related to https://github.com/mmistakes/minimal-mistakes/blob/master/_includes/comments.html#L80 - where [reCaptcha][siteKey] is also part of the form.

´´´ "{"success":false,"data":["hidden"],"rawError":{"_smErrorCode":"INVALID_FIELDS","data":["hidden"]},"errorCode":"INVALID_FIELDS"}" ´´´


Environment informations


Expected behavior

I was expecting the comments with staticman v2 to work - but it seems I get a 500 from staticman, when I inspect the network through Chrome webmaster tools.

Steps to reproduce the behavior

Only difference from the original theme staticman.yml is the recaptcha stuff here:

https://github.com/vih/historie/blob/gh-pages/staticman.yml#L97

mmistakes commented 6 years ago

If it was working for you and you made no changes then it's likely something on Staticman's side. I don't control that so you might want to inquire with the project on GitHub.

lsolesen commented 6 years ago

Did a little more digging - and it could be related to the minimal mistakes.

I get this - which seems to be related to https://github.com/mmistakes/minimal-mistakes/blob/master/_includes/comments.html#L80 - where [reCaptcha][siteKey] is also part of the form.

´´´ "{"success":false,"data":["hidden"],"rawError":{"_smErrorCode":"INVALID_FIELDS","data":["hidden"]},"errorCode":"INVALID_FIELDS"}" ´´´

lsolesen commented 6 years ago

Also wonder if it has something to do with: https://github.com/eduardoboucas/staticman/commit/28caae6ebae7eacdc3b8d0eab7469712b0781954

mmistakes commented 6 years ago

Maybe. Could probably wrap those lines in a Liquid conditional, but Staticman shouldn't care if you send extra data.

The only time I see it fail is when you try to submit a form with missing required fields, as defined in the Staticman config. These recaptca lines aren't required.

mmistakes commented 6 years ago

I believe it's related to changes occurring on the Staticman repo. I haven't touched the MM demo site or anything related to Staticman comments and it's failing there too.