On membership payments with auto renewal required getting: recur payment but missing paymentmethod. Check form config
I traced it down to the fact that mjwwshared does not think it's a recurring contribution when in fact it is.
The conditions to get this to fail are:
- Create a membership with auto-renew required
- Create a contribution page with membership enabled
- Use price sets for the membership amount
The auto renew section is hidden because the membership is auto renew required.
This seems to fix it:
-- crm.payment.js.orig 2024-08-02 14:11:03.565238384 +0000
+++ crm.payment.js 2024-08-02 14:04:57.197393957 +0000
@@ -221,7 +221,8 @@
if ($('input[name="auto_renew"]').prop('checked')) {
isRecur = true;
}
- else if ($('input[name="auto_renew"]').attr('type') == 'hidden') {
+ else if ($('input[name="auto_renew"]').is(":hidden") ||
+ $('input[name="auto_renew"]').attr('type') == 'hidden') {
// If the auto_renew field exists as a hidden field, then we force a
// recurring contribution (the value isn't useful since it depends on
// the locale - e.g. "Please renew my membership")
I think the problem is that the auto_renew
field is of the type "checkbox" not hidden - but it's hidden because the parent element is hidden.
I still have sorted out if this is specific to something on this particular site or whether it's more universal or due to a change in how CiviCRM core hides the auto renew fields. I see that the file uses the same mehod to check for hidden fields in other parts which may need to be tested as well.