Unable to update notification recipients after upgrading to Freeform 5 #1239
-
Describe the bug or issue you're experiencingWhen trying to update the email recipients in the Notifications tab, or add a a new recipient, the change doesn't save. Steps to reproduce
Expected behaviorAble to update and save existing email recipient in Notifications tab, or add and save an additional recipient Craft & Plugin Info (please complete the following information):Craft Version: 4.8.1 |
Beta Was this translation helpful? Give feedback.
Replies: 23 comments 7 replies
-
Sorry for the trouble, @kate-stretton. I have tried testing this a bit on my end and it appears to work correctly. Are you seeing any JS errors in the browser console? 🙂 |
Beta Was this translation helpful? Give feedback.
-
Hello, |
Beta Was this translation helpful? Give feedback.
-
Hi @kate-stretton, Can you update to Freeform 5.1.8 and try it again? If the issue continues, can you provide me the Network response you're getting? Here's how to do that (keep in mind yours won't be |
Beta Was this translation helpful? Give feedback.
-
Hi @kjmartens, Thanks for your help with this! I've updated to Freeform 5.1.8 and tested updating the recipient again. Unfortunately I'm still experiencing this issue. I've checked the Network tab and there's no response data: I've also now discovered that I get the same error when trying to create a new Admin notification - again a 400 error (Bad Request), and there's no response data. |
Beta Was this translation helpful? Give feedback.
-
I have the same problem (version 5.1.10) and unfortunately there is no response data available |
Beta Was this translation helpful? Give feedback.
-
Hi @kjmartens |
Beta Was this translation helpful? Give feedback.
-
Sorry for the trouble @kate-stretton and @jeffreyschmitz87. I will have one of our developers check into this and see what they can find. It's odd it just happens to a small portion of customers (I personally can't duplicate this issue either). @seandelaney may also request more information to help him debug this issue. 🙂 I appreciate your patience! |
Beta Was this translation helpful? Give feedback.
-
Hi @kate-stretton and @jeffreyschmitz87, Can you check your Craft logs and see what is showing up there? I imagine it would be located in |
Beta Was this translation helpful? Give feedback.
-
Hi @kjmartens, I tested disabling all plugins except Freeform, but have the same issue. |
Beta Was this translation helpful? Give feedback.
-
What does your Template manager settings look like in https://craft4.test/admin/freeform/settings/template-manager. Can you send me a screenshot please? Are you using File or Database Notifications? |
Beta Was this translation helpful? Give feedback.
-
Can I please see the payload info too? |
Beta Was this translation helpful? Give feedback.
-
This does not sound right. If you are getting 400 errors for any changes, then its not isolated to Notifications tab. Did the upgrade all go okay? Any issues? Are you able to create a new form and setup a notification? cc: @kjmartens |
Beta Was this translation helpful? Give feedback.
-
Did you also upgrade ? Can you also please answer the same questions that I asked @kate-stretton . Thanks Anyways, I have setup Craft 4 with Freeform 5 (Latest release). PHP 8.2. MySQL DB though. Not getting any errors in console or network tabs. |
Beta Was this translation helpful? Give feedback.
-
@kate-stretton @jeffreyschmitz87 https://craft4.test/admin/freeform/api/forms/1/notifications What does this request return? Can you please send me screenshots of what it sends back. |
Beta Was this translation helpful? Give feedback.
-
I've upgraded to the latest version (5.1.11) and unfortunately the 400 status is still there. The response from freeform/api/forms/1/notifications:
If I save the notification of the form with the 400 status and view the API - controller response I see an empty array as response. Another thing I noticed is that when I open the form with the 400 status and I click on the Notifications tab and reload the page, the left side keeps 'loading' (see image below). If I then click on 'Layout' and then go back to 'Notifications', the left side does load. In a certain situation it has been possible to add a notification. If I duplicate an existing form which has a notification and add a new notification to the duplicated form, it works. Hopefully this helps! |
Beta Was this translation helpful? Give feedback.
-
Creating a new form and adding a new notification works! Maybe something goes wrong if a form in Freeform 4 has no notification and after the migration to Freeform 5 a new notification can't be added? |
Beta Was this translation helpful? Give feedback.
-
Thank you for the info. Very helpful! I will test this scenario where I have a FF4 form with no notification. Upgrade to FF5 and try adding a notification and see if I can trigger this 400. |
Beta Was this translation helpful? Give feedback.
-
I still cannot replicate 400 errors using a fresh FF4 installation with a form and no notifications to upgrading to FF5 and adding notifications. All worked as expected. No 400 errors. @jeffreyschmitz87 @kate-stretton Next step for me is to ask for a DB backup. Please remove all sensitive info. Is this possible? email to [email protected] |
Beta Was this translation helpful? Give feedback.
-
Hi @seandelaney, Thank you for looking further into this. I'm using database notifications. Here's a screenshot of my Template manager settings: And here's one of the payload info: The upgrade went okay - there are no other issues. I am able to set up a notification if I create an entirely new form. The response from freeform/api/forms/1/notifications is: I will send you through a copy of of the database backup. Thanks! |
Beta Was this translation helpful? Give feedback.
-
@kate-stretton FF4 DB backup. as I want to run it through the upgrade process locally and see where notifications are going wrong. Thanks Same for @jeffreyschmitz87 - If you can email me FF4 DB backup, that would be great, |
Beta Was this translation helpful? Give feedback.
-
I've dug a little deeper into this issue and I think I've found the problem: When the form notification is saved it contains error messages (https://github.com/solspace/craft-freeform/blob/v5/packages/plugin/src/Bundles/Persistence/NotificationPersistence.php#L76). These error messages are caused by a field within the form with a invalid handle name.
One of the fields (in this case an e-mail field) contains a dash Perhaps you can write a migration to remove all illegal characters from all handle names to fix this and add a check to remove illegal characters from handle names upon save? It is currently possible to add a new field with a illegal character. |
Beta Was this translation helpful? Give feedback.
-
I was a little too quick to respond! I was still running Freeform on 5.1.11. After I updated to 5.1.16 the problem was resolved. The problem has been solved for me since version 5.1.12 when updating 1 version at a time. Thank you for looking into it! |
Beta Was this translation helpful? Give feedback.
I've dug a little deeper into this issue and I think I've found the problem:
When the form notification is saved it contains error messages (https://github.com/solspace/craft-freeform/blob/v5/packages/plugin/src/Bundles/Persistence/NotificationPersistence.php#L76). These error messages are caused by a field within the form with a invalid handle name.
One of the fields (in this case an e-mail field) contains a dash
-
inside the handle name, which causes the notification t…