Posted on: 12/09/06 10:54pm
By: ldfoo
Everything was working fine on a new site using latest cvs 1.4.1b2 but now I am having a problem accessing static pages when logged in as admin (root).
The pages are accessible by anonymous and and editable by another logged-in group as per allowable permissions
I am getting this error:
An error has occurred:
2 - Cannot use a scalar value as an array @ /home/xxxx/public_html/xxxxx/staticpages/index.php line 171
I have tried deleting all cache in firefox and get same using internet explorer. I have also replaced the staticpages index file.
Things I did before it happened:
- added a staticpage link to another static page using an autotag
- switched to an ie-tab in firefox while logged in as admin requiring to login again
I had a look at the database in phpmyadmin but don't see anything, but then I probably don't know what to look for.
Using hosting service which has hosted GL for years without problem - Mysql 4.1.21, php 4.4
Any help appreciated, thanks
Laurie
Re: admin error with staticpages
Posted on: 12/10/06 03:30am
By: Dirk
Quote by: ldfooEverything was working fine on a new site using latest cvs 1.4.1b2
CVS and 1.4.1b2 are not the same - what exactly are you using? And is this a fresh install or did you update an exisiting site?
There has been a change in CVS since the release of 1.4.1b2 that allows passing an array of SQL requests to DB_query. That would more or less match the line number you quoted. So if you're on a CVS version, make sure you've also updated system/lib-database.php and system/databases/mysql.class.php
bye, Dirk
Re: admin error with staticpages
Posted on: 12/10/06 05:43am
By: Anonymous (ldfoo)
Thanks for the pointers Dirk.
This was a clean install - I have been updating a cvs version since 1.4.1b2 was released - latest update today shows config 1.4.1RC1. I have checked the 2 files (system/lib-database.php and system/databases/mysql.class.php) and they were correct dates but I overwrote them again by FTP from my TortoiseCVS download folder and result is same. I am 99% sure all files are updated to latest cvs.
There had been no updates for several days when the problem arose and I had been actively working on the site without problem.
Would there be some database structure changes in this period since the install? If so, can I run an update or manually update?
I am not having any problems with a similar setup running under xampp local server.
There is nothing in the error log - the last entry is below (can't remember what this error was about)
Wed 06 Dec 2006 14:37:28 PGT - 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1. SQL in question: SELECT STRAIGHT_JOIN s.*, UNIX_TIMESTAMP(s.date) AS day, u.username, u.fullname, u.photo, t.topic, t.imageurl FROM gl_stories AS s, gl_users AS u, gl_topics AS t WHERE (s.uid = u.uid) AND (s.tid = t.tid) AND (date <= NOW()) AND (draft_flag = 0) AND frontpage = 1 ORDER BY featured DESC, date DESC LIMIT 0,
Thanks
Laurie
Re: admin error with staticpages
Posted on: 12/10/06 05:57am
By: Dirk
Okay, so we seem to have the same problem here on geeklog.net (which I have just updated to the latest CVS version). So relax, it's nothing you did.
Will look into it and come back to you ...
bye, Dirk
Re: admin error with staticpages
Posted on: 12/10/06 07:14am
By: Dirk
Okay, simple fix: In staticpages/index.php, add this line
Text Formatted Code
$sql = array();
as the new line 171, i.e. just before the line that starts with $sql['mysql'] = ...
Or update the file from CVS. That should fix it. Thanks for the report.
bye, Dirk
Re: admin error with staticpages
Posted on: 12/10/06 07:54am
By: ldfoo
Thanks :shakehands: