Home > Magento, jQuery > Undefined index year in Date.php on line 2614

Undefined index year in Date.php on line 2614

October 7th, 2008

The other day I came across this little bug in Magento 1.1.6. After setting the products special price and clicking Save and continue Edit, then after adding some additional input to product and clicking the Save and continue Edit i got the following error Undefined index year… in Date.php on line 2614.

If you look at the screenshot you can see that there is a bug on the Prices tab, where upon each Save and continue Edit, Magento does not pool the year value into the Special Price From Date and Special Price to Date fields. Its missing the middle year value. So basically what you need to do is to set it up upon each Save and continue Edit.

Interesting? Share it!
  • Digg
  • del.icio.us
  • Google
  • Technorati
  • Facebook
  • TwitThis
  • description

Related articles

Magento, jQuery , , ,

  1. Magelover
    October 8th, 2008 at 00:51 | #1

    Yeah, that’s a very annoying bug…hope they fix it for the next release

  2. October 13th, 2008 at 16:47 | #2

    Thank you for this. I looked all over Magento’s horrible forums and couldn’t find any mention of this. There were other references to this error related to mismatched local settings, but that wasn’t my case.

  3. Mike
    October 26th, 2008 at 00:31 | #3

    Looks like somebody reported the issue here:

    http://www.magentocommerce.com/bug-tracking/issue/?issue=2924

    but the Magento team was unable to reproduce it so they closed the ticket. I’m not sure why they considered it “Resolved”, though. I’m still experiencing the problem in 1.1.6.

  4. Namitha
    November 10th, 2008 at 07:14 | #4

    ../magento/app/code/core/Mage/Core/Model/Locale.php lines 379 to 381. Change the following:

    $convert = array(’yyyy-MM-ddTHH:mm:ssZZZZ’=>’%c’, ‘EEEE’=>’%A’, ‘EEE’=>’%a’,'D’=>’%j’,
    ‘MMMM’=>’%B’, ‘MMM’=>’%b’, ‘MM’=>’%m’, ‘M’=>’%m’, ‘dd’=>’%d’,
    ‘d’=>’%e’, ‘yyyy’=>’%Y’, ‘yy’=>’%y’);

    to the folowing code:

    $convert = array(’yyyy-MM-ddTHH:mm:ssZZZZ’=>’%c’, ‘EEEE’=>’%A’, ‘EEE’=>’%a’,'D’=>’%j’,
    ‘MMMM’=>’%B’, ‘MMM’=>’%b’, ‘MM’=>’%m’, ‘M’=>’%m’, ‘dd’=>’%d’,
    ‘d’=>’%d’, ‘yyyy’=>’%Y’, ‘yy’=>’%y’);

    Note the ā€˜d’=>’%d’ in the third line of code makes all the difference. Now, all your dates will work properly now.

  5. Eu
    November 12th, 2008 at 11:00 | #5

    The bug is caused by locale settings and it appears only when you use a certain date format, for example the US standard format(mm/dd/yyyy) triggers it. Namitha’s modification seems to fix it. Tnx

  1. No trackbacks yet.