Bug #10581 Bug Fixed

Error when there is a calendar entry

Version: EE 2.0.0PB 20091204 Reporter: jaredw

This is an archived bug report. If you are experiencing a similar issue, upgrade to the latest release and if that does not solve the problem, submit a new bug report

I get the following error when viewing my calendar when there is an event entry. There is no error when there are no entries. I’m using the calendar code from the EE Wiki, just replacing ‘weblog’ with ‘channel’. I am using EE2.0, Build 20091204.

I posted this in the 2.0 PB Tech Support forum and was asked to post this here.

Error received:
A PHP Error was encountered
Severity: Warning
Message: Invalid argument supplied for foreach()
Filename: channel/mod.channel_calendar.php
Line Number: 777

Bug can be viewd at thus URL:
http://hghed.ehclients.com/index.php/calendar/calendar_test

The following is my template code:

<code>{embed="embeds/html_header" my_title="Highland General Hospital | Events"}

<body id="p7bod">
<div id="wrapper">
{embed="embeds/page_header"}
  <div id="img_people"></div>

{embed="embeds/menu"}

  <div id="calendar">
        
{exp:channel:calendar switch="calendarToday|calendarCell" channel="events" show_future_entries="yes"}

<table class="calendarBG" border="0" cellpadding="6" cellspacing="1" summary="My Calendar" width="90%">
<tr class="calendarHeader">
<th><div class="calendarMonthLinks"><<</div></th>
<th colspan="5">{date format="%F %Y"}</th>
<th><div class="calendarMonthLinks">>></div></th>
</tr>
<tr>
{calendar_heading}
<td class="calendarDayHeading">{lang:weekday_abrev}</td>
{/calendar_heading}
</tr>

{calendar_rows }
{row_start}<tr>{/row_start}

{if entries}
<td class='{switch}' align='center'>
{day_number}
{entries}
<div>{title}</div>
{/entries}
</td>
{/if}

{if not_entries}
<td class='{switch}' align='center'>{day_number}</td>
{/if}

{if blank}
<td class='calendarBlank'>{day_number}</td>
{/if}

{row_end}</tr>{/row_end}
{/calendar_rows}
</table>
{/exp:channel:calendar}
    
  </div></div>

{embed="embeds/footer"}

</body>
</html></code>
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases