Bug: Admin Log can't be viewed, when database is Postgres

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
martin42
Forum Members
Forum Members
Posts: 126
Joined: Sat Aug 20, 2005 11:35 pm

Bug: Admin Log can't be viewed, when database is Postgres

Post by martin42 »

Problem: "Admin Log" never shows any info!

PHP LOG:
    PHP Fatal error:  Call to a member function on a non-object in /usr/local/www/www.example.com/admin/adminlog.php on line 94

POSTGRES LOG:
    ERROR:  LIMIT #,# syntax is not supported
    HINT:  Use separate LIMIT and OFFSET clauses.

Looking in adminlog.php backwards from line 94, I'm guessing the SQL code that caused this was:

    $query = "SELECT * from ".cms_db_prefix()."adminlog ORDER BY timestamp DESC limit $from, $limit";
    $result = $db->Execute($query);

I'm out of my depth here! Is it possible to adjust adminlog.php to avoid using "limit" in this way?

Thanks!

- Martin
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: Bug: Admin Log can't be viewed, when database is Postgres

Post by Ted »

Yeah, there should be an adodb abstraction to handle this instead of directly in the sql.  I'll put it on my list.
martin42
Forum Members
Forum Members
Posts: 126
Joined: Sat Aug 20, 2005 11:35 pm

Re: Bug: Admin Log can't be viewed, when database is Postgres

Post by martin42 »

Thanks!
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: Bug: Admin Log can't be viewed, when database is Postgres

Post by Ted »

This is fixed in svn....  I think.  It's using the abstraction from ADODB, so I'm assuming that it'll work properly in postgres.  I don't have it installed currently to double check, though.
martin42
Forum Members
Forum Members
Posts: 126
Joined: Sat Aug 20, 2005 11:35 pm

Re: Bug: Admin Log can't be viewed, when database is Postgres

Post by martin42 »

Great. I'll install Subversion tonight and test it.  Can I just take adminlog.php in isolation?  I don't really want to run the whole dev release now that my site is populated ;-)
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: Bug: Admin Log can't be viewed, when database is Postgres

Post by Ted »

Sure.  http://svn.cmsmadesimple.org/cms/trunk/ ... minlog.php will be the latest version.
martin42
Forum Members
Forum Members
Posts: 126
Joined: Sat Aug 20, 2005 11:35 pm

FIXED!! Admin Log can't be viewed, when database is Postgres

Post by martin42 »

Ah, so I don't even need to install a Subversion client - great.

I've just tested that.  It works perfectly!  Very good level of admin logging there.

Now CMSMS is working perfectly with Postgres AFAICT :-)


Many thanks! 
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: Bug: Admin Log can't be viewed, when database is Postgres

Post by Ted »

Excellent!  Thanks for the heads up on that bug.  There is still some non-adodb sql coe floating around that I'll never find without people testing it.

Thanks again!
Post Reply

Return to “CMSMS Core”