PEAK XOOPS - New bug found (AND NOW SOLVED) in englishin japanese

New bug found (AND NOW SOLVED)

  • You cannot open a new topic into this forum
  • Guests cannot post into this forum
depth:
0
Previous post - Next post | Parent - Children.1 | Posted on 2004/9/1 13:53
AZNative  Private 1st Class From: Phoenix, Arizona, USA  Posts: 12
Found what appears to be a new bug today. This bug is unique in that is only occurs on the last day of the month.

I've been able to reproduce this problem on Win2K and Linux box, both using MySQL.

Let's say today is August 31 and you are viewing the month-view calendar. If you click the "next month" arrow, it will take you to October, not September like it should. However, if you click back, it will go from October to September. Back again and you go from September to August. Hit forward and you go from August to September.

Now, if today is September 30 and you hit "next month", it will take you to October.

The bug appears only to happen for months that have 31 days. In addition, you must click the calendar link on the main menu within Xoops, don't hit the refresh on the browser. You can test this by manually changing the time of the machine to August 31 or October 31, etc.

I'll do some investigating, but figured I would throw this out there if anyone else wants to put some eyes on it.

Votes:0 Average:0.00
depth:
1
Previous post - Next post | Parent - Children.1 | Posted on 2004/9/1 14:25
AZNative  Private 1st Class From: Phoenix, Arizona, USA  Posts: 12
Looks like this issues does indeed go both ways.

If today is the last day of a month that ends with 31 and you go to the next month, it will skip a month. If you try to go to the previous month, it doesn't go to the previous month, it just takes you to the first day of teh current month.

For example, today is October 31 and you hit "previous month", the month-view will show October 1 as the date.
Votes:1 Average:10.00

normal Re: New bug found

msg# 1.1.1
depth:
2
Previous post - Next post | Parent - Children.1 | Posted on 2004/9/2 2:51
AZNative  Private 1st Class From: Phoenix, Arizona, USA  Posts: 12
After a little digging, I have the hack to resolve the next/previous issue that occurs on the last day of each month.

Again, my file is hacked so I can't give exact line numbers.

Open piCal.php and do a search for the following string

function get_calendar_information

Scroll down about 35 lines and you'll find the following block of code

	$ret[ 'PREV_YEAR' ] = date("Y-n-j", mktime(0,0,0,$this->month,$this->date,$this->year-1));
	$ret[ 'NEXT_YEAR' ] = date("Y-n-j", mktime(0,0,0,$this->month,$this->date,$this->year+1));
	$ret[ 'PREV_MONTH' ] = date("Y-n-j", mktime(0,0,0,$this->month-1,$this->date,$this->year));
	$ret[ 'NEXT_MONTH' ] = date("Y-n-j", mktime(0, 0,  0, $this->month+1,$this->date,$this->year));
	$ret[ 'PREV_WEEK' ] = date( "Y-n-j" , $this->unixtime - 86400*7 ) ;
	$ret[ 'NEXT_WEEK' ] = date( "Y-n-j" , $this->unixtime + 86400*7 ) ;
	$ret[ 'PREV_DATE' ] = date("Y-n-j", $this->unixtime - 86400 ) ;
	$ret[ 'NEXT_DATE' ] = date("Y-n-j", $this->unixtime + 86400 ) ;

Delete this entire block of code and then replace it with the following block of code (red indicates changes and/or new lines of code)

        $nextMonthDays = date("t", mktime(0, 0, 0, $this->month+1, 1, $this->year));
        $prevMonthDays = date("t", mktime(0, 0, 0, $this->month-1, 1, $this->year));

        if ($this->date > $nextMonthDays) {
           $next = $nextMonthDays;
        } else {
           $next = $this->date;
        } 

        if ($this->date > $prevMonthDays) {
          $previous = $prevMonthDays;
        } else {
          $previous = $this->date;
        } 

	$ret[ 'PREV_YEAR' ] = date("Y-n-j", mktime(0,0,0,$this->month,$this->date,$this->year-1));
	$ret[ 'NEXT_YEAR' ] = date("Y-n-j", mktime(0,0,0,$this->month,$this->date,$this->year+1));
	$ret[ 'PREV_MONTH' ] = date("Y-n-j", mktime(0,0,0,$this->month-1,$previous,$this->year));
	$ret[ 'NEXT_MONTH' ] = date("Y-n-j", mktime(0, 0,  0, $this->month+1,$next,$this->year));
	$ret[ 'PREV_WEEK' ] = date( "Y-n-j" , $this->unixtime - 86400*7 ) ;
	$ret[ 'NEXT_WEEK' ] = date( "Y-n-j" , $this->unixtime + 86400*7 ) ;
	$ret[ 'PREV_DATE' ] = date("Y-n-j", $this->unixtime - 86400 ) ;
	$ret[ 'NEXT_DATE' ] = date("Y-n-j", $this->unixtime + 86400 ) ;
Votes:2 Average:0.00

question Re: New bug found

msg# 1.1.1.1
depth:
3
Previous post - Next post | Parent - No child | Posted on 2004/9/29 17:46
GIJOE  Gunnery Sergeant   Posts: 4110
hi AZNative.

Thank you for finding a bug.
I've fixed it against my repository.
Votes:0 Average:0.00

  Advanced search


Login
Username or e-mail:

Password:

Remember Me

Lost Password?

Register now!