Skip Navigation

[Resolved] WordPress PHP Error – CRED FORM Submission

This thread is resolved. Here is a description of the problem and solution.

Problem:
Wordpress PHP Error - CRED FORM Submission

Solution:
There was issue how user has added the Types shortcode that displays the image.

You can find the proposed solution in this case with the following reply:
https://toolset.com/forums/topic/wordpress-php-error-cred-form-submission/#post-1386613

Relevant Documentation:

This support ticket is created 5 years, 1 month 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
- 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)

This topic contains 9 replies, has 2 voices.

Last updated by sergeP 5 years, 1 month ago.

Assisted by: Minesh.

Author
Posts
#1383927

Hello,

I have a problem with the CRED form submission.
When I create a new artist, with the cred form ID: 86122 on the page hidden link , the all website crash.

After submission, the form does not redirect while it should but the custom post is correctly created. The all website then kind of crash. All the pages acts strangely and the wordpress top bar disappear. When I delete the post, the website works correctly again.

Could you help with this matter ?

Best regards,
Damien

PS : Here is the code of the CRED form :

[credform]
<div class="container-fluid">
	<div class="row">
		<div class="col-sm-12">
			<div class="titre"> <strong>Soyez attentif !</strong> <br><br>

  <i>Ces renseignements sont importants pour vous faire connaitre auprès de 500 000 abonnés.</i><br><br>
          
                        --------------------------<br><br></div>
		</div>
	</div><br>

  <div class="titre"> <h3>Informations Générales</h3></div><br>  
	<div class="row">
		<div class="form-group col-sm-6">
			<label>Nom du Groupe ou de l'Artiste</label>
			[cred_field field='post_title' class='form-control' output='bootstrap']
		</div>
	
  <div class="form-group col-sm-6">
			<label>Genre Musical</label>
			 [cred_field field='genre-musical' force_type='taxonomy' output='bootstrap' display='select' single_select='true']
		</div>
 </div>
	<div class="row">
		<div class="form-group col-sm-12">
			<label>Avez vous un Manager ?</label>
          <i>Information confidentielle</i>
			[cred_field field='avez-vous-manager' force_type='field' class='form-control' output='bootstrap']
		</div>
	</div>
  <br>  
<div class="titre">         
                --------------------------<br><br>
<h3>Localisation du Groupe ou de l'artiste</h3><br>
<i>Permet d'envoyer en priorité, des nouvelles de vos concerts, chansons et plus, aux influenceurs, professionnels et passionnés de chanson française dans votre région.</i>
  </div>
  <br> 
          <div class="row">
	<div class="col-sm-4"><label>Pays</label>
			[cred_field field='@pays-groupe-chanteur-artiste-suivre.child' class='form-control' output='bootstrap' select_text='Rechercher un Pays']</div>
	<div class="col-sm-4"><label>Département</label>
			[cred_field field='@chanteur-et-groupes-a-suivre-departement.child' class='form-control' output='bootstrap' select_text='Rechercher un Département']</div>
	<div class="col-sm-4"><label>Ville</label>
			[cred_field field='@chanteur-et-groupes-a-suivre-ville.child' class='form-control' output='bootstrap' select_text='Rechercher une Ville']</div>
</div>
<br><br>  

<div class="titre">      
                        --------------------------<br><br>
  <h3>Description de l'artiste ou du groupe</h3>
<i>Ces informations seront consultées par des professionnels et des influenceurs mais aussi par les découvreurs de talents et tout autre utilisateurs du site.</i></div>
  
  <br><br>  
  
  <div class="raw">
  		<div class="form-group col-sm-6">
			<label>Description en 3 mots</label>
			[cred_field field='description-artiste-trois-mots' force_type='field' class='form-control' output='bootstrap']
		</div>
  		<div class="form-group col-sm-6">
			<label>Citation du groupe ou de l'artiste</label>
			[cred_field field='citation-artiste-groupe' force_type='field' class='form-control' output='bootstrap']
    </div></div>
  
  <br><br><br><br><br>
		<div class="form-group col-sm-12">
			<label>Courte Description</label>
			[cred_field field='description-courte-artiste' force_type='field' class='form-control' output='bootstrap']<div id="chars">100</div>
		</div>
  
  <br><br><br><br><br>
  
  <div class="form-group col-sm-12">
    <label>Lien vidéo Youtube</label> <i> Liens vidéo uniquement. Les chaînes ne s'afficheront pas</i>
			[cred_field field='video-youtube-facebook' force_type='field' class='form-control' output='bootstrap']
		</div>
  
  <br><br><br><br><br>
  
		<div class="form-group col-sm-12">
			<label>Image du groupe ou de l'artiste</label>
			[cred_field field='image-principale-groupe' force_type='field' class='form-control' output='bootstrap']
		</div>

  <br><br><br><br><br>

		<div class="form-group col-sm-12">
			<label>Présentation du groupe ou de l'artiste</label>
			[cred_field field='description-longue-groupe-artiste-suivre' force_type='field' class='form-control' output='bootstrap']
		</div>
  <br><br><br><br><br><br> 
		<div class="col-sm-12">
			[cred_field field='form_submit' output='bootstrap' value='Envoi' class='btn btn-primary btn-lg']
		</div>
	</div>
  
[/credform]

CSS :
.titre
{
text-align: center;
}

JS :
(function($) {
$.fn.extend( {
limiter: function(limit, elem) {
$(this).on("keyup focus", function() {
setCount(this, elem);
});
function setCount(src, elem) {
var chars = src.value.length;
if (chars > limit) {
src.value = src.value.substr(0, limit);
chars = limit;
}
elem.html( limit - chars );
}
setCount($(this)[0], elem);
}
});
})(jQuery);

var elem = jQuery("#chars");
jQuery("textarea[name='wpcf-description-courte-artiste']").limiter(200, elem);

#1384153

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

I try to check with the problem URL you shared with your initial post but when I load that URL, I do not see any form with that. It looks like I need access details to see the form.

Can you please tell me what error you see? Is it JS error or PHP error?

What if you try to follow the basic debug step and share the error with me:

Could you please activate WP_DEBUG from the wp-config.php file and send me possible errors for review.
=> https://toolset.com/documentation/programmer-reference/debugging-sites-built-with-toolset/#php-debugging

The all website then kind of crash. All the pages acts strangely and the wordpress top bar disappear. When I delete the post, the website works correctly again.
==>
Do you mean its start working as expected when you delete the post you just created usingToolset form?

If you do not see any error yet, Please feel free to share access details and I will check further.

*** 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.

#1385979

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I checked the problem URL:
=> hidden link

I see that you are using the following form;
=> hidden link

The form is set to submit with AJAX and "After visitors submit this form" the setting is set to "Display a message instead of form".

Now, when I submit the form, it's submitted successfully without any issue and I also see the message that you set to display as per the form settings. Please check the following screenshot: hidden link

The only thing I've changed is the custom JS code you added, I've wrapped those two lines with jquery's ready event as given under:

jQuery(document).ready(function($){
  var elem = jQuery("#chars");
jQuery("textarea[name='wpcf-description-courte-artiste']").limiter(200, elem);

});

If you check in the backend, Toolset test 1 entry created successfully, Do I miss anything here or any specific steps I need to follow to reproduce the issue?
=> hidden link

#1385999
toolset-bug.png

Hello Minesh,

Thank you,
In fact, I know better understand where the problem come from.
The problem did not occur because you did not select a country, a region (departement) and a city.

I just created a new account and the problem happened again as you can see on the web page.
hidden link
To make it work cor

I beleive that it might be a problem with the post relationship country / region / cities.
Would It cause a problem if a user select a country, a region and a city that are not linked by the relationship ?
Example : Belgium, Region of Paris, London

Could it be the cause of the problem ?
Thank you in advance.

#1386119

Hello Minesh,

Another clear exemple.

VIEW : I have a simple filter view (hidden link).

WORDPRESS ADMIN : When I try to make modification with Elementor, it does not work and I have a "Critical Error Message"
hidden link

FRONT END : In front end, the all page is weird and I don't have any result in the filter view : hidden link

It looks like it is the same problem.
It is definitly a problem with Toolset views because when I delete the view going back to the classic editor of wordpress (as I cannot access the Elementor editor) the page acts normally again.

It might be a simple error from my side but I really cannot figure out what is the problem.
Thank you in advance for your help.

#1386137

Vidéo of the problem : hidden link

Thank you

#1386613

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Thank you for sharing the video. I can see the issue now. The issue is totally different than the ticket reported for the Toolset form's issue.

Ok - so, I checked the view you shared:
=> hidden link

The above view is using the view's template to display the output and within the template you added the image shortcode as given under:

 [types size="custom" width="200%" height="200%" field='image-de-la-chanson' title='%%TITLE%%' alt='%%ALT%%' align='center' resize='crop'][/types]
  [types size="custom" width="200%" height="200%" field='image-chanson-connue' title='%%TITLE%%' alt='%%ALT%%' align='center' resize='crop'][/types]

As you can see the height and width attribute value is set to 200% that was causing the issue. I'm not sure why its added.

I've changed the above shortcode as given under - you can change the shortcode if required.

 [types size="custom"  field='image-de-la-chanson' title='%%TITLE%%' alt='%%ALT%%' align='center' resize='crop'][/types]
  [types size="custom"  field='image-chanson-connue' title='%%TITLE%%' alt='%%ALT%%' align='center' resize='crop'][/types]

And now, I can see its working;
=> hidden link

I can see the admin bar and view the results.

#1386689

I see, so all of this is cause for such a simple problem.
Suprising that a simple CSS error causes such a critical wordpress admin error.
Thank you very much.

To end this matter could you just tell me how to modify the css correctly in Toolset while using Elementor ?
It seems that the while I added css to Toolset view, some parts of the css of the images are still getting the css style of

.elementor img {} 

Thank you in advance

#1386717

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I'm really glad to help and happy to find out the actual cause of the issue and that help you to resolve your issue.

We have a Doc that you should use as a reference to match the Elementor Style with Toolset.
=> https://toolset.com/documentation/user-guides/using-toolset-with-elementor-page-builder/matching-elementor-styling-when-using-toolset/

#1387943

My issue is resolved now. Thank you!