1. Fabrik 3.9 has been released. If you have updated Joomla to 3.9, this is a required update.
    Dismiss Notice

SyntaxError: Unexpected token D in JSON at position 0 - Form Submit (onAfterProcess)

Discussion in 'Community' started by tiagovareta, Feb 13, 2019.

  1. tiagovareta

    tiagovareta Member

    Level: Community
    Hi,

    I have a form, to register orders and are trying to put the payment by ATM.
    In this form I have 2 plugins: PHP + Redirect,
    The PHP Plugin (onAfterProcess) Calls the file: include 'plugins/fabrik_form/php/scripts/pay/register.php' - Where it generates the payment references and writes them (update), of the record that has just been inserted. This part is working.

    In the Plugin Redirect, go to the page: http://dominio.pt/agradecimento/?idenc={ndxpg_lp_encomendas___id} - Where I have a page of thanks, that will consult the data of the encomenda and makes a brief summary. This part is working (if you access directly, without going through the form).

    What is not working is that when submitting the form, it gives the error: "SyntaxError: Unexpected token D in JSON at position 0"

    That is, it records the order and payment data, but does not redirect it to the thank you page.

    Can anyone help me in this situation?
     
  2. tiagovareta

    tiagovareta Member

    Level: Community
  3. troester

    troester Well-Known Member Staff Member

    Level: Community
    You get the text "Details for payment..." echoed? returned? at a point where a JSON response is expected (so throwing unexpected token "D"...)
     
  4. tiagovareta

    tiagovareta Member

    Level: Community
    Hi Troester,

    I ended up removing the lines where I had the "echo" and apparently it is working.

    Thanks for the tip!
     

Share This Page