My Subscriptions

No active or expired subscriptions. View Available Subscriptions

News Feed

Receive our Newsletter

Advanced Search

Save $50 on your CMS Expo Registration

Receive $50 off the registration fee for the CMS Expo featuring Joomla! in Dever, Colorado (USA). Click here to register at the reduced rate.
Home arrow Forum arrow Extensionsarrow JCal Pro and JCal Clientarrow Archivearrow 1.6.x General Discussionarrow SOLVED: Warning: Invalid argument supplied for foreach()
Pages: [1]
Print
Author Topic: SOLVED: Warning: Invalid argument supplied for foreach()  (Read 538 times)
PepsimanAB
Moderator
Jr. Member
*****

Karma: +4/-0
Posts: 71


View Profile Email
« on: November 30, 2007, 03:21:51 PM »

Hi.  I just installed JCal Client 1.6.0 Beta.176 on the latest Joomla 1.5 Nightly Build.

I created a few categories but haven't added events to them yet.  When I click on the name of the category at the bottom of the monthly view, it shows "There are no events under this category.", which is correct, but near the top of the page it shows:

Warning: Invalid argument supplied for foreach() in C:\Documents and Settings\Anthony\Desktop\WWW\olmc\components\com_jcalpro\jcalpro.php on line 934

This seems like it should be a simple fix (just check to see if the results array is empty before accessing it).  I'm sure most people probably add events before trying this, so it would rarely happen to anyone anyways.

Thanks for making a quality product.  After trying several calendar components and almost resorting to writing my own, JCal looks like it will fit my needs.
« Last Edit: December 01, 2007, 04:58:21 AM by V-man » Logged

Anthony
*** Please read this post before posting in the forum. ***
PepsimanAB
Moderator
Jr. Member
*****

Karma: +4/-0
Posts: 71


View Profile Email
« Reply #1 on: December 01, 2007, 12:52:43 AM »

Now that I have a little more time to play with the code, I just found the error.  On line 924 of jcalpro.php, it has:
Code:
$result = $database->loadObjectList();

For the next several lines, it uses the variable "$results".

After changing "$result" to "$results" in line 924, I am no longer getting that Invalid Argument error and it's working as I expected.
Logged

Anthony
*** Please read this post before posting in the forum. ***
V-man
Administrator
Hero Member
*****

Karma: +16/-3
Posts: 2408


Ignorance is curable, stupid is forever.


View Profile
« Reply #2 on: December 01, 2007, 04:58:03 AM »

Great find. Cheers!
Logged

*** Please read this post and the FAQs before posting in the forum. ***
*** Documentation links: JCal Pro | Advanced Search ***
*** Support questions via PM or e-mail will be ignored.

*** Paid Support is available through Open Source Support Desk.
Pages: [1]
Print
Jump to:  

Powered by SMF 1.1.6 | SMF © 2006-2008, Simple Machines LLC
Joomla Bridge by JoomlaHacks.com

Original Joomla Template design by RocketTheme ( Conversion by Bloc)