Error Message for URL

Permalink 1 user found helpful
When I select my URL on my projects, I receive the following error message:

<link rel="stylesheet" media="screen" type="text/css" href="<br /> <b>Fatal error</b>: Call to a member function getPackageHandle() on a non-object in <b>/home/c5host/msm_versions/032113/concrete/core/libraries/view.php</b> on line <b>105</b><br />

I just started with Concrete5 and purchased a theme today. I'm eager to get started.

Thanks.

View Replies:
McCormick replied on at Permalink Reply
McCormick
For a quick fix, you could move your style.css to your_root/css/, then use one of the following examples where appropriate.

<link rel="stylesheet" media="screen" type="text/css" href="<?php  echo DIR_REL.'/css/style.css'; ?>" />


<link rel="stylesheet" media="screen" type="text/css" href="<?php  echo BASE_URL.'/css/style.css'; ?>" />
mhawke replied on at Permalink Reply
mhawke
I would try removing and re-installing the theme. I don't believe this kind of error can be fixed by re-locating a css file. What theme did you purchase? You should ask the developer of the theme for help.
McCormick replied on at Permalink Reply
McCormick
mhawke, pardon my candor, I think your answer has no merit. Why don't you think that moving the file to your_root/css will fix the problem? Did you try it? The problem here concerns the URL, according to snowhook.

snowhook, try replacing getPackageHandle() with getThemePath(), as seen in the following example.

<link href="<?php  echo $this->getThemePath(); ?>/css/style.css" rel="stylesheet" type="text/css" />


If I were you, though, I'd certainly try out one of my first suggestions.
losttheplot replied on at Permalink Reply
losttheplot
Just in case anyone finds this page after searching for something like "PHP Fatal error: Call to a member function getPackageHandle() on a non-object in ... concrete/core/libraries/view.php on line 124" try this:

As suggested by McCormick above, this particular failure is down to the inability of the system to find and load the theme's CSS file. In my case this was because I had removed all the default themes then installed my own. What I hadn't appreciated, being fairly new to concrete5, is that after installing, a theme has to be activated (blue button on the Themes page). Because the theme had not been activated, the system could not find its CSS file, and threw the error. Simples!
arb100 replied on at Permalink Reply
Thanks for that, spot on. A quick solutions is to go to yoururl/index.php/dashboard and then you can activate the theme.