[SOLVED] Fatal error on child pages after 1.6.3 upgrade

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
dcx0014
New Member
New Member
Posts: 7
Joined: Fri Mar 27, 2009 6:26 pm

[SOLVED] Fatal error on child pages after 1.6.3 upgrade

Post by dcx0014 »

I have the exact same issue described in a solved post. My problem is not solved however.

See: http://forum.cmsmadesimple.org/index.ph ... .msg172552

I just upgraded to 1.6.3 and use pretty URL's. After upgrading all of my top level pages are fine but all child pages display this fatal error message.

Code: Select all

<link rel="canonical" href="
Fatal error: Call to a member function GetURL() on a non-object in /home/username/public_html/tmp/templates_c/%%35^350^3509D670%%tpl_head%3A16.php on line 7
Linux
Apache 2.2.11
PHP 5.2.9
CMSMS 1.6.3
URL: removed

My config.php URL settings look like this

Code: Select all

#------------
#URL Settings
#------------

#What type of URL rewriting should we be using for pretty URLs?  Valid options are:
#'none', 'internal', and 'mod_rewrite'.  'internal' will not work with IIS some CGI
#configurations. 'mod_rewrite' requires proper apache configuration, a valid
#.htaccess file and most likely {metadata} in your page templates.  For more
#information, see:
#http://wiki.cmsmadesimple.org/index.php/FAQ/Installation/Pretty_URLs#Pretty_URL.27s
$config['url_rewriting'] = 'mod_rewrite';

#Extension to use if you're using mod_rewrite for pretty URLs.
$config['page_extension'] = '/';

#If you're using the internal pretty url mechanism or mod_rewrite, would you like to
#show urls in their hierarchy?  (ex. http://www.mysite.com/parent/parent/childpage)
$config['use_hierarchy'] = true;

#If using none of the above options, what should we be using for the query string
#variable?  (ex. http://www.mysite.com/index.php?page=somecontent)
$config['query_var'] = 'page';
My .htaccess settings look like this

Code: Select all

#Rewrites page.shtml as index.php?page
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.+)$ index.php?page=$1 [QSA]

Options +FollowSymLinks
RewriteEngine on
RewriteBase /

# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.
RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]

# Rewrites urls in the form of /parent/child/
# but only rewrites if the requested URL is not a file or directory
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
Last edited by dcx0014 on Sun Aug 16, 2009 4:32 pm, edited 1 time in total.
jce76350
Beta Tester
Beta Tester
Posts: 2095
Joined: Mon May 29, 2006 1:20 pm

Re: Fatal error on child pages after 1.6.3 upgrade

Post by jce76350 »

Hi,

Are you sure you have in the Tag into your template
{if isset($canonical)}{elseif isset($content_obj)}GetURL()}" />{/if}
between and 
Jean-Claude Etiemble MyPageFr
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Fatal error on child pages after 1.6.3 upgrade

Post by calguy1000 »

This bug is fixed in svn and will be released with the upcoming 1.6.4 release.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
dcx0014
New Member
New Member
Posts: 7
Joined: Fri Mar 27, 2009 6:26 pm

Re: Fatal error on child pages after 1.6.3 upgrade

Post by dcx0014 »

jce76350 - In my template I replaced this

Code: Select all

<link rel="canonical" href="{if isset($canonical)}{$canonical}{else}{$content_obj->GetURL()}{/if}" />
With your posted info

Code: Select all

{if isset($canonical)}<link rel="canonical" href="{$canonical}" />{elseif isset($content_obj)}<link rel="canonical" href="{$content_obj->GetURL()}" />{/if}
And it worked!

Thank you.

Solved
Post Reply

Return to “CMSMS Core”