Skip Navigation

[Resolved] CRED form error; The form you have submitted has expired…

This support ticket is created 6 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 14 replies, has 3 voices.

Last updated by Beda 6 years, 7 months ago.

Assisted by: Beda.

Author
Posts
#629427

I am trying to: Use a CRED form to upload an image to a CPT.

Link to a page where the issue can be seen: hidden link

I expected not to see the following error message appearing after the image upload step: The form you have submitted has expired. Please refresh the page and try again.

I have tried the steps in the following support ticket: https://toolset.com/forums/topic/the-form-you-submitted-has-expired-please-refresh-the-page-and-try-again/
1. Activate a different theme solved the problem. Reactivating the correct theme produced the error.
2. Adding the code snippet for the progress bar did not help
3. Error message from the log file:
[28-Mar-2018 21:44:04 UTC] PHP Warning: in_array() expects parameter 2 to be array, string given in /home/omokoroa/public_html/wp-content/plugins/cred-frontend-editor/library/toolset/cred/embedded/classes/Form_Builder_Helper.php on line 1384
[28-Mar-2018 21:44:04 UTC] PHP Warning: Invalid argument supplied for foreach() in /home/omokoroa/public_html/wp-content/plugins/cred-frontend-editor/library/toolset/cred/embedded/classes/Form_Builder_Helper.php on line 1389

#629488

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Greig

I set up a test site with a Genesis theme to see if I could reproduce the problem but could not.

Could you please check if this solution reported by another client may apply to you: https://toolset.com/forums/topic/the-form-you-submitted-has-expired-please-refresh-the-page-and-try-again-2/#post-625537

#629491

Hi Nigel

I spotted that support topic earlier and pursued this with Siteground before contacting you. I also took the liberty of enforcing https: on cPanel to see if that worked but it was not successful...

#629494

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

OK, could I get a copy of your site to install locally and see if I can reproduce with your own site?

https://toolset.com/faq/provide-supporters-copy-site/

Let me mark your next reply as private so you can share the duplicator packages and site credentials, if that's okay.

#629861

Hi Nigel

I have a couple of problems here:
1. Duplicator says it doesn't support Multisite
2. I get warning notices about file sizes
3. The build process interrupts, and presents error messages about 'budget hosts' - I'm with Siteground.

How should we proceed?

Greig 🙂

#629868

Oh, I forgot to say in my original post that this glitch only arose a few days ago. Prior to that, it had been working fine in production for several months...

#629957

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

I should be able to use Duplicator Pro to take a copy, or I can at least try.

I will mark your next reply as private so that I can get log-in credentials from you—you may want to create a temporary admin user for me to use that you can later delete. It will need to be a super admin.

Can you confirm which site I need to copy.

#631051

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Greig

I managed to take a copy of your site and install it locally, but then I was unable to reproduce the problem.

So I went to the origin site, disabled the Code Snippet you have to de-activate the progress bar which prevents images being added, and made a test form submission—and it worked fine.

So I cannot reproduce the issue on your own site, either.

I should probably have checked that first.

#637463
Firefox before delete cache.jpeg
Safari.jpeg

Hi Nigel

I'm a little confused, the problem is still evident here. I've tried with a few browsers and a different device and still cab't make it work...

#638700

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Screen Shot 2018-04-09 at 13.10.15.png
Screen Shot 2018-04-09 at 13.10.28.png

Hi Greig

Here's what happens when I try to submit a post at hidden link

Those screenshots were with Chrome, but I also tried with Safari and got the same results.

Should I be testing with a different user?

Let me mark your next reply as private again and you can give me credentials for a different user if needs be.

#640489

Hi Nigel

User credentials aren't necessary - there's no requirement for the website visitor to be logged in to be able to use this form.

Any thoughts on where to look next?

Cheers,
Greig

#641637

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Greig

Ah, that's it. I was submitting the form while logged in, when it works.

I see the issue when using the form as a guest. Oddly, though, not when doing the same on my local copy of your site.

I'm escalating this thread so my colleagues can take a look to see if they can identify what the issue may be, and I'll get back to you as soon as I get some feedback.

#644021

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Greig

I just remembered a similar issue that isn't the one you linked to initially. There the problem was that the site was mixing http and https, and forcing it to https fixed the issue.

Could you check with your host about doing the same?

#763630

Hi Nigel, sorry for the slow reply - I was waiting for a further comment on your second-last post.

I worked through this with my host and they advised that everything is working as it should at their end.

Cheers,
Greig

#822403

Hi Greig, this is Beda, I am helping out Nigel as he's off to a week of well-deserved Vacation.

The error you see seems to be related to the usage of Toolset Forms (Former CRED) Generic Fields and Customs Code that populates those Fields with a JSON dataset and eventually later validates or saves the selected data to the database.

I say this because the only records of the error you see are exactly related to what I outlined above.

Further, I saw, that you already confirmed the issue as solved when you use any other Theme but the current installed one.
Is this correct?
I refer to:

Activate a different theme solved the problem. Reactivating the correct theme produced the error.

From https://toolset.com/forums/topic/cred-form-error-the-form-you-have-submitted-has-expired/#post-629427

Later I notice, that "...this glitch only arose a few days ago. Prior to that, it had been working fine in production for several months...".
This must have been due to an update or similar, in this case.
Some code added a Field changed, some JSON values altered, something must have been done to produce the issue.

Do you recall what you or other admins did on that day in the Website?

Now, I took a look at the live website and see that you, in fact, use Generic Fields in that Form.

Then I wondered how the issue looks alike and tried to replicate it, directly on the site, both as the admin and a guest.
I could upload Featured Image and Post Image just fine with that form.

I deleted the images again from your system.
Do I need to submit the form?
I did not do that as I did not want to create any unexpected content on the site.

As Nigel informed me, he was not able to replicate this with the copy of this site locally.

So I think we have some exception here, which is due to what I described in my opening comment, and certain servers or PHP versions or similar.
This may even be a BUG in Toolset Forms that is shown only under delimited circumstances.

I would like to ask you to confirm if this is due to your theme only, on your install, and if so, what code you apply to Toolset Forms in that Theme.
I have no edit rights on your install to see the Theme's code.

I think then we can narrow down the issue, I suspect some bad format of generic FIelds with JSON coupled with a validation or saving action in the code.

I enabled a private reply in case you share some sensitive data or code.