Non-core contributed modules

MRBS lists two "Octobers" in monthly view list

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: 1.9.3
  • Fix Version/s: None
  • Component/s: Block: Mrbs
  • Labels:
    None
  • Environment:
    OSX PHP 5 MySQL

Description

MRBS main page listing contains two "October" months in a row. One functions as month 10 and one as 11 but has posed confusion on our site.

Using the most recent ver as of about 8/15/09

I would not mind advice on finding the error in the code so I can do a quick fix myself but should be corrected in next ver.

Activity

Hide
Anthony Borrow added a comment -

Dan - I have added Mike Worth as a watcher of this. The place to look at is in the /blocks/mrbs/web/trailer.php around line 45 (actually 39-54) is the relevant section. It is curious what might be happening and knowing what timezone your server is set to may be helpful. In addition, what is the timezone for the particular Moodle user looking at the page?

For a quick fix I might try switching line 45 from:

$ctime = mktime(0, 0, 0, $month, $day + 7 * $i - $skipback, $year);

to

$ctime = mktime(12, 0, 0, $month, $day + 7 * $i - $skipback, $year);

It is really not the cleanest of solutions theoretically but it may provide you a quick and easy fix.

Mike may have a more elegant solution but I see no reason why this needs to be set to midnight. Dates and timezones can be tricky to work with especially when you have an international site as an issue will come up for one user on one timezone and not another. Thanks for reporting this and let me know if the quick and dirty fix actually fixes the problem for you.

Peace - Anthony

Show
Anthony Borrow added a comment - Dan - I have added Mike Worth as a watcher of this. The place to look at is in the /blocks/mrbs/web/trailer.php around line 45 (actually 39-54) is the relevant section. It is curious what might be happening and knowing what timezone your server is set to may be helpful. In addition, what is the timezone for the particular Moodle user looking at the page? For a quick fix I might try switching line 45 from: $ctime = mktime(0, 0, 0, $month, $day + 7 * $i - $skipback, $year); to $ctime = mktime(12, 0, 0, $month, $day + 7 * $i - $skipback, $year); It is really not the cleanest of solutions theoretically but it may provide you a quick and easy fix. Mike may have a more elegant solution but I see no reason why this needs to be set to midnight. Dates and timezones can be tricky to work with especially when you have an international site as an issue will come up for one user on one timezone and not another. Thanks for reporting this and let me know if the quick and dirty fix actually fixes the problem for you. Peace - Anthony
Hide
Anthony Borrow added a comment -

p.s. - Mike if you want to take this issue over please feel free to assign it to yourself if you have the time. Peace - Anthony

Show
Anthony Borrow added a comment - p.s. - Mike if you want to take this issue over please feel free to assign it to yourself if you have the time. Peace - Anthony
Hide
Dan Trockman added a comment - - edited

Our server is on Central Time (GMT-5 hours) and so are the users. Would time zone issues create two Octobers? The behavior of the site acts as if one is an October and one is a November. I need to be careful as this addition has been an instant hit for our users!

Show
Dan Trockman added a comment - - edited Our server is on Central Time (GMT-5 hours) and so are the users. Would time zone issues create two Octobers? The behavior of the site acts as if one is an October and one is a November. I need to be careful as this addition has been an instant hit for our users!
Hide
Anthony Borrow added a comment -

Dan - I have not had a chance to look at the issue carefully but because the code was using midnight I could foresee that if it hit the first day of the month and something is slightly off that the first day would be that of the previous month. Can you try the quick patch I mentioned and let me know if that resolves the issue. I am hoping that Mike Worth may have some time to look at this in more depth and provide a more permanent solution. The quick patch may be just what you need to get yourself out of a whole and prevent making a poor impression on your users. I am glad to hear that they enjoy the block. Peace - Anthony

Show
Anthony Borrow added a comment - Dan - I have not had a chance to look at the issue carefully but because the code was using midnight I could foresee that if it hit the first day of the month and something is slightly off that the first day would be that of the previous month. Can you try the quick patch I mentioned and let me know if that resolves the issue. I am hoping that Mike Worth may have some time to look at this in more depth and provide a more permanent solution. The quick patch may be just what you need to get yourself out of a whole and prevent making a poor impression on your users. I am glad to hear that they enjoy the block. Peace - Anthony

People

Vote (0)
Watch (3)

Dates

  • Created:
    Updated: