verbb / formie

The most user-friendly forms plugin for Craft CMS.
Other
96 stars 73 forks source link

Spam submissions always showing regardless of filter dropdown selection #2067

Closed cweiper closed 1 month ago

cweiper commented 2 months ago

Describe the bug

When I go to view submissions for a given site and select "New" from the dropdown filter, I still see both new and spam submissions.

Screenshot 2024-09-16 at 9 39 32 AM

I do see the following Javascript error in the console when using the dropdown filter:

axios.js?v=1726494732:1 Uncaught (in promise) Te {message: 'canceled', name: 'CanceledError', code: 'ERR_CANCELED', stack: 'CanceledError: canceled\n    at Object.cancel (http…resources/21bc10/garnish.js?v=1726494732:2:20979)'}
(anonymous) @ axios.js?v=1726494732:1
_cancelRequests @ BaseElementIndex.js:619
(anonymous) @ BaseElementIndex.js:1629
updateElements @ BaseElementIndex.js:1619
_handleStatusChange @ submission-index.js:111
(anonymous) @ Base.js:94
trigger @ Base.js:92
selectOption @ CustomSelect.js:273
(anonymous) @ CustomSelect.js:125
(anonymous) @ Base.js:162
o @ jquery.js?v=1726494732:2
dispatch @ jquery.js?v=1726494732:2
v.handle @ jquery.js?v=1726494732:2
Promise.catch
(anonymous) @ BaseElementIndex.js:1710
updateElements @ BaseElementIndex.js:1619
_handleStatusChange @ submission-index.js:111
o @ jquery.js?v=1726494732:2
(anonymous) @ Base.js:94
trigger @ Base.js:92
selectOption @ CustomSelect.js:273
(anonymous) @ CustomSelect.js:125
(anonymous) @ Base.js:162
o @ jquery.js?v=1726494732:2
dispatch @ jquery.js?v=1726494732:2
v.handle @ jquery.js?v=1726494732:2

Steps to reproduce

  1. Install Formie
  2. Create a form
  3. Configure ReCAPTCHA V3 (minimum score 0.5) and check Save Spam Submission
  4. Somehow submit a spam submission?
  5. Log into backend and change dropdown filter to "New"

Form settings

Craft CMS version

5.4

Plugin version

3.0.5

Multi-site?

Yes

Additional context

I also have Blitz (5.7.1), Retour (5.0.3), SEOmatic (5.1.2) and CKEditor (4.2) installed. I also have ReCAPTCHA configured for the form

engram-design commented 2 months ago

This is actually correct behaviour in Formie 3.x, where we always show incomplete or spam submissions alongside completed ones. You can swap back to the Formie 2.x behaviour in the "All Submissions Behaviour" setting. But that also doesn't cover any form-specifics submissions, only for the "All Forms" source.

I agree that it's a bit confusing when you're filtering by status, but spam/incomplete submissions aren't technically a status, they're something else. It's been on our list for a while to create a new dropdown so you can filter on status and state.

For this reason, I've added another dropdown to filter based on all/complete/spam/incomplete submissions in addition to the status. It will still default to showing all submissions' state, which I think is handy to see both incomplete and spam submissions in one view. But you can of course change this using the "Default Submissions State" plugin setting in Formie > Settings > Submissions.

Fixed for the next release. To get this early, run composer require verbb/formie:"dev-craft-5 as 3.0.6".

engram-design commented 1 month ago

Fixed in 3.0.8