Payment_total_type throwing json warning
-
We are not using payments in our form, but we’re running into a php notice that’s affecting our submission message:
Notice: Undefined index: payment_total_type in … plugins/ninja-forms/includes/Abstracts/MergeTags.php on line 68The code in question checks to see if “payment_total” is a key in the $subject field, but not “payment_total_type”:
if ( isset($subject['payment_total']) && $subject['payment_total_type'] == 'field' && ! is_numeric($subject['payment_total']) && ! strpos($subject['payment_total'], ':calc}') )When I output the $subject array, there is no payment_total_type in the array, but there is an empty payment_total:
... [payment_gateways] => [payment_total] => [tag] => ...It appears that the isset($subject[“payment_total”]) is returning true, but since there’s not a key of “payment_total_type” in the $subject array, that is throwing the undefined index notice.
And as I said before you deleted my reply on the other thread that you erroneously marked as resolved, this has been like this for more than 3 weeks. The fix is A SINGLE LINE OF CODE to check whether
payment_total_typeis set or not. I can’t be bothered to provide you with the code again, since you deleted it.BUT, as I pointed out in my deleted reply, your suggested fix is nothing of the sort. Recreating a form’s actions from scratch is hours and hours and hours of work across multiple forms. It’s hours of end-to-end testing, ironing out of bugs that will inevitably have crept in, and it’s probably months of irate customer support emails when human error leads to missed leads and opportunities. All so that Ninja Forms can avoid writing one line of code.
Aren’t you glad you made me rewrite all of this now? For the record I added more information to the other thread, I didn’t simply reply with a “me too”. Unceremoniously deleting replies because they highlight that your team haven’t fixed an obvious error in more than 3 weeks doesn’t make you look good. Now you have TWO threads pointing out your failure. From the FAQ you sent me,
“We ask everyone make a new topic, just for themselves, unless they are absolutely certain the problem is the same“
It very much is exactly the same. So who’s not following the FAQs now?
The topic ‘Payment_total_type throwing json warning’ is closed to new replies.