Page 1 of 1

Fatal error: Call to a member function GetRow() on a non-object

Posted: Mon Jun 09, 2008 1:12 pm
by Peter Bradley
When I run the installation for 1.3 I get the error message “Fatal error: Call to a member function GetRow() on a non-object in C:\wamp\www\KS\cmsmadesimple\lib\classes\class.contentoperations.inc.php on line 354”

My setup is Apache 2.2.28, PHP 5.2.6 and MySQL 5.0.51b. I see (from forum posts) that at least one other person has had the same problem, but with 1.2.4. Suggestions please.

Thanks.

Re: Fatal error: Call to a member function GetRow() on a non-object

Posted: Mon Jun 09, 2008 1:21 pm
by pb
354 is this:

$row = &$db->GetRow($query);

GetRow is a member of adodb, seems adodb is not loaded or no database connection.

Re: Fatal error: Call to a member function GetRow() on a non-object

Posted: Mon Jun 09, 2008 2:03 pm
by Peter Bradley
I've used the same connection details successfully for several other cmsms installations without any problems. I've checked the details umpteen times and I can't see anything wrong with them. Surely there's a "proper" installation error message if it can't make a db connection using the details I've typed in.

I've tried it choosing MySQL for the db type and also MySQL (4.1+), but the result is the same - that error message.

Re: Fatal error: Call to a member function GetRow() on a non-object

Posted: Mon Jun 09, 2008 4:41 pm
by Pierre M.
Hello,

broken download ? broken explode of tar.gz ? broken copy to wamp location ? hence broken adodb install ?

or something with the database ? can you connect to it with another soft like phpmyadmin ?

Pierre M.

Re: Fatal error: Call to a member function GetRow() on a non-object

Posted: Mon Jun 09, 2008 4:49 pm
by calguy1000
also, check your httpd error log for warnings and notices.

Re: Fatal error: Call to a member function GetRow() on a non-object

Posted: Mon Jun 09, 2008 5:29 pm
by Peter Bradley
Everything else that I'm running under WAMP (using the same db connection details) works fine. I tried to install 1.2.4 and got exactly the same error message, so it's obviously not a 1.3 issue.

Re: Fatal error: Call to a member function GetRow() on a non-object

Posted: Wed Jun 11, 2008 4:37 pm
by calguy1000
Okay, I just started testing the installer and encountered this probllem.

It took a while to chase down, but for me, it only happened when
a) I had extra modules (other than core modules) installed in the modules folder
b) one of those modules tried to access the database in its constructor or in
    methods called from the constructor.

(Calendar was the first culprit I found, but I'm sure there are more).

My temporary workaround was to add a line that would tell the installer to only install system modules.

Here's the diff to install/lib/classes/CMSInstellerPage5.class.php

Code: Select all

Index: CMSInstallerPage5.class.php
===================================================================
--- CMSInstallerPage5.class.php (revision 4091)
+++ CMSInstallerPage5.class.php (revision 4600)
@@ -175,6 +175,9 @@

                        foreach ($gCms->modules as $modulename=>$value)
                        {
+                         // only deal with system modules
+                         if( !in_array($modulename,$gCms->cmssystemmodules) ) continue;
+
                                if ($gCms->modules[$modulename]['object']->AllowAutoInstall() == true)
                                {
                                $query = "SELECT * FROM ".cms_db_prefix()."modules WHERE module_name = ?";
Side note:  This output generated by svn diff.... how can somebody call himself a programmer if he doesn't know basic tools like source code management, and diff, and how to play nice with others.

Re: Fatal error: Call to a member function GetRow() on a non-object

Posted: Wed Jun 11, 2008 5:02 pm
by Pierre M.
Side side note that may please Ted : Giggle http://developer.imendio.com/projects/giggle
Pierre