You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I went to use getFormNotificationByHandle() for some custom module logic, i.e. Formie::$plugin->getNotifications()->getFormNotificationByHandle($form, 'notificationHandle');
...but it was always returning null. This is due to the method always returning the 0 index of the whereMultiple array:
In my case, the ArrayHelper::whereMultiple($this->_notifications(), ['formId' => $form->id, 'handle' => $handle]) call by itself was returning a valid notification but it had an index of 9, and hence would never be returned:
Steps to reproduce
Make sure you have >1 notifications created
Add a new notification to a form
Grab the form, store in $form, and call Formie::$plugin->getNotifications()->getFormNotificationByHandle($form, 'newNotificationHandle'); with your new notification handle, and observe how it will always return null.
Form settings
Multi-page form: No
Submission Method: Ajax
Client-side Validation: Yes
Custom Form Templates: Yes
Craft CMS version
5.5.6.1
Plugin version
3.0.15
Multi-site?
No
Additional context
No response
The text was updated successfully, but these errors were encountered:
Describe the bug
I went to use
getFormNotificationByHandle()
for some custom module logic, i.e.Formie::$plugin->getNotifications()->getFormNotificationByHandle($form, 'notificationHandle');
...but it was always returning null. This is due to the method always returning the 0 index of the
whereMultiple
array:formie/src/services/Notifications.php
Lines 74 to 77 in 79876a8
In my case, the
ArrayHelper::whereMultiple($this->_notifications(), ['formId' => $form->id, 'handle' => $handle])
call by itself was returning a valid notification but it had an index of 9, and hence would never be returned:Steps to reproduce
Formie::$plugin->getNotifications()->getFormNotificationByHandle($form, 'newNotificationHandle');
with your new notification handle, and observe how it will always returnnull
.Form settings
Craft CMS version
5.5.6.1
Plugin version
3.0.15
Multi-site?
No
Additional context
No response
The text was updated successfully, but these errors were encountered: