Skip Navigation

[Closed] Invalid Form Submission (maybe a file has a size greater than allowed)

This support ticket is created 7 years, 11 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Hong_Kong (GMT+08:00)

This topic contains 7 replies, has 2 voices.

Last updated by Luo Yang 7 years, 11 months ago.

Assisted by: Luo Yang.

Author
Posts
#392272

Hi. I am trying to create a submission for a post with a custom redirect but I get this error: Invalid Form Submission (maybe a file has a size greater than allowed).

The post still seems to be created but the redirect doesn't happen and the error remains.

What could be causing this?

Please refer to form 2707

//Redirect teh create new listing form with token and postID in the url in order to update the db and mark the token as claimed.
add_filter('cred_success_redirect', 'newlisting_custom_redirect',10,3);
function newlisting_custom_redirect($url, $post_id, $form_data)
{
    if ($form_data['id']==1988){
        return '<em><u>hidden link</u></em>'.$_GET['token'].'&postid='.$post_id;
	  $url = '<em><u>hidden link</u></em>'.$_GET['token'].'&postid='.$post_id;
 
    return $url;
   
	} elseif($form_data['id']==2448){
	  return '<em><u>hidden link</u></em>'.$_GET['token'].'&postid='.$post_id;
		 $url = '<em><u>hidden link</u></em>'.$_GET['token'].'&postid='.$post_id;
 
    return $url;
   
	} elseif($form_data['id']==2707){ //455 x 145px
	  return '<em><u>hidden link</u></em>'.$_GET['token'].'&postid='.$post_id;
		 $url = '<em><u>hidden link</u></em>'.$_GET['token'].'&postid='.$post_id;
 
    return $url;
	}
}
#392375

Dear david,

The error message means this:
1) This happens when the form is submitted but no data was posted
2) We are trying to upload a file greater then the maximum allowed size

Since there is a error when the user submit the CRED form, so it will not trigger the filter hook "cred_success_redirect".

#392384

Hi Luo.

Thank you for the information. I do not have any validations on the form to prevent the file from being uploaded. I uploaded a 65b file, so it is definitely not too big. I am able to upload up to like 2mb files elsewhere on the site.

So if it is a case that no data was posted, what would cause that? Is it maybe a conflict with the redirect hook or do I need to put a validation on it to force the file size?

It works fine on other CRED forms like 1988 in the above code.

#392431

I can not duplicate same problem in my localhost, please you try these:
1) Deactivate other plugins and switch to wordpress default theme 2016, and test again
2) Enable PHP debug mode, copy/paste the debug logs here.
PHP Debugging
In case you think that Types or Views are doing something wrong (what we call a bug), you should enable PHP error logging. Again, edit your wp-config.php file and add the following:

ini_set('log_errors',TRUE);
ini_set('error_reporting', E_ALL);
ini_set('error_log', dirname(__FILE__) . '/error_log.txt');
This will produce a file called ‘error_log.txt’ in your WordPress root directory. Make sure that the web server can create and write this file. If it cannot, use an FTP program to create the file and make it writable to Apache (normally, user www-data).
https://toolset.com/documentation/user-guides/debugging-types-and-views/

#392466
Screen Shot 2016-04-26 at 12.16.15 PM.png
Screen Shot 2016-04-26 at 12.19.35 PM.png

Thank you. While I do that I have another issue.

Since I have updated to the latest toolset version, some of my CRED forms have crashed. I have not changed anything. In an older version on my local it works. Has something changed with the naming system or something?

The following code is exactly the same on my local and online, the only difference is that online has the new version of Toolset. I have a feeling that this could be affecting the above problem because it works on my local and not online with the new version.

[wpv-layout-start]
	[wpv-items-found]
	<!-- wpv-loop-start -->
<ul class="check-reviews-list" id="changingArea">
		<wpv-loop>
          <li class="desc" id="[wpv-post-slug]">[wpv-post-link]
            <div class="portfolio-blocks">
                <div class="portfolio-blocks-details">
                    <label>Company Logo</label>
                  <p>Logo size is 300px x 300px with a maximum file size of 2mb. <i>* Please note that changing this will also change the logo on your business listing.</i></p>
                </div><!--- End .portfolio-blocks-details --->
                
                <div class="portfolio-blocks-img">
                  [types field="company-logo" size="medium" align="none" resize="crop" id="$business-listing"][/types]
                </div><!--- End .portfolio-blocks-img --->
              <div class="toggle manage-accred-edit-from">
            	<a href="#" title="Edit My Company Logo" class="toggle-trigger">Edit My Company Logo</a>
          		<div class="manage-accred manage-accred-edit-from toggle-content">
            		[cred_form form="2772" form_name="My Portfolio - Company Logo"]
            		<div class="clear"></div>
            	</div> <!--- End .manage-accred .manage-accred-edit-from .toggle-content --->
            </div><!--- End .toggle .manage-accred-edit-from --->
         	<div class="clear"></div>
            </div><!--- End .portfolio-blocks --->
            
            [wpv-view name="child-post-with-the-items-in-portfolio"]
            [wpv-view name="child-post-with-the-items-in-portfolio-ad-455x145"]
            [wpv-view name="child-post-with-the-items-in-portfolio-ad-370x145"]
            [wpv-view name="child-post-with-the-items-in-portfolio-ad-145x145"]
            [wpv-view name="child-post-with-the-items-in-portfolio-ad-300x300"]
            [wpv-view name="child-post-with-the-items-in-portfolio-ad-162x643"]
            <div class="clear"></div>
          </li>
		</wpv-loop>
</ul>
	<!-- wpv-loop-end -->
	[/wpv-items-found]
	[wpv-no-items-found]
		<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
	[/wpv-no-items-found]
[wpv-layout-end]

#392821

I did not see similar report, and here is the change logs of CRED plugin:
https://toolset.com/download/toolset-cred/#changelog

I suggest you try as I mentioned above:
https://toolset.com/forums/topic/invalid-form-submission-maybe-a-file-has-a-size-greater-than-allowed-2/#post-392431

#397521

Hi Luo.

I believe this view is crashing my website and I can't see why. Can you please have a look through and see if you can pick up anything that may be incorrect? When I try make changes I get the following error: "Data not Saved" and "One or more sections haven't been saved."

This view is within another view that gets a post belonging to the author.

[wpv-layout-start]
	[wpv-items-found]
	<!-- wpv-loop-start -->
		<wpv-loop>        
            <div class="portfolio-blocks manage-accred-oddrow">
                <div class="portfolio-blocks-details">
                    <label>Business Cards</label>
                    <p>Business card size is 90mm x 50mm with a maximum file size of 2mb.</p>
                </div><!--- End .portfolio-blocks-details --->
                
                <div class="portfolio-blocks-img">
                    [types field="business-card" size="full" align="none"][/types]
                  [wpv-conditional if="( $(wpcf-business-card) eq '' )"]<img src="<em><u>hidden link</u></em>" class="size-full" />[/wpv-conditional]
                </div><!--- End .portfolio-blocks-img --->
                
              <div class="toggle manage-portfolio-edit-from">
            	<a href="#" title="Edit My Business Cards" class="toggle-trigger">Edit My Business Cards</a>
          		<div class="manage-accred manage-accred-edit-from toggle-content">
            		[cred_form form="2752" form_name="My Portfolio - Business Cards"]
            		<div class="clear"></div>
                </div><!--- End .toggle .manage-accred-edit-from --->
                    
                  	[wpv-conditional if="( $(wpcf-business-card) eq '' )"]dsgfadsf
                    	<a href="#" title="Add Business Cards" class="toggle-trigger">Add Business Cards</a>
                        <div class="manage-accred manage-accred-edit-from toggle-content">
                            [cred_form form="2752" form_name="My Portfolio - Business Cards"]
                            <div class="clear"></div>
                        </div> <!--- End .manage-accred .manage-accred-edit-from .toggle-content --->
                    [/wpv-conditional]
         	<div class="clear"></div>
            </div>
            </div><!--- End .portfolio-blocks --->
            
            <div class="portfolio-blocks">
                <div class="portfolio-blocks-details">
                    <label>Email Signatures</label>
                    <p>Business card size is 90mm x 50mm with a maximum file size of 2mb.</p>
                </div><!--- End .portfolio-blocks-details --->
                
                <div class="portfolio-blocks-img">
                    [types field="email-sig" size="full" align="none"][/types]
                  [wpv-conditional if="( $(wpcf-email-sig) eq '' )"]<img src="<em><u>hidden link</u></em>" class="size-full" />[/wpv-conditional]
                </div><!--- End .portfolio-blocks-img --->
                
                <div class="toggle manage-accred-edit-from">
            	<a href="#" title="Edit My Email Signatures" class="toggle-trigger">Edit My Email Signatures</a>
          		<div class="manage-accred manage-accred-edit-from toggle-content">
            		[cred_form form="2758" form_name="My Portfolio - Email Signatures"]
            		<div class="clear"></div>
            	</div> <!--- End .manage-accred .manage-accred-edit-from .toggle-content --->
            </div><!--- End .toggle .manage-accred-edit-from --->
         	<div class="clear"></div>
            </div><!--- End .portfolio-blocks --->
            
            <div class="portfolio-blocks manage-accred-oddrow">
                <div class="portfolio-blocks-details">
                    <label>A5 Flyers</label>
                    <p>The corporate identity is a brand guide/manual instructing us on how your logos, fonts and elements should be used.</p>
                </div><!--- End .portfolio-blocks-details --->
            
                <div class="portfolio-blocks-img">[types field="a5-flyer" link="true" title="View Flyer" separator=" " id="$portfolio"][/types]
                  [wpv-conditional if="( $(wpcf-corporate-identity) eq '' )"]<img src="<em><u>hidden link</u></em>" class="size-full" />[/wpv-conditional]
                </div><!--- End .portfolio-blocks-img --->
                
                <div class="toggle manage-accred-edit-from">
            	<a href="#" title="Edit My A5 Flyers" class="toggle-trigger">Edit My A5 Flyers</a>
          		<div class="manage-accred manage-accred-edit-from toggle-content">
            		[cred_form form="2754" form_name="My Portfolio - A5 Flyer"]
            		<div class="clear"></div>
            	</div> <!--- End .manage-accred .manage-accred-edit-from .toggle-content --->
            </div><!--- End .toggle .manage-accred-edit-from --->
         	<div class="clear"></div>
            </div><!--- End .portfolio-blocks --->
            
            <div class="portfolio-blocks">
                <div class="portfolio-blocks-details">
                    <label>A6 Flyers</label>
                    <p>The corporate identity is a brand guide/manual instructing us on how your logos, fonts and elements should be used.</p>
                </div><!--- End .portfolio-blocks-details --->
            
                <div class="portfolio-blocks-img">[types field="a6-flyer" link="true" title="View Flyer" separator=" " id="$portfolio"][/types]
                  [wpv-conditional if="( $(wpcf-corporate-identity) eq '' )"]<img src="<em><u>hidden link</u></em>" class="size-full" />[/wpv-conditional]
                </div><!--- End .portfolio-blocks-img --->
                
                <div class="toggle manage-accred-edit-from">
            	<a href="#" title="Edit My A6 Flyers" class="toggle-trigger">Edit Edit My A6 Flyers</a>
          		<div class="manage-accred manage-accred-edit-from toggle-content">
            		[cred_form form="2755" form_name="My Portfolio - A6 Flyer"]
            		<div class="clear"></div>
            	</div> <!--- End .manage-accred .manage-accred-edit-from .toggle-content --->
            </div><!--- End .toggle .manage-accred-edit-from --->
         	<div class="clear"></div>
            </div><!--- End .portfolio-blocks --->
        
            <div class="portfolio-blocks manage-accred-oddrow">
                <div class="portfolio-blocks-details">
                    <label>Brand Manual</label>
                    <p>The brand manual is a brand guide/manual instructing us on how your logos, fonts and elements should be used.</p>
                </div><!--- End .portfolio-blocks-details --->
            
                <div class="portfolio-blocks-img">
                    [types field="brand-manual" link="true" title="View Brand Manual" separator=" " id="$portfolio"][/types]
                  [wpv-conditional if="( $(wpcf-brand-manual) eq '' )"]<img src="<em><u>hidden link</u></em>" class="size-full" />[/wpv-conditional]
                </div><!--- End .portfolio-blocks-img --->
                
                <div class="toggle manage-accred-edit-from">
            	<a href="#" title="Edit My Corporate Identity" class="toggle-trigger">Edit My Brand Manual</a>
          		<div class="manage-accred manage-accred-edit-from toggle-content">
            		[cred_form form="2756" form_name="My Portfolio - Corporate Identity"]
            		<div class="clear"></div>
            	</div> <!--- End .manage-accred .manage-accred-edit-from .toggle-content --->
            </div><!--- End .toggle .manage-accred-edit-from --->
         	<div class="clear"></div>
            </div><!--- End .portfolio-blocks --->
        
          <div class="clear"></div>
		</wpv-loop>
	<!-- wpv-loop-end -->
	[/wpv-items-found]
    
    
    
    
	[wpv-no-items-found]
		[wpml-string context="wpv-views"]
          <div class="portfolio-blocks manage-accred-oddrow">
                <p>You do not have any of the following portfolio items:</p>
                <ul>
                	<li>Business Cards</li>
                    <li>Email Signatures</li>
                    <li>A5 Flyers</li>
                    <li>A6 Flyers</li>
                    <li>Corporate Identity</li>
                </ul>
                
                <div class="toggle manage-accred-edit-from">
                    <a href="#" title="Add Portfolio Items" class="toggle-trigger">Add Portfolio Items</a>
                    <div class="manage-accred manage-accred-edit-from toggle-content">
                        [cred_form form="2760" form_name="My Portfolio - Add Portfolio"]
                        <div class="clear"></div>
                    </div> <!--- End .manage-accred .manage-accred-edit-from .toggle-content --->
                </div><!--- End .toggle .manage-accred-edit-from --->
                <div class="clear"></div>
                
            </div><!--- End .portfolio-blocks --->
        
          <div class="clear"></div>
          [/wpml-string]
<div class="clear"></div>
	[/wpv-no-items-found]
<br/>[wpv-layout-end]

#397830

Since you did not provide the debug logs, I am not sure where is the problem. Do you need help to get the debug logs?
1) Deactivate other plugins and switch to wordpress default theme 2016, and test again
2) Enable PHP debug mode, copy/paste the debug logs here.
PHP Debugging
In case you think that Types or Views are doing something wrong (what we call a bug), you should enable PHP error logging. Again, edit your wp-config.php file and add the following:

ini_set('log_errors',TRUE);
ini_set('error_reporting', E_ALL);
ini_set('error_log', dirname(__FILE__) . '/error_log.txt');
This will produce a file called ‘error_log.txt’ in your WordPress root directory. Make sure that the web server can create and write this file. If it cannot, use an FTP program to create the file and make it writable to Apache (normally, user www-data).
https://toolset.com/documentation/user-guides/debugging-types-and-views/

if you need assistance to get the debug logs, please duplicate same problem in a test site, and fill below private detail box with login details and ftp access, also point out the problem page URL and view url and CRED for URL, I need a live website to test and debug.

The topic ‘[Closed] Invalid Form Submission (maybe a file has a size greater than allowed)’ is closed to new replies.