I made a calendar view and nodes doesn't appear in year view

This modification works for me (no time to make a patch):

/**
 * Build the contents of a single day for the $rows results.
 */
function calendar_build_day($curday, $view, $items, $params) {
  $nextday = drupal_clone($curday);
  date_modify($nextday, '+1 day');
  $inner = '';

resetting selected var, this looks good

  $selected = FALSE;
  foreach ($items as $date => $day) {
    if ($date == date_format($curday, 'Y-m-d')) {

but you should turn on $selected here

      $selected = TRUE;
      ksort($day);
      foreach ($day as $time) {
        foreach ($time as $item) {
          if (!$view->mini) {
            $theme = isset($item->calendar_node_theme) ? $item->calendar_node_theme : 'calendar_node_'. $view->calendar_type;
            $inner .= theme($theme, $item, $view);
          }
        }
      }
    }
  }
  if (empty($inner)) {
    $inner = theme('calendar_empty');
  }
  $content = theme('calendar_date_box', date_format($curday, 'Y-m-d'), $view, $params, $selected) . $inner;
  return $content;
}

Comments

choster’s picture

Marked http://drupal.org/node/256123 as a duplicate of this issue.

Dash’s picture

Thanks, this works for me - now to get the ical feed for the year to give me more than just January's events!

For anyone else looking, the file modified here is calendar.inc at line 276-279

scottrigby’s picture

Great - it works!
Yeah, would be good to get the ical feed working as well...
Thanks for the year page view fix in any case - this was really crucial for me
:)
Scott

Dash’s picture

Latest dev snapshot has broken this again for me, even though it is included... :(

Steven Merrill’s picture

Sorry, also in a bit of a rush so I can't patch now, but here's what fixed it on the latest dev release.

Look for the line with //Added.

/**
* Build the contents of a single day for the $rows results.
*/
function calendar_build_day($curday, $view, $items, $params) {
$nextday = drupal_clone($curday);
date_modify($nextday, '+1 day');
$inner = '';
$selected = FALSE;
foreach ($items as $date => $day) {
if ($date == date_format($curday, 'Y-m-d')) {
$selected = TRUE; // Added.
ksort($day);
foreach ($day as $time) {
foreach ($time as $item) {
if (!$view->mini) {
$theme = isset($item->calendar_node_theme) ? $item->calendar_node_theme : 'calendar_node_'. $view->calendar_type;
$inner .= theme($theme, $item, $view);
}
}
}
}
}
if (empty($inner)) {
$inner = theme('calendar_empty');
}
$content = theme('calendar_date_box', date_format($curday, 'Y-m-d'), $view, $params, $selected) . $inner;
return $content;
}

Dash’s picture

"As I said.. this is still broken for me with the latest dev (24th June): http://www.skipthebudgie.org/event/2008

My calendar.inc reads as above.

The breadcrumb reads "Home » Gig Calendar » 2008 » January 2008"

AND the iCal feed only shows January events on the year view."

EDIT: Ignore this!!!! I had moved the function into template.php and forgot to change it there... fixed!

KarenS’s picture

Status: Active » Fixed

This seems to be fixed in the latest code. It works for me and #6 indicates it's working there.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

Mr P’s picture

Version: 5.x-2.x-dev » 6.x-2.x-dev
Status: Closed (fixed) » Active

I've got this problem - no underlining or anything else as markers. Day, Week, Month views work fine. Using 6.x-2.x-dev and Dates 6.x-2.x-dev. Gone through the troubleshooting tips. Anyone else? Looked at the code in this post but seems fairly different to latest version. Any fix?

Mr P’s picture

Status: Active » Closed (fixed)

EDIT: Sorted after latest updates/upgrades.

dirksonii’s picture

Status: Closed (fixed) » Active

Cannot get these code changes to work with the most recent release. Can anyone post their full 6.x calendar_build_day that the modified? I'm utterly stuck here.

arlinsandbulte’s picture

Status: Active » Closed (cannot reproduce)

Old issue seems fixed for everyone else.
All seems good to me with latest code.

tms1970’s picture

Version: 6.x-2.x-dev » 7.x-1.x-dev
Issue summary: View changes
Status: Closed (cannot reproduce) » Active

This issue is still there (or it has come back!)

I have a calendar with events that show in the month view but don't show in the year view (no events show and nothing is clickable)

If anyone can help i'd be very grateful.

you can see the event calendar here

http://digforvictory.info/bishopsgate/event-created/year

big_smile’s picture

I am also having the issue of nodes not appearing in Year view. Is there a fix for Drupal 7? I have tried both Dev and Regular versions of the module.

Neslee Canil Pinto’s picture

Status: Active » Closed (outdated)