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.

Channel Entry PHP Error

May 02, 2012 11:35am

Subscribe [2]
  • #1 / May 02, 2012 11:35am

    Phil Ecker

    78 posts

    I’m running EE 2.3.1 and have a channel which stores entries from CartThrob. I’ve been in contact with them, and they are saying the error I’m experiencing isn’t coming from CartThrob so I hope you can help. The error is below, currently just have a input with a type of text, inputing a unix timestamp (1335963600).

    Also the Date is correct in the CMS, but get the error at the top of the entry.

    A PHP Error was encountered
    Severity: Notice
    Message: Undefined index: y
    Filename: libraries/Localize.php
    Line Number: 475
  • #2 / May 02, 2012 2:08pm

    Phil Ecker

    78 posts

    Also I’ve take some of the code from a page that has a safe cracker form and added the jQuery UI Datepicker used by EE, and added it to this form. Have it working on the front end. When I select a date, it displays in the input like (2012-05-17 1:04 PM). But when I submit that entry, I still get the PHP error above, but the date is being displayed in the channel entry like (1970-01-01 01:33 AM).

  • #3 / May 02, 2012 2:10pm

    Phil Ecker

    78 posts

    Any help would be greatly appreciated.

  • #4 / May 03, 2012 10:15am

    Dan Decker

    7338 posts

    Hey Phil,

    Sorry for the trouble you are having here!

    Let me make sure I’ve got the scenario straight.

    You have a channel, that you are using for CartThrob.

    In that channel you have a *plain* text input fieldtype, not a date fieldtype.

    When you submit and entry via the Control Panel, you see the error, but via SafeCracker the entry submits. However, the date is wrong and you *still* see the error when viewing that entry in the Control Panel.

    Did I cove all the bases?

    So, with the above, why are you using a text input vs. a date type? It shouldn’t matter, but I just want to get the scenario straight.

    Will you share the SafeCracker template and the HTML output of that template? I’d like to see what we should expect vs. what we are getting.

    Cheers,

  • #5 / May 03, 2012 10:17am

    Phil Ecker

    78 posts

    No, I’m sorry I worded that incorrectly, it is a date fieldtype. And I’m not using SafeCracker just the checkout form from CartThrob. My mention of SafeCracker was just in the fact I want my input for my date field to work like a SafeCracker form with the jQuery UI Datepicker. Thanks.

  • #6 / May 03, 2012 10:18am

    Phil Ecker

    78 posts

    Template for CartThrob checkout.

    {if logged_in}
          <h3>Once you click Checkout, your order will be emailed to Collins Printing.</h3>
    <p>      {exp:cartthrob:checkout_form id="checkout-form" name="checkout-form" return="apparel/thank-you"}<br />
           {exp:member:custom_profile_data}<br />
               <input type="hidden" name="ordered_by" value="{member_firstname} {member_lastname}" /><br />
           {/exp:member:custom_profile_data}<br />
            <input type="hidden" name="ordered_by_email" value="{email}" id="ordered_by_email" /><br />
            <br />
          <label for="ship_to">Ship To:</label> <br />
                 <select name="ship_to" id="ship_to"><br />
            <option value="Cahokia">Cahokia</option><br />
            <option value="Caseyville">Caseyville</option><br />
            <option value="Collinsville">Collinsville</option><br />
            <option value="East Alton">East Alton</option><br />
            <option value="East Belleville">East Belleville</option><br />
            <option value="Edwardsville">Edwardsville</option><br />
            <option value="Fairview Heights">Fairview Heights</option><br />
            <option value="Highland">Highland</option><br />
            <option value="Mascoutah">Mascoutah</option><br />
            <option value="Millstadt">Millstadt</option><br />
            <option value="OFallon">OFallon</option><br />
            <option value="Scott AFB">Scott AFB</option><br />
            <option value="Troy">Troy</option><br />
            <option value="Waterloo">Waterloo</option><br />
            <option value="West Belleville">West Belleville</option><br />
           </select><br />
           <label for="ship_to">Billing:</label>      <br />
           <select name="billing" id="billing"><br />
            <option value="Employee">Employee</option><br />
            <option value="Employee Reorder">Employee Reorder</option><br />
            <option value="(SCU) New Employee">(SCU) New Employee</option><br />
            <option value="(SCU) Event">(SCU) Event</option><br />
           </select></p>
    
    <p>      <label for="event_hire_date">Event/Hire Date:</label>  <br />
          <input type="text" name="event_hire_date" class="datepicker" maxlength="23" /></p>
    
    
    
    <p>      </p>
    
    <p>          <input type="submit" value="Submit" id="submit-order" /><br />
          {/exp:cartthrob:checkout_form}<br />
         {if:else}<br />
          </p><h3>To complete the checkout of your order you must Log In.</h3>
    <p>     {/if}

  • #7 / May 04, 2012 4:04pm

    Dan Decker

    7338 posts

    Hi Phil,

    No worries!

    First, I’ve only ever had luck with the datepicker showing up on entry date fields, never have been able to get it to work on custom date fields.

    If it *will* work, you will need to make sure that jQuery and jQuery UI are loaded for this template. Also, be sure to include the SAEF assets if you wish for it to be styled.

    If that doesn’t sort it out, you might need to look at a custom solution.

    Cheers,

  • #8 / May 04, 2012 5:29pm

    Phil Ecker

    78 posts

    Dan,

    My issue wasn’t with getting Datepicker to work, I had that working just fine. My issue was getting an error (First Post) when my fieldtype was set to date, I ended up changing my fieldtype to text, and just inserting the date into that field which gets rid of the error, would still like to know why when I try to submit a date to a fieldtype of date, I get the above error. Thanks.

    -Phil

  • #9 / May 07, 2012 5:38pm

    Dan Decker

    7338 posts

    Hey Phil,

    Looking this one over again, it would seem to be an incompatibility with the date field type and the submission that the CartThrob form is making.

    Have you contacted them with this question as well?

    Cheers,

  • #10 / May 30, 2012 9:42am

    Phil Ecker

    78 posts

    Dan,

    Contacting CartThrob was the first thing that I did, never figured out why… but using plain text field is working just fine for me. You can mark this as closed. Thanks.

    -Phil

  • #11 / May 31, 2012 3:56pm

    Shane Eckert

    7174 posts

    Hey! It’s Phil!

    Glad things worked out!

    If you need anything else, please just let me know by opening a new thread.

    Cheers,

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

ExpressionEngine News!

#eecms, #events, #releases