Page 1 of 1

Upgrade to 0.13 yields 'page not found', help!

Posted: Wed Jun 21, 2006 3:30 pm
by sandy
Hello,

I just upgrade our site (secchi.nrl.navy.mil) to CMS 0.13 from CMS 0.10.4
under PHP 4.3.8.  It had been running fine with the older CMS.  I copied over the
files, then ran the upgrade script and it indicated everything worked.  And, the
'admin' interface works and is fine.    I also cleared the cache from 'admin'.

However, the actual site http://secchi.nrl.navy.mil or
  http://secchi.nrl.navy.mil/index.php reports:

"This page could not be found."

That's the custom 404 message I set in admin Global Settings, so it's
clearly parsing _something_.  The source for the page reads:

This page could not be found.



In the admin, I can edit the default page so the content is still in the DB.

Help, what is missing?  This site is publically open but not yet publicized,
and we hope to go public in a week or so.

Thanks,
Sandy

more info-- the call in index.php of:
  $pageinfo = PageInfoOperations::LoadPageInfoByContentAlias($page);
for $page=7 (a valid main page in the 'admin' editor) returns page_id=-1,
template_id='notemplate', page_name = '', etc.  So it's somehow failing at this command.

A look at the MySql database shows, for content_id=7 in cms_content,
| content_id | content_name | type    | owner_id | parent_id | template_id | item_order | hierarchy  | default_content | menu_text | content_alias | show_in_menu | markup | active | cachable | last_modified_by | create_date        | modified_date      |
+------------+--------------+---------+----------+-----------+-------------+------------+-------------+-----------------+-----------+---------------+--------------+--------+--------+----------+------------------+---------------------+---------------------+
|          7 | SECCHI Home  | content |        1 |        38 |          4 |          1 | 00001.00001 |              1 | Home      | Home          |            1 | html  |      1 |        1 |                1 | 2005-11-29 13:15:49 | 2006-06-21 11:59:47 |

Re: Upgrade to 0.13 yields 'page not found', help!

Posted: Wed Jun 21, 2006 5:43 pm
by sandy
Hi,

I hack/fixed the problem, it seems 0.13 has fields in the database that do not exist from
the earlier version, so the query was breaking.  Unfortunately, I have no idea if these
missing fields will screw up stuff later down the line-- any advice?

My hack was to change the query in class.pageinfo.inc.php by removing the
'missing' fields of c.metadata, c.id_hierarchy, and c.prop_names, from:

$query = "SELECT c.content_id, c.content_name, c.content
_alias, c.menu_text, c.hierarchy, c.metadata, c.id_hierarchy, c.prop_names, c.mo
dified_date AS c_date, c.cachable, t.template_id, t.encoding, t.modified_date AS
t_date FROM ".cms_db_prefix()."templates t INNER JOIN ".cms_db_prefix()."conten
t c ON c.template_id = t.template_id WHERE (c.content_alias = ? OR c.content_id
= ?) AND c.active = 1";

To:

$query = "SELECT c.content_id, c.content_name, c.content_alias, c.menu_text, c.h
ierarchy,c.modified_date AS c_date, c.cachable, t.template_id, t.encoding, t.mod
ified_date AS t_date FROM ".cms_db_prefix()."templates t INNER JOIN ".cms_db_pre
fix()."content c ON c.template_id = t.template_id WHERE (c.content_alias = ? OR
c.content_id= ?) AND c.active = 1";

Again, will this break stuff down the road?

Help,
Sandy

Re: Upgrade to 0.13 yields 'page not found', help!

Posted: Wed Jun 21, 2006 6:12 pm
by sandy
Hi,

I think I'm figuring out why things broke-- when I manually alter a table, I get:
  ERROR 1142: alter command denied to user: 'www@localhost' for table 'cms_permissions'

So it may be a permissions problem, that the upgrade scripts just ignored.

I _think_ if I type the below (once I resolve permissions), I'll be good to go.

*sigh*
Sandy
alter table cms_css add media_type CHAR(255);
alter table cms_content add collapsed L;
alter table cms_content add id_hierarchy CHAR(255);
alter table cms_content add prop_names X;
alter table cms_content add metadata X;
alter table cms_content add titleattribute CHAR(255);
alter table cms_content add tabindex CHAR(10);
alter table cms_content add accesskey CHAR(5);
alter table cms_permissions add tmp CHAR(255);
alter table cms_permissions add permission_name C(255);
alter table cms_modules add tmp I1;
alter table cms_modules add active I1;
alter table cms_modules add active I1;
alter table cms_content add hierarchy_path X;
alter table cms_permissions change permission_name CHAR(255);
alter table cms_modules add active I1;
update cms_css set media_type = '' WHERE media_type IS NULL;
update cms_content SET collapsed=1;

Fixed!

Posted: Wed Jun 21, 2006 7:12 pm
by sandy
Hi,

Okay, thanks for letting me talk out loud here... it's fixed.  The above did the trick,
I no longer have to use the modified class file.  I hope I didn't miss something in
the database updates.

Cheers,
Sandy