Undefined index year in Date.php on line 2614

In: Magento

7 Oct 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

5 Responses to Undefined index year in Date.php on line 2614

Avatar

Magelover

October 8th, 2008 at 12:51 am

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

Avatar

Brakk

October 13th, 2008 at 4:47 pm

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.

Avatar

Mike

October 26th, 2008 at 12:31 am

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.

Avatar

Namitha

November 10th, 2008 at 7:14 am

../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.

Avatar

Eu

November 12th, 2008 at 11:00 am

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

Comment Form

About this site

Branko Ajzele Welcome to ActiveCodeline. My name is Branko Ajzele. I'm 26-year-old, currently working as full time PHP web application developer at Inchoo (in partnership with Surgeworks). My special interest and expertise evolve mainly around Zend Framework, Doctrine ORM, Magento eCommerce platform and few other related technologies.

More about me?
View Branko Ajzele's profile on LinkedIn
  • Uwe Stoll: Thanks for your valuable advice. Furthermore, I found it be important to use the backend generated [...]
  • Danny: Ah. I think I figured it out.. But 1 thing.. How can I have it appear at just the home page and on t [...]
  • Danny: I've set everything up as instructed on this page, but it still doesn't show up on the front page... [...]
  • Chris: [code] true local [/code] [...]
  • Chris: Looks like the author forgot to include a pool to which the code comes from. local or community. [...]

Categories