This is a standard Calendar page:
http://eagleridgeacademy.org/events

There's a problem with the on the May and June pages:
http://eagleridgeacademy.org/events/month/2014-05
http://eagleridgeacademy.org/events/month/2014-06

First of all, the max items per day is currently set at 3.

On May 20th, there is the middle of one multi-day event and two other events shown. But if you click on the May 20th date, you will see that there is actually 3 non-multi-day events, one more than is shown on the month page. In this case, it seems the "More" link should be on the month page, but it is not there.

Again, on June 6th, it is the end of a multi-day event and there is one all-day event and three other events on the day. All the events except the last one are shown and no "More" link is shown as well on the month page, while the day page shows all items.

There's something about these days that are right on the edge of what qualifies for a "More" link and has a multi-day event included that seems to throw the "More" link display logic in the month display off. I'm currently trying to step through the code and find the problem and the solution, so if I find it I will certainly update this post.

Note: I am going to update the live code with the fix below so that the "More" link does appear when I think it should. But if you want to recreate similar sets of events on a test as on those days, it should be a good place to start for reproducing these issues.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dandaman’s picture

Since the display of the day's events does loop through every item, I added a variable that gets set when it reaches one of these events that will not be displayed. I can't completely grok how the $cur_cnt and $total_cnt are not working perfectly in some cases, so this finds exactly when something will not be displayed and adds a "more" link then. I don't have the time to roll it as a patch against the dev right now, but I'll try to come back to it later this week if I have time.

--- a/sites/all/modules/contrib/calendar/includes/calendar_plugin_style.inc
+++ b/sites/all/modules/contrib/calendar/includes/calendar_plugin_style.inc
@@ -665,6 +665,7 @@ class calendar_plugin_style extends views_plugin_style {
     $first_day = variable_get('date_first_day', 0);
     $cur_cnt = 0;
     $total_cnt = 0;
+    $extra_events = FALSE;
     $ids = array();

     // If we are hiding, count before processing further
@@ -790,6 +791,9 @@ class calendar_plugin_style extends views_plugin_style {
                   'wday' => $wday,
                 );
               }
+              elseif (!$extra_events) {
+                // The event we're currently on will never be displaed.
+                // So let's set a flag the make sure more link is set.
+                $extra_events = TRUE;
+              }

             }
           }
@@ -798,7 +802,7 @@ class calendar_plugin_style extends views_plugin_style {
     }

     // Add a more link if necessary
-    if ($max_events != CALENDAR_SHOW_ALL && $total_cnt > 0 && $cur_cnt < $total_cnt) {
+    if ($max_events != CALENDAR_SHOW_ALL && $total_cnt > 0 && ($cur_cnt < $total_cnt || $extra_events)) {
       $entry = theme('calendar_' . $this->date_info->calendar_type . '_multiple_entity', array(
           'curday' => $curday_date,
           'count' => $total_cnt,
dandaman’s picture

Issue summary: View changes

Updated issue summary to note that the example has now been updated with the fix above.

nmillin’s picture

Status: Active » Needs review
FileSize
1.41 KB

I ran into this issue and the code above solved my issue. Uploading patch of the fix that dandaman provided.

dandaman’s picture

Version: 7.x-3.4 » 7.x-3.x-dev
Status: Needs review » Reviewed & tested by the community

Applied the code to 7.x-3.5 again and it fixed the issue on the same site again. Thanks for testing it as well and rolling the patch nmillin!

erwangel’s picture

Had the same problem, This (#3) applied to 7.x-3.5 worked for me also. Thank you both nmillin & dandaman!

lucuhb’s picture

The patch #3 fixes the problem for me too. Thanks for this !

Neslee Canil Pinto’s picture

Status: Reviewed & tested by the community » Fixed

Committed, Thanks.

Status: Fixed » Closed (fixed)

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