ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

EE Choking on Long Form

August 05, 2011 1:47pm

Subscribe [5]
  • #1 / Aug 05, 2011 1:47pm

    The Design Core

    359 posts

    I have an extremely long form that EE can’t seem to process in my template.

    It gives me the following errors when I try to save my template:

    A PHP Error was encountered
    
    Severity: Notice
    
    Message: Undefined index: template_data
    
    Filename: cp/design.php
    
    Line Number: 2048
    
    A PHP Error was encountered
    
    Severity: Warning
    
    Message: Cannot modify header information - headers already sent by (output started at /home/hosting/webs/headsup/beta.heads-up.com/web/engine/codeigniter/system/core/Exceptions.php:170)
    
    Filename: core/Common.php
    
    Line Number: 409
    
    A Database Error Occurred
    
    Error Number: 1048
    
    Column 'item_data' cannot be null
    
    INSERT INTO `exp_revision_tracker` (`item_id`, `item_table`, `item_field`, `item_data`, `item_date`, `item_author_id`) VALUES ('18', 'exp_templates', 'template_data', NULL, 1312562722, 1)
    
    Filename: controllers/cp/design.php
    
    Line Number: 2053

    I can post the form code if the above doesn’t help troubleshoot the issue, but it is extremely long.

    Thanks for any help.

  • #2 / Aug 06, 2011 8:40pm

    Dan Decker

    7338 posts

    Hi there mediapimp,

    Providing your template code may be the only way we can help trouble shoot. Don’t worry about it being “too long” 😉

    Be sure to wrap your code in

    [code]

    </code></pre>
    tags and we’ll take a look over it.

    Thanks,

  • #3 / Aug 12, 2011 6:24pm

    The Design Core

    359 posts

    Well, it was too long and exceeded the character limit so I attached it.

    Thanks for taking a look.

  • #4 / Aug 15, 2011 3:41pm

    Dan Decker

    7338 posts

    Hi mediapimp,

    Wow, you weren’t kidding. That is one long form. What version of ExpressionEngine is causing this issue? You are seeing this error when trying to save this form in a template via the Control Panel? What are you using to process the form? Have you tried saving the template out as a file? I was able to save your code into a template via the Control Panel in my local install of ExpressionEngine 2.2.2.

    Follow up with me and we’ll get this sorted out.

    Cheers,

  • #5 / Aug 15, 2011 5:21pm

    wornjacket

    98 posts

    One solution would be to break up the form fields into embedded templates. For instance you could setup the Contact Information

    Name,Address, City, State, Phone, Email into its own template. Then embed that within your actual form page.
    Each section could be setup this way. So your form would look something like:

    <form>
    {embed="forms/.category_info"}
    {embed="forms/.custom_info"
    {embed="forms/.contact_info"}
    </form>

  • #6 / Aug 15, 2011 6:34pm

    The Design Core

    359 posts

    The EE version is 2.2.1 - Build: 20110705.

    Yes, when I try to save the template I get the error. Using some jQuery to process the form. I have not tried saving it out as a file.

    Thanks for your help.

    Brandon, thanks for the suggestion. I’ll give it a shot.

  • #7 / Aug 16, 2011 5:35pm

    The Design Core

    359 posts

    Tried splitting it up into embedded templates. Still choking.

  • #8 / Aug 17, 2011 1:09pm

    Sue Crocker

    26054 posts

    Hi, mediapimp. You may need to change the file type for that particular field from MediumText to LongText. (template_data). Does that help?

  • #9 / Aug 17, 2011 7:20pm

    The Design Core

    359 posts

    I’m not sure I follow. Where/how do I do that?

  • #10 / Aug 19, 2011 3:33pm

    Kevin Smith

    4784 posts

    I wouldn’t worry about that, mediapimp. That involves work directly on the database, and I’m not sure that’s even the problem.

    It does sound like EE is choking when submitting the template, but since you’ve split it up and it’s still causing you a problem, let’s try a few things:

    1) Upgrade to the latest version just to make sure we’re working on the same page. If you’ve discovered a bug, we want to make sure it’s a bug in the current release of EE.

    2) Continue breaking it down into the smallest chunks possible. What I’m doing here is trying to narrow down exactly *what* in the templates is causing EE problems. Having already broken it down into smaller chunks, it doesn’t look like the length of the form is the root of the problem. So let’s find out what is.

    3) Does the same thing happen when you set this template to be a flat file?

  • #11 / Aug 19, 2011 5:38pm

    The Design Core

    359 posts

    The same thing happens when set to be a flat file.

  • #12 / Aug 19, 2011 11:02pm

    The Design Core

    359 posts

    So I split it up into 500 line chunks and it worked!

    So it does seem the length was the issue.

    Bug in EE?

  • #13 / Aug 22, 2011 6:29pm

    Kevin Smith

    4784 posts

    I doubt it, I’ve had much longer templates that had no problems saving. But let’s find out before we dismiss that.

    Do you recall how long your longest template was before it gave you any errors? And were the errors contained to any one template or was it all the broken up templates until they were under a certain number of lines?

  • #14 / Aug 28, 2011 11:35am

    The Design Core

    359 posts

    I really don’t recall.

    I really appreciate the help in further looking into this this but since it is now working I’ve had to move on with the project and don’t really have the time to go back and retry it a bunch of times to see how many lines it takes to make it choke.

    I’m certainly not trying to be unhelpful or unappreciative of your help, so please don’t interpret this in that way. I’ve just spent too much time on it already.

    Thanks again.

  • #15 / Aug 28, 2011 5:20pm

    Kevin Smith

    4784 posts

    Oh, no problem at all! Just wanted to let you know that we’re willing to chase this down further if you had the time, but I certainly understand needing to move on to other things. Let us know if there’s anything else we can do!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases