Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deleting submissions does not delete them from the database #926

Open
darylknight opened this issue Nov 29, 2023 · 7 comments
Open

Deleting submissions does not delete them from the database #926

darylknight opened this issue Nov 29, 2023 · 7 comments
Assignees
Labels
issue Something isn't working correctly

Comments

@darylknight
Copy link

darylknight commented Nov 29, 2023

Describe the bug or issue you're experiencing
When you select all submissions and say "Delete all..." and confirm, it removes them all from the Craft control panel, but they are not removed from the database. I've just realised this because my db export was huge. I deleted all the submissions and re-exported, and the database size did not change. My form is showing 0 submissions inside Craft, but the freeform_submissions database table still contains 46000 rows.

Steps to reproduce

  1. Delete all the Freeform submissions inside Craft
  2. All the submissions are still in the database

Expected behavior
All information should be deleted from the database

Craft & Plugin Info (please complete the following information):

  • Craft Version: 4.5.11.1
  • Freeform Version: 4.1.13
  • Freeform Edition: Pro
@darylknight darylknight added the issue Something isn't working correctly label Nov 29, 2023
@joelstrom
Copy link

We're having this same issue right now, but with Craft 3.9.6 & Freeforms 3.13.32

@kjmartens
Copy link
Contributor

Sorry for the delay @darylknight and @joelstrom.

Is this not expected behavior with Soft Deleting submission elements in Craft? When I use the Delete or Delete All feature, it correctly soft deletes the submissions and they are now only visible inside the Trashed filter. Attempting to export submission data does not include these submissions.

If I then view the soft-deleted submissions and click on Delete Permanently, it seems to permanently delete them correctly. 🙂

@kjmartens kjmartens self-assigned this Dec 15, 2023
@darylknight
Copy link
Author

Thanks for the reply Kelsey.

Sorry I was unaware that submissions were not actually deleted when you delete them but moved to Trashed. Solspace plugins often don't use native Craft functionality so I wasn't aware that it used a trash bin for deleted submissions.

No this doesn't seem to work. I have a form called Age Gate. I deleted all the submissions:

image

If I go to the Trashed section of the control panel, there are 13,000 submissions in there:

image

In the database, there are 49,000 submissions:

image

The list of submissions has a "Delete all "function. But the Trashed view only has "Delete these selected 100"; I can't "Delete all" through the control panel . If I run ./craft gc/run, it says deleting trashed rows in the{{%freeform_submissions}} table ... done and they are gone from Craft > Freeform > Trashed submissions:
image

but they aren't deleted from the database:

image

@kjmartens
Copy link
Contributor

This is weird, @darylknight. I just tried monitoring this very closely in the database on my end, and I notice that every single remnant is removed from elements, elements_sites, content, freeform_submissions, and freeform_submissions_my_form_name.

If you have a look at your database tables, are you seeing any breakdown among the ones I just listed? For example, is the Freeform element being removed from elements, elements_sites, content, but NOT from freeform_submissions and freeform_submissions_my_form_name, or something like that? 🙂

/cc @joelstrom

@darylknight
Copy link
Author

Thanks for double checking Kelsey. I'll dive into this again when I'm back at work in January.

@darylknight
Copy link
Author

Yep, still happening (Freeform 4.1.11). Weirdly, running garbage collection did actually hang on on deleting trashed rows in the {{%freeform_submissions}} table ... done for a while as if it were working, but when I refresh the database connection view of the tables, all the rows are still in there.

Database before:

Screenshot 2024-01-04 163539

Form dashboard before:
Screenshot 2024-01-04 163548

Submissions deleted from the Age Gate form in the control panel, then run garbage collection:
Screenshot 2024-01-04 164630

Dashboard afterwards:

Screenshot 2024-01-04 163748

Database tables afterwards:
Screenshot 2024-01-04 164549

@darylknight
Copy link
Author

Any updates to this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue Something isn't working correctly
Development

No branches or pull requests

3 participants