Email : Tracking URL causes 500 error

Your software
My Mautic version is: 4.2.2
My PHP version is: 7.4.29

Your problem

I have a form with hidden fields (ressource_id + ressource_name), that are populated by a JS snippet.
In the source code, fields are correctly populated.
When submitting the form, the fields appear correctly in the form submission data :

The redirect URL is :{formfield=ressource_id} and works properly.
There are 2 submit actions : send results to my email address (so I get notified) which works well :
and send an email to the contact :
Email received seems fine, as the displayed text is fine :
But the “real” links are :
(288 char long)

When clicking on the links, I get following error, probably due to the misconstructed URL :

These errors are showing in the log:
I see only this error, not quite sure this is due to my issue as the time does NOT match the form submissions.

[2022-05-12 14:55:53] mautic.CRITICAL: Uncaught PHP Ex :pray:ception Symfony\Component\Debug\Exception\FatalThrowableError: "Call to a member function getId() on null" at /home/ywop2408/ line 280 {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Call to a member function getId() on null at /home/ywop2408/"} []

Steps I have tried to fix the problem:
I went under Configuration > Email settings to deactivate URL tracking :
and it fixed the issue.
Meaning that it is caused by the URL tracking in the email settings

Note that I updated my Mautic instance a few days ago.
Don’t know whether it can be the cause or not;…

Many thanks for your support !!! :pray:

Your ressourse_id token is not being injected in the link.
How does the final link supposed to look like?
The ‘real link’ you mentioned up there also doesn’t work.

I believe you have to use the Form action “send form results” in order for the form data to be available in the e-mail as token, the form action “send email to contact”, will only have contact data available as token not the form submission data.
by choosing the action “send form results” you will see the option to send the email to contact and to select a email template, so all the features available in the “send email to contact” action is available here plus the formfield tokens.

The same thing happens to me. If I have the urls encryption activated, it does not replace the values of the form. I have mautic 4.1.2. I attach screenshots

valid url →
invalid url
link 1 →{contactfield=producto}?ct=YTo0OntzOjY6InNvdXJjZSI7YTowOnt9czo1OiJlbWFpbCI7TjtzOjQ6InN0YXQiO047czo0OiJsZWFkIjtzOjU6IjYzNTgyIjt9
link 2 →