Help - Search - Members - Calendar
Full Version: error/warning on blog main menu
Movable Type Community Forum > Other Product Discussion > Bugs and Odd Behavior
btrott
Based on the line number... I would make a guess and say this has to do with a screwy date/time on one of the entries in this blog.
btrott
I agree, we really don't even use Time::Local very much--the only reason it is used is to turn an MT timestamp (YYYYMMDDHHMMSS) into a Unix seconds-since-1970, so that we can get the day of the week. There is probably another way to get the day of the week--if you know, let me know and we can remove the dependency on Time::Local.
btrott
I was interested in this so I took a look at Date::Manip, then at Date::Calc, to see how they are doing it. I adapted some of the code from there. I'll email you the modified Util.pm and you can test it out. smile.gif
dchase
There's a an error/warning message appearing at the bottom of the main menu for one of my blogs:

CODE
MT::App::CMS=HASH(0x81ddae8) Use of uninitialized value at /usr/local/www/sharedapps/mt/cgi/lib/MT/Util.pm line 54.
MT::App::CMS=HASH(0x81ddae8) Use of uninitialized value at /usr/local/www/sharedapps/mt/cgi/lib/MT/Util.pm line 56.


This appears for only one particular blog. I also haven't experienced any problems with posting or comments or anything.
dchase
Ahhh. I did a search here and it looks like the problem is related to Time::Local limitations. Bummer. This blog is a family photo history blog with entry dates corresponding to when the photos were taken (and I have photos going back to the late 1800s). I was actually beginning to get something pretty cool going too, with multiple categories and multiple archive templates (photos organized by time, branch of family tree, geography and so on). I guess it's back to my old home rolled perl/mysql monstrosity.

So, allow me to turn this bug report into a feature request smile.gif
dchase
Perl isn't my expertise, but I've always used Date::Manip, mostly because I'm lazy and find it really easy to use. Even it's own documentation, however, says it should be avoided because it's bloated and slow. (But hey, some would say the same about me smile.gif ). I think Time::JulianDay, would work, though obviously there's parsing to be done on the MT date stamp:

CODE
$jd = julian_day($year, $month_1_to_12, $day)
$dow = day_of_week($jd)


And, of course, getting away from Time:Local means adding yet another required module.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.