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

[5.1] Setting "Data Storage -> Default Status" locked to an ID #1238

Closed
jeroenlammerts opened this issue Apr 25, 2024 · 2 comments
Closed

[5.1] Setting "Data Storage -> Default Status" locked to an ID #1238

jeroenlammerts opened this issue Apr 25, 2024 · 2 comments
Assignees
Labels
freeform5 Affects Freeform 5.x issue Something isn't working correctly

Comments

@jeroenlammerts
Copy link

Describe the bug or issue you're experiencing
Under the settings /admin/freeform/settings/form-builder you can set the "Default Status", this defaults to status "Open".
When installing freeform there are 3 statussus inserted in the database table freeform_statuses. In normal conditions the status "Open" should be ID 2. There are a few drawbacks to this method of linking directly to a database ID.

  1. We are using for a production env a mariadb galera cluster, where auto increment works different. My ID's are inserted like 1,4,7.
    https://stackoverflow.com/questions/23022574/why-the-auto-increment-id-does-not-increase-one-by-one-how-to-set-it
    So when submitting a form it tries to insert ID 2 as status, which does not exists causing a Integrity constraint violation error.

  2. The statusses can be edited in a production env admin/freeform/settings/statuses. This could cause an issue when deleting a custom status which is linked as "Default status".

  3. /admin/freeform/settings/statuses/2 there is also a default status lightswitch setting. Is this setting still used? It feels like the same thing.

Steps to reproduce

  1. N/A

Expected behavior
Make use of the lightswitch setting, isDefault column in freeform_statuses

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

  • Craft Version: Craft Pro 4.8.0
  • Freeform Version: 5.1.14
  • Freeform Edition: Pro
  • Fresh Install or Upgrade: Fresh install
@jeroenlammerts jeroenlammerts added the issue Something isn't working correctly label Apr 25, 2024
@kjmartens kjmartens added the freeform5 Affects Freeform 5.x label Apr 27, 2024
@kjmartens
Copy link
Contributor

kjmartens commented Apr 30, 2024

Sorry for the trouble and the delay @jeroenlammerts,

It took me a while to finally understand what you were referring to. 😅 I get it now. Accidentally, there are two places to set the default status of new forms, with the new one under /admin/freeform/settings/form-builder as of Freeform 5.

We'll look into this further and come up with a solution. 🙂

@kjmartens
Copy link
Contributor

I wanted to let you know that we've released Freeform 5.1.19, which cleans up the default Status behavior (just stored inside the Settings -> Form Builder area now). I believe this change also indirectly resolves the default ID issue you're having. 🙂

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

No branches or pull requests

3 participants