Page 1 of 1

[solved] full 1.4.1 - incomplete code in listcssassoc.php?

Posted: Tue Aug 12, 2008 5:50 pm
by AmandaBTO
I've just downloaded the full 1.4.1 so I could upgrade 1.2.1 (I think) to 1.4.1

I backed everything up, moved all the new files over and ran the upgrade (after chmod'ing config.php)

My template css associations is giving me this error:
Fatal error: Call to a member function on a non-object in /home/liquidwe/public_html/goemans/admin/listcssassoc.php on line 191

line 191 has:
$count = $result->RecordCount();
and result comes from a db execute of
$query = "SELECT assoc_css_id, css_name, assoc_order FROM ".cms_db_prefix()."css_assoc ca INNER JOIN ".cms_db_prefix()."css ON assoc_css_id = css_id WHERE assoc_type=? AND assoc_to_id = ? ORDER BY ca.assoc_order";

... WHERE assoc_type=? AND assoc_to_id = ?
Really?  This can't be right

Re: full 1.4.1 - incomplete code in listcssassoc.php?

Posted: Tue Aug 12, 2008 6:33 pm
by alby
AmandaBTO wrote: I've just downloaded the full 1.4.1 so I could upgrade 1.2.1 (I think) to 1.4.1

I backed everything up, moved all the new files over and ran the upgrade (after chmod'ing config.php)

My template css associations is giving me this error:
Fatal error: Call to a member function on a non-object in /home/liquidwe/public_html/goemans/admin/listcssassoc.php on line 191

line 191 has:
$count = $result->RecordCount();
and result comes from a db execute of
$query = "SELECT assoc_css_id, css_name, assoc_order FROM ".cms_db_prefix()."css_assoc ca INNER JOIN ".cms_db_prefix()."css ON assoc_css_id = css_id WHERE assoc_type=? AND assoc_to_id = ? ORDER BY ca.assoc_order";

... WHERE assoc_type=? AND assoc_to_id = ?
Really?  This can't be right
Have you run:  install/upgrade.php?

Alby

Re: full 1.4.1 - incomplete code in listcssassoc.php?

Posted: Tue Aug 12, 2008 6:53 pm
by AmandaBTO
Yes I did but does the install/upgrade really modify the listcssassoc.php file?

Re: full 1.4.1 - incomplete code in listcssassoc.php?

Posted: Tue Aug 12, 2008 8:04 pm
by alby
AmandaBTO wrote: Yes I did but does the install/upgrade really modify the listcssassoc.php file?
No, but ALTER your css tables

Alby

Re: full 1.4.1 - incomplete code in listcssassoc.php?

Posted: Tue Aug 12, 2008 8:14 pm
by AmandaBTO
I don't think there's anything wrong with my tables.  The php code in listcssassoc.php has:
... WHERE assoc_type=? AND assoc_to_id = ?

Literally, it has question marks in the string it's about to do a db execute on

And it's not just there.  There are question marks all through the file.  It's like someone put a place marker in the file and were going to get back to it later and then didn't

Seriously, am I the only one who's got this?

Re: full 1.4.1 - incomplete code in listcssassoc.php?

Posted: Tue Aug 12, 2008 8:37 pm
by sebjames
Just a me too - I get the same error after an upgrade from (I think) cmsms 1.0.4.

Re: full 1.4.1 - incomplete code in listcssassoc.php?

Posted: Tue Aug 12, 2008 8:45 pm
by sebjames
I tried manually running the query as shown in listcssassoc.php line 181 and got this error:

Code: Select all

mysql> SELECT assoc_css_id, css_name, assoc_order FROM cms_css_assoc ca INNER JOIN cms_css ON assoc_css_id = css_id WHERE assoc_type=? AND assoc_to_id = ? ORDER BY ca.assoc_order;
ERROR 1064 (42000): 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 '? AND assoc_to_id = ? ORDER BY ca.assoc_order' at line 1
It does seem like there's something wrong with the listcssassoc.php file...

Re: full 1.4.1 - incomplete code in listcssassoc.php?

Posted: Tue Aug 12, 2008 9:18 pm
by alby
sebjames wrote: I tried manually running the query as shown in listcssassoc.php line 181 and got this error:

Code: Select all

mysql> SELECT assoc_css_id, css_name, assoc_order FROM cms_css_assoc ca INNER JOIN cms_css ON assoc_css_id = css_id WHERE assoc_type=? AND assoc_to_id = ? ORDER BY ca.assoc_order;
ERROR 1064 (42000): 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 '? AND assoc_to_id = ? ORDER BY ca.assoc_order' at line 1
It does seem like there's something wrong with the listcssassoc.php file...
You must put valid data for ?
WHERE assoc_type=? AND assoc_to_id = ?

Alby

Re: full 1.4.1 - incomplete code in listcssassoc.php?

Posted: Tue Aug 12, 2008 9:32 pm
by AmandaBTO
alby wrote: You must put valid data for ?
WHERE assoc_type=? AND assoc_to_id = ?
Yes, we know that.  The problem is that the core listcssassoc.php file doesn't have any values there.  The php file from the downloaded gz file only has question marks

Re: full 1.4.1 - incomplete code in listcssassoc.php?

Posted: Tue Aug 12, 2008 9:38 pm
by alby
AmandaBTO wrote:
alby wrote: You must put valid data for ?
WHERE assoc_type=? AND assoc_to_id = ?
Yes, we know that.  The problem is that the core listcssassoc.php file doesn't have any values there.  The php file from the downloaded gz file only has question marks
Look at code, $query is a simple string, the row after will be execute:

Code: Select all

 $query = "SELECT assoc_css_id, css_name, assoc_order FROM ".cms_db_prefix()."css_assoc ca INNER JOIN ".cms_db_prefix()."css ON assoc_css_id = css_id WHERE assoc_type=? AND assoc_to_id = ? ORDER BY ca.assoc_order";
  $result = $db->Execute($query, array($type, $id));
and here there are $type and $id (values that substitute ?)

Alby

Re: full 1.4.1 - incomplete code in listcssassoc.php?

Posted: Wed Aug 13, 2008 2:27 pm
by AmandaBTO
Ahh, the light bulb just turned on

Fact of the matter is that I'm still getting
Fatal error: Call to a member function on a non-object in /home/liquidwe/public_html/goemans/admin/listcssassoc.php on line 191

And I now see it's because there's no assoc_order column added to the cms_css_assoc table

Guess the upgrade didn't actually upgrade everything even though it said it did.  I even tried running it again and it's still not there.  Time to add manually maybe


Edit:
The upgrade only goes to version 29 - The CMS database is up to date using schema version 29.
How do I get it to finish?

Edit again:
Aw crap!  My original ftp disconnected from the server before it copied some files over - ie version.php
It's all working now
Sorry and thanks for all your help!

Re: [solved] full 1.4.1 - incomplete code in listcssassoc.php?

Posted: Wed Aug 13, 2008 7:25 pm
by Pierre M.
He... a (not CMSms specific) transfer problem again. People, remember to use the checksum files and/or the comparison feature of FileZilla. Uploading twice rather than once never hurts.

Pierre M.

Re: [solved] full 1.4.1 - incomplete code in listcssassoc.php?

Posted: Wed Oct 08, 2008 4:54 pm
by Dee
This doesn't seem to be only an FTP transfer problem.
I just upgraded a site from 1.3.1 to 1.4.1 - the upgrade script updated the database schema to version 31, but no assoc_order column was added to css_assoc table (resulting in loss of style on all pages and Fatal error: Call to a member function RecordCount() on a non-object in listcssassoc.php on line 191)

Re: [solved] full 1.4.1 - incomplete code in listcssassoc.php?

Posted: Fri Oct 10, 2008 4:34 pm
by Pierre M.
Dee, is it reproducible ?
Please tell us more context info (hosting, sysinfo, logS, ...) to diagnose what went wrong.

Pierre M.