Skip Navigation

[Cerrado] Error when using 2 times the same form in the page

This support ticket is created hace 2 años, 2 meses. 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.

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

Este tema contiene 14 respuestas, tiene 3 mensajes.

Última actualización por Minesh hace 2 años, 2 meses.

Asistido por: Minesh.

Autor
Mensajes
#2448487

Pat

Hello,
I have created a Views to list some posts and have integrated a Cred form inside each result in order to be able to modify some parameters. I'm using a modal window in order to be able to make the modification inside the same page. Here is the code of the loop :

[wpv-post-date format="Y/m/d"] [types field="nom-de-l-evenement" id="[types field='id-du-produit-achete'][/types]"][/types] [types field="type-d-evenement" id="[types field='id-du-produit-achete'][/types]"][/types] [types field="tarif-du-produit-achete"][/types] [types field='moyen-de-paiement'][/types] <a class="et_pb_button" style="cursor: pointer;" rel="noopener noreferrer" type="button" data-toggle="modal" data-target="#paiement[wpv-post-id]">Paiement</a>
<div id="paiement[wpv-post-id]" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel2" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-body">[types field='type-d-evenement'][/types]<br />
[wpv-conditional if="( $(type-d-evenement) eq 'Adhésion' )"][cred_form form='backoffice-modif-adhesion'][/wpv-conditional]
<p> </p>
</div>
<div class="modal-footer"><button class="btn btn-secondary" type="button" data-dismiss="modal">Fermer</button>
</div>
</div>
</div>
</div>*

This works fine until there are more than one result. In this case, I'm getting the WordPress global error.

The Cred form is :

[credform]
	[cred_field field='form_messages' class='alert alert-warning']
<div class="col-sm-12"><h2 style="text-align:center;padding-top:50px;">Validation du paiement de l'adhésion de l'adhérent : [types usermeta='civilite'][/types] <span style="text-transform: capitalize;">[wpv-user field="user_firstname" id="[wpv-user field='ID']"]</span> <span style="text-transform:uppercase;">[wpv-user field="user_lastname" id="[wpv-user field='ID']"]</span></h2>
  
  Type d'adhésion : [types field='type-adhesion'][/types]</br>
	<div class="form-group">
		<label>Moyen de paiement</label>	
[cred_field field="moyen-de-paiement" force_type="field" class="form-control" output="bootstrap"]
  </div>
<div class="form-group">
		<label>Date</label>	
[cred_generic_field type='date' field='set-new-date' class="form-control" output="bootstrap"]
{
"required":0,
"persist":1,
"validate_format":0
}
[/cred_generic_field]
  </div>
[cred_field field='form_submit' output='bootstrap' value='VALIDER' class='et_pb_button']
</div>

[/credform]

If I uncheck the "Submit this form without reloading the page (use AJAX)", then this is working but the page is not reloaded and the modification is not seenable. If I check it, then I'm getting the WordPress global error.

Any idea?
Regards
Pat

#2448723

Nigel
Supporter

Idiomas: Inglés (English ) Español (Español )

Zona horaria: Europe/London (GMT+00:00)

Hi Pat

What do you mean by the WordPress global error?

Do you have details of what the error is? (From the browser console or from the PHP debug.log?)

#2448741

Pat

Hi again Nigel,

Thanks for helping.
No errors reported in the console. This is the new functionality of WordPress indicating the site has broken. This is only happening when the validation button of the Cred is clicked and when 2 lines are listed in the Views output (meaning 2 same Creds are also in place).
Regards
Pat

#2449193

Minesh
Supporter

Idiomas: Inglés (English )

Zona horaria: Asia/Kolkata (GMT+05:30)

Can you please share problem URL where I can see more than two results with the form as well as admin access details.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2449227

Pat

Hi Minesh,

Unfortunately, the site is into production with a high load.
As you can see in my first message, I have a Views that list postypes "Adhesion". For each result, in the Views loop, I have some info + a Cred form that opens in a modal window (the Cred is used to modify some custom fields of the "Adhesion" post). I want also to reload the page in order the modifications are visible after submitting the form, so I uncheck the "Submit the form with Ajax" button.
For info, I have used this kind of modal in different part of the site and it is working fine.
Coming back to this issue, if only 1 result is displayed by the Views, everything works fine. If more than 1 result are displayed, I'm getting a wordpress site broke error when I click on the validation button of the Cred form.
Last, if I check the "Submit form with Ajax" button, then no error and the Cred modifies the needed custom fields (but the page is not reloaded and modifications are not visible until I reload manually the page).
Any idea?
Regards
Pat

#2449247

Minesh
Supporter

Idiomas: Inglés (English )

Zona horaria: Asia/Kolkata (GMT+05:30)

As far as I remember, we do have issue before when you add the form within the view with modal box and use ajax submit but I need to make sure that if it's the same issue or different one.

Do you able to offer staging site or I can create sandbox site and you can create a test example for me using the sandbox site that should help me to see the issue.

#2449251

Pat

Hi Minesh
I'm open to create a "little" site using the same Views ans Cred form.
Just let me know how to access to this sandbox site.
Regards
Pat

#2451395

Pat

Hi Minesh,

Any news on how I can create this test site on your sandbox?
Regards
Pat

#2451435

Minesh
Supporter

Idiomas: Inglés (English )

Zona horaria: Asia/Kolkata (GMT+05:30)

Here is the sandbox site, you can auto-login to it using the following link:
- enlace oculto

You can setup/install plugins as required and setup a demo page where I can see the issue.

#2451477

Pat

Thanks Minesh,

I'm trying to import in your sandbox site the Views that I have created in my site but cannot find the right way for that.
Can you explain how I could do it?
Regards
Pat

#2451485

Minesh
Supporter

Idiomas: Inglés (English )

Zona horaria: Asia/Kolkata (GMT+05:30)

Can you try to install the module manager and then try to export the post types, custom fields, views etc..etc.. you created and then try to import it on sandbox site I shared. (you should also install module manager plugin on sandbox site as well).

You can download it from the following link:
https://toolset.com/download/toolset-module-manager/

#2453611

Pat

Hi Minesh,

I need some time to install the site. I will update you as soon as it is ready in the sandbox.
Regards
Pat

#2453811

Minesh
Supporter

Idiomas: Inglés (English )

Zona horaria: Asia/Kolkata (GMT+05:30)

Ok sure. Take you time and please let me know once you setup the things.

#2458979

Pat

Hi Minesh,

Sorry but I have not found the time to setup the sandbox site. May I have some additional time?
Regards
Pat

#2460473

Minesh
Supporter

Idiomas: Inglés (English )

Zona horaria: Asia/Kolkata (GMT+05:30)

Sure, you can get in touch with me whenever you would like to setup the sandbox site.

El debate ‘[Cerrado] Error when using 2 times the same form in the page’ está cerrado y no admite más respuestas.