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.

Won't Save New Entries for a New Channel

August 29, 2011 5:08pm

Subscribe [3]
  • #1 / Aug 29, 2011 5:08pm

    Waldo Jaquith

    30 posts

    I’m attempting to post a first-ever entry in a channel, and it’s failing silently.

    I am logged in under the admin account (the only account that I use). A few months ago I created a channel called “Presidents,” which has seventeen custom fields. None are interesting or complicated—just date, textarea, and text input fields. Only a half dozen are required. This channel has no associated templates, it isn’t assigned to any category groups, and it has entry versioning enabled. Attempting to create the first entry, it fails every time. I complete all required fields, hit “Submit,” and the page reloads. No error message is displayed, and the entry is not saved. The title still reads “New Entry: Presidents.” I’ve tried completing all fields, regardless of whether they’re required, and it fails just the same.

    A few data points, some because they’re obviously necessary to debug this, others that I suspect are useful based on ~45 minutes of reading forum posts on this topic:

    * the discussion forum module is not installed
    * this entry is not listed in the Pages module
    * no error is recorded in the HTTP log
    * $debug = 1 in system/index.php
    * I’m running v2.2.2, build 20110801
    * 128MB of RAM is permitted for each PHP process
    * add-ons are Pages, AJW DataGrab, Wygwam, CP Analytics, Facelift, and eMarketSouth String Plugin

    Output Profiler didn’t provide anything that seemed useful. The content within all fields was posted appropriately. Among the 48 (!) SQL queries, there was just one insert (INSERT INTO exp_security hashes) and one update (UPDATE `exp_sessions`). Also, $_POST[‘entry_id’] = 0, and class/method = “content_publish/entry_form”.

    I’m not sure of what else to try at this point. Any ideas?

  • #2 / Aug 30, 2011 12:59am

    Dan Decker

    7338 posts

    Waldo,

    Let’s start with the add-ons. Have you insured that all of your add-ons are up-to-date and compatible with EE 2.2.2? That would be the first place to look. Check for updates and let us know the results.

    Cheers,

  • #3 / Aug 30, 2011 10:23am

    Waldo Jaquith

    30 posts

    I went through every add-on, and for each one I either verified that I was running the latest version or, if I could not (or I didn’t feel confident that the latest version would necessarily be compatible with v2.2.2), I disabled it. After going through this process for all add-ons, I still cannot save an entry in this category.

    Because I did not make this explicit before, please note that I can save entries in other channels without difficulty. It is only in this one channel that I am having this problem.

  • #4 / Aug 30, 2011 8:36pm

    Dan Decker

    7338 posts

    Waldo,

    Are you using any custom Publish page layouts on this Channel? If so, have you tried resetting those? In the Publish page, click “Show Toolbar” and then near the bottom click “Reset Layout”. Let us know your results please.

    Cheers,

  • #5 / Sep 01, 2011 2:34pm

    Waldo Jaquith

    30 posts

    That’s a feature that I’ve never used, so no. But, just in case, I followed your instructions. Unfortunately, it made no difference.

  • #6 / Sep 01, 2011 4:34pm

    Waldo Jaquith

    30 posts

    I’ve figured out the problem. There’s a bug in ExpressionEngine’s error handling for date fields.

    Here’s how you replicate it:

    Publish a new entry with a channel that has a required date field. Complete all required fields. For the date, manually enter “1900-01-01”. Submit the form. The form will submit, but redisplay. No error will be displayed. Now append the time to the date (“1900-01-01 12:00 AM”) in precisely the correct format. Resubmit the form. It will work.

    There are four problems with this approach:

    1. It is perfectly logical to type in a text field when presented with one. Because the date entry JavaScript widget does not pop up until after a brief delay, there’s plenty of time for somebody to start typing, and thus remain unaware that there is another input method.

    2. The JavaScript widget is impractical for the vast majority of dates that have ever existed. I’m attempting to enter Ronald Reagan’s birthdate, for instance. Using this widget, I’d have to click in the field, wait for the widget to come up, and then click the left arrow (to go back one month) over 1,200 times to get back to Reagan’s birthdate in 1911. That, obviously, is wholly impractical.

    3. The date fields insists on a time. I do not know or care at what time that Reagan was born. That’s why I used a “date” type in the Channel Field. MySQL divides these two types of fields into “date” and “datetime.” ExpressionEngine is using a “datetime” field while claiming to be using a “date” field. This is confusing and, for most applications, requires the specification of a level of detail beyond that which is available or useful. That’s why the JavaScript widget inserts, by default, the current time after the selected date, and has no capacity to select the time. That behavior says everything about the problem here.

    4. The JavaScript widget does not always pop up. I cannot discern any pattern as to why it sometimes shows up and sometimes does not, but about one in four times, clicking in the field results in no widget at all. Requiring the display of something unreliable in order to prevent the inexplicable failure of a form entry is probably not a great idea.

    I suggest the following steps to solve this problem:

    1. Rename the “date” Channel Field to “datetime.” Then create a new Channel Field called “date.”  Each should work as one would expect.
    2. Create an error handler for the existing “date” field, rather than assuming that the JavaScript widget will enforce proper formatting within the field.
    3. Since ExpressionEngine’s control panel is in HTML5 anyhow, consider switching the front-end validation to HTML5’s “pattern” attribute for input validation at the time of entry. You might also consider using HTML5’s native date picker (invoked with <input type=“date”>) instead of the JavaScript date picker when the browser supports it.

  • #7 / Sep 02, 2011 1:37am

    Dan Decker

    7338 posts

    Waldo,

    Thank you for your suggestions. I’m bringing this thread to the attention of the Devs.

    Is there anything else we can assist you with?

    Cheers,

  • #8 / Sep 02, 2011 10:06am

    Waldo Jaquith

    30 posts

    Nope, I’m good. Thanks, Dan.

  • #9 / Sep 03, 2011 12:29am

    Kevin Smith

    4784 posts

    Glad to hear it, Waldo! I’ll close this one up.

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

ExpressionEngine News!

#eecms, #events, #releases