am-impact / amforms

Forms plugin for Craft
Other
122 stars 21 forks source link

Click on submission results in error "Impossible to invoke a method ("id") on a null variable." #160

Closed chromadesign closed 6 years ago

chromadesign commented 6 years ago

My forms are working fine and emails are sent without a problem. But when I click on a submission in the backend I get a template error saying "Impossible to invoke a method ("id") on a null variable.", see screenshot below. screenshot

hubertprein commented 6 years ago

Sounds like something else might be going wrong on your end, as I can't reproduce this. The only .id that is happening there, is on craft.users. Which should be working just fine, as craft.users can't be null.

chromadesign commented 6 years ago

Interestingly enough, when moving the site to a different URL the problem solved itself! God knows why...

hubertprein commented 6 years ago

That's weird indeed. Glad it got solved though!

If it happens again, reopen the issue and we'll see if we can reproduce it.

akuales commented 6 years ago

I do have the same problem now after trying to post forms via ajax. At some point I couldn't open any submission anymore from any other form I created.

haabe commented 6 years ago

I experience this error as well, but not using Ajax.

I think it might be related to whether you are logged into Craft as a user or not when submitting the form.

chasegiunta commented 6 years ago

Also experiencing this problem.

chasegiunta commented 6 years ago

@hubertprein This stems from the version of Craft you have. craft.users will be null if you're on a Personal or Client license, as Craft doesn't allow users. Just to test, you can try to output any craft.users method in any twig template and it will break.

Upgrading to Craft Pro license fixes this.