CGCalendar not displaying list option

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
Charmie
Forum Members
Forum Members
Posts: 80
Joined: Tue Mar 03, 2009 3:32 pm

CGCalendar not displaying list option

Post by Charmie »

Hi,

I really hope someone can help. I recently upgraded my version of CMS Made Simple from 1.5.4 to 1.9.4.2.
Everything works fine except I can not use the display='list' in the CGCalendar module.
Here is my tag :
{cms_module module="CGCalendar" category='Services' display='list' inline='1'}

and this is the error message I receive on the page:
Fatal error: Call to a member function RecordCount() on a non-object in /home/cchurch/public_html/modules/CGCalendar/function.displaylist.php on line 196


I have downloaded the file and looked at line 196 and it calls this function:
if($rs->RecordCount() > 0)
{
while($row = $rs->FetchRow())
{
$titleSEO = munge_string_to_url($row['event_title']);
$destpage = $module->GetPreference('defaultcalendarpage',-1);
$destpage=$destpage!=-1?$destpage:$returnid;
$destpage=$detailpage!=''?$detailpage:$destpage;
$prettyurl = sprintf($module->GetPreference('url_prefix','calendar')."/%d/%d-%s",
$destpage,
$row['event_id'],
$titleSEO);
$parms = array();
$parms['event_id'] = $row['event_id'];
$parms['display'] = 'event';
if( isset($parameters['lang']) )
{
$parms['lang'] = $parameters['lang'];
}
if( isset($parameters['eventtemplate']) )
{
$parms['eventtemplate'] = $parameters['eventtemplate'];
}
$url = $module->CreateLink($id, 'default',$destpage, $contents='',
$parms, '', true, '', '', '', $prettyurl);
$row['url'] = $url;
$row['author'] = $users[$row['event_created_by']]->username;
$row['authorname'] = $users[$row['event_created_by']]->firstname.' '.$users[$row['event_created_by']]->lastname;

====================
Unfortunately I don't know enough about code to understand how to fix it.

Charmie
Jos
Support Guru
Support Guru
Posts: 4020
Joined: Wed Sep 05, 2007 8:03 pm

Re: CGCalendar not displaying list option

Post by Jos »

There should be absolutely no need to edit files!
Which version of CGCalendar and CGExtensions do you use?
Charmie
Forum Members
Forum Members
Posts: 80
Joined: Tue Mar 03, 2009 3:32 pm

Re: CGCalendar not displaying list option

Post by Charmie »

Hi,

These are the versions I am using:
CGExtensions
1.25.4

CGCalendar
1.7.1
Jos
Support Guru
Support Guru
Posts: 4020
Joined: Wed Sep 05, 2007 8:03 pm

Re: CGCalendar not displaying list option

Post by Jos »

It wouldn't hurt to updrage CGExtensions to latest version, but do you get any error messages when you turn debug on in config.php?
Charmie
Forum Members
Forum Members
Posts: 80
Joined: Tue Mar 03, 2009 3:32 pm

Re: CGCalendar not displaying list option

Post by Charmie »

Hi Jos,

Thanks loads for answering.

I have switched on debug and upgraded the CGExtensions.

I now get the following error message displayed:
Notice: Undefined variable: last_say_of_month in /home/cchurch/public_html/modules/CGCalendar/function.displaylist.php on line 149

Fatal error: Call to a member function RecordCount() on a non-object in /home/cchurch/public_html/modules/CGCalendar/function.displaylist.php on line 196

The debug code is very long if you look at my site you will see what it displays at the bottom of the page:
http://www.christchurchnorthfinchley.co.uk
Jos
Support Guru
Support Guru
Posts: 4020
Joined: Wed Sep 05, 2007 8:03 pm

Re: CGCalendar not displaying list option

Post by Jos »

That is not the page where the call to CGCalendar is on, is it?
Charmie
Forum Members
Forum Members
Posts: 80
Joined: Tue Mar 03, 2009 3:32 pm

Re: CGCalendar not displaying list option

Post by Charmie »

Jos
Support Guru
Support Guru
Posts: 4020
Joined: Wed Sep 05, 2007 8:03 pm

Re: CGCalendar not displaying list option

Post by Jos »

Pitty that page doesn't show debug info. You can turn it off again :-\

Maybe you have the same problem as described in this topic?
http://forum.cmsmadesimple.org/viewtopi ... 43#p120143
Charmie
Forum Members
Forum Members
Posts: 80
Joined: Tue Mar 03, 2009 3:32 pm

Re: CGCalendar not displaying list option

Post by Charmie »

Hi Jos,

Thanks for the suggestion but nope my problem is different.
I have temporarily solved it by using display='yearlist', it give a similar results and luckily the site I have has very few events.

If someone does find a solution to this please let me know as I really prefer to have the events listed monthly rather than yearly.

Charmie
Jos
Support Guru
Support Guru
Posts: 4020
Joined: Wed Sep 05, 2007 8:03 pm

Re: CGCalendar not displaying list option

Post by Jos »

Maybe something went wrong while updating CGCalendar and not all files were properly overwritten?

You might want to try to download the tar file from http://dev.cmsmadesimple.org/project/files/623, unpack it and upload to your site (modules/CGCalendar/)

Hope that helps.
RHF
Forum Members
Forum Members
Posts: 20
Joined: Sun Jan 23, 2011 1:55 am

Re: CGCalendar not displaying list option

Post by RHF »

Hi. I am getting exactly the same error as OP.

This is only with the display="list" parameter. It appears that the "yearlist", "pastlist" and "upcominglist" all work properly.

I tried to follow Jos suggestion, but it would not install the new XML file over the installed one (both V 1.7.1). I started to Uninstall the current one but was told that this would erase all data - which I do not want to do.
wozzukes
New Member
New Member
Posts: 7
Joined: Wed Jul 20, 2011 3:30 pm

Re: CGCalendar not displaying list option

Post by wozzukes »

Hi there. I'm new to CMS and this module, but I am also receiving the same error when I click on a date in the main calendar view. Clicking on the event name works, but clicking on the date to list the events for that day throws this error:

( ! ) Fatal error: Call to a member function RecordCount() on a non-object in C:\pathtosite\modules\CGCalendar\function.displaylist.php on line 196
Call Stack
# Time Memory Function Location
1 0.0017 490032 {main}( ) ..\index.php:0
2 0.1893 10760680 Smarty->fetch( ) ..\index.php:267
3 0.1906 10884904 include( 'C:\pathtosite\tmp\templates_c\%%2D^2D7^2D769AFC%%tpl_body%3A17.php' ) ..\Smarty.class.php:1283
4 0.2800 12918048 smarty_cms_function_content( ) ..\%%2D^2D7^2D769AFC%%tpl_body%3A17.php:69
5 0.2805 12960440 CMSModule->DoActionBase( ) ..\function.content.php:98
6 0.2814 12961592 CGExtensions->DoAction( ) ..\class.module.inc.php:2050
7 0.2830 12976112 CMSModule->DoAction( ) ..\CGExtensions.module.php:483
8 0.2835 12995872 include( 'C:\pathtosite\modules\CGCalendar\action.default.php' ) ..\class.module.inc.php:2005
9 0.2850 13052032 DisplayList( ) ..\action.default.php:61

I tried uninstalling and reinstalling and get the same result. Any help would be appreciated!
JohnnyB
Dev Team Member
Dev Team Member
Posts: 731
Joined: Tue Nov 21, 2006 5:05 pm

Re: CGCalendar not displaying list option

Post by JohnnyB »

I have the same problem as op:
CMSMS 1.4.9.2
CGCal 1.7.1
CGExt 1.26.3
Fatal error: Call to a member function RecordCount() on a non-object in C:\wamp\www\cmsms\modules\CGCalendar\function.displaylist.php on line 196

I think the OP debug statement can be fixed as follows. I had the same typo but this is not related to the fatal error.

--Removed by moderator--
--Coding hacks are not permitted on the forum, please use the Bug Report function in the Forge--

I had to revert back to 1.6.1 for now.
Post Reply

Return to “Modules/Add-Ons”