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>
ExpressionEngine implements Markdown Extra and BBCode. Please see the Markdown Extra docs and the BBCode Wikipedia article for a full reference.
**bold**
, __bold__
, *italics*
, _italics_
, ~strike/del~
, `code()`
bold, italics, strike/del, code()
Link: [link title](https://example.com)
Image: ![alt text](https://example.com/image.jpg)
[blockquote]...[/blockquote]
, [quote]...[/quote]
, and Markdown style:
> Some quoted text. > > This is all one quote.
[code]...[/code]
, and you can also specify the language for syntax highlighting, [code=php]...[/code]
GitHub flavored Markdown code fences are also supported:
``` public function decoderRing($str) { return str_rot13($str); } ```