• Resolved nextiteration

    (@nextiteration)


    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 73

    The 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.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Faisal Ahammad

    (@faisalahammad)

    Hi there,

    Good morning. I hope you’re doing great.

    The error seems to be related to the Emails & Actions. By completely removing and re-adding the Actions, the error did not persist. I have informed our engineers about this and added it to our development pipeline for resolution.

    I do not have an estimate for when a fix will be ready to include in a new release. I sincerely apologize.

    Give it a try, and let me know how that goes!

    Have a good day!

    Thanks
    Faisal

    Thread Starter nextiteration

    (@nextiteration)

    Hi,

    Removing and adding the actions didn’t work for me, and the problem reappeared when the plugin was recently update. Do you have an update as to when this will be implemented? I’m the meantime, I’ve added my patch to the plugin on our site (checking to see if payment_total_type exists in the $subject array)

    Wanted to follow up and ask if any progress has been made on this. Our various forms are submitting properly but the warning is still popping up in our debug logs a few hundred times a day.

    We have multiple forms with lots of actions so removing them and recreating them would take some time. Plus the creator of this thread said it did not work.

    Debating implementing a small patch to check if it is set as the thread creator suggested.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Payment_total_type throwing json warning’ is closed to new replies.