Running an out-of-the-box Drupal 4.6.0 on Apache with MySQL. I have a daily container set up, with several dailies in it. The problem is that the calendar and navigation at the bottom isn't working correctly, and I can't see why it isn't.

When displaying the daily_container directly, the "First" link points to the correct node, but the "previous" link points to the last node (i.e. the one currently being displayed). This is universal across all the dailies even when viewed directly; no links appear at all in the actual calendar itself, the laquo next to the month/year heading on the calendar displays as text rather than « (and links to the last node), a "next" link never displays, and all daily navigation links other than "first" point to the most recent node, making all nodes other than the first or last unreachable without knowing their numbers.

I can't figure out what's going on here. The server is mine, so I have shell access and database control; how can I fix this situation? Any assistance would be appreciated.

Comments

leolite1’s picture

I installed version 4.6 for the first time and I too got stuck with the same problems which you mentioned. Eventually I tracked it down to the _daily_calendar_month_data function in daily_data.inc and made the following changes which resolved the problems for me.

    //*IP+3 $this_day = $date; We don't want $date to get overwritten
    $this_day->year = $date->year;
    $this_day->month = $date->month;	
    $this_day->day = $day->day;
  //IP++ We don't want $date to get overwritten
  // Enter all dates in the current month which have items associated with them  
  //$som = $date;
  //$som->day = 0;  
  //$eom = $date;
  //$eom->day = 99;
  
  $som->year = $date->year;
  $som->month = $date->month;
  $som->day = 0;  
  $eom->year = $date->year;
  $eom->month = $date->month;
  $eom->day = 99;

And then a couple blocks down a few more changes ..

//*IP+1 why 15 ? $result["date"] = mktime(0, 0, 0, $date->month, 15, $date->year);
  $result["date"] = mktime(0, 0, 0, $date->month, $date->day, $date->year);

I think the same should resolve the problems for you as well.

Frodo Looijaard’s picture

PHP4 seems to handle the above different from PHP5.

(sorry, I tried to post a code snippet, but I keep getting 'suspicious input data' errors).

Basic idea is: if you assign an object to another object and then change a member variable in the new object, in PHP4 the original object remains unchanged, while in PHP5 it changes too.

I'll try to change the daily module to keep PHP5 happy too.

  Frodo