Fatal error: Call to a member function get() on a non-object

Did you find a bug in Joomla! 3.x but aren't sure? This forum is the place to help figure out if the problem is a bug and how to report it. If you are an experienced Joomla! user and are certain that you have found a bug please use the Bug Tracker to submit your issue.
This forum is for discussion about bugs and to get help with reporting them to the Bug Tracker: https://issues.joomla.org

Moderator: ooffick

Forum rules
Please use the official Bug Tracker to report a bug: https://issues.joomla.org
Locked
User avatar
cavo789
Joomla! Intern
Joomla! Intern
Posts: 55
Joined: Fri Jun 05, 2009 12:16 pm
Location: Belgium
Contact:

Fatal error: Call to a member function get() on a non-object

Post by cavo789 » Wed Oct 10, 2012 9:59 am

Joomla version : 3.0.1

Hi all,

During the migration of my own component, I've encountered this error :

[php]
Fatal error: Call to a member function get() on a non-object in xxxx\joomla301\administrator\templates\isis\error.php on line 114
[/php]

Concerned code :
[php]
// Template header color
if ($this->params->get('headerColor')) {
?>
<style type="text/css">
.header
{
background: <?php echo $this->params->get('headerColor');?>;
}
</style>
[/php]

Solution : just replace $this->params by $params.

Bye and thanks for this great CMS.
Christophe, developer of aeSecure, a web firewall application (WAF) for Apache websites (https://www.aesecure.com). Web security and optimization.
If your website is hacked, I can clean it.

alexander18
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Mon Oct 15, 2012 2:30 am

Re: Fatal error: Call to a member function get() on a non-ob

Post by alexander18 » Mon Oct 15, 2012 2:34 am

I'm so sorry. I don't understand it.
Do you mean the final code is

Code: Select all

	<?php
	// Template header color
	if ($this->$params->get('headerColor'))
	{
	?>
	<style type="text/css">
		.header
		{
			background: <?php echo $this->$params->get('headerColor');?>;
		}
	</style>
	<?php
	}
	?>
right?

sovainfo
Joomla! Exemplar
Joomla! Exemplar
Posts: 8808
Joined: Sat Oct 01, 2011 7:06 pm

Re: Fatal error: Call to a member function get() on a non-ob

Post by sovainfo » Mon Oct 15, 2012 3:10 am

no, remove $this->
Issue with migrating? Include logs/joomla_update.php in your report!
Blank screen? Verify pagesource for HTML code (javascript error)
Installation failing on populating database? Install with set_time_limit(0)
Document your customizations!

alexander18
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Mon Oct 15, 2012 2:30 am

Re: Fatal error: Call to a member function get() on a non-ob

Post by alexander18 » Mon Oct 15, 2012 3:40 am

sovainfo wrote:no, remove $this->
I've done it! Thank you very much! ;)

oslicku
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Thu Jun 17, 2010 9:28 pm
Location: UK

Re: Fatal error: Call to a member function get() on a non-ob

Post by oslicku » Tue Oct 16, 2012 8:31 am

Did anyone file a bug for this issue?

User avatar
cavo789
Joomla! Intern
Joomla! Intern
Posts: 55
Joined: Fri Jun 05, 2009 12:16 pm
Location: Belgium
Contact:

Re: Fatal error: Call to a member function get() on a non-ob

Post by cavo789 » Tue Oct 16, 2012 8:36 am

I can speak for myself : no, I've create this topic; thinking that someone of the core team will take it for further processing. Isn't enough ?
Christophe, developer of aeSecure, a web firewall application (WAF) for Apache websites (https://www.aesecure.com). Web security and optimization.
If your website is hacked, I can clean it.

sovainfo
Joomla! Exemplar
Joomla! Exemplar
Posts: 8808
Joined: Sat Oct 01, 2011 7:06 pm

Re: Fatal error: Call to a member function get() on a non-ob

Post by sovainfo » Tue Oct 16, 2012 8:58 am

Sofar nobody reported it otherwise it would mentioned here with a link.
Issue with migrating? Include logs/joomla_update.php in your report!
Blank screen? Verify pagesource for HTML code (javascript error)
Installation failing on populating database? Install with set_time_limit(0)
Document your customizations!

User avatar
worshipper
Joomla! Apprentice
Joomla! Apprentice
Posts: 17
Joined: Fri Sep 02, 2005 8:19 am
Location: Kirchberg
Contact:

Re: Fatal error: Call to a member function get() on a non-ob

Post by worshipper » Sun Oct 21, 2012 3:06 pm

the problem is recognised and will fixed in the next version
Link to the tracker: http://joomlacode.org/gf/project/joomla ... m_id=29487
Joomla! News, Tipps and Video-Tuts in German
http://www.joomlainfo.ch

santhiya
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Thu Apr 11, 2013 7:16 am

Re: Fatal error: Call to a member function get() on a non-ob

Post by santhiya » Thu Apr 11, 2013 7:19 am

Hi
I got the below error message

Notice: Trying to get property of non-object in C:\xampp\htdocs\joomla\templates\shaper_helix_ii\index.php on line 25

Fatal error: Call to a member function Header() on a non-object in C:\xampp\htdocs\joomla\templates\shaper_helix_ii\index.php on line 25

My code is as below
<jdoc:include type="head" />

<?php

$params->helix->Header()

->addJS('helix.core.js')//core jsvascript file


->setLessVariables(array(

'preset'=>$this->helix->Preset(),
'header_color'=> $this->helix->PresetParam('_header'),
'bg_color'=> $this->helix->PresetParam('_bg'),
'text_color'=> $this->helix->PresetParam('_text'),
'link_color'=> $this->helix->PresetParam('_link')
))
->addLess('master', 'template')
->addLess( 'presets', 'presets/'.$this->helix->Preset() );
?>


Locked

Return to “Joomla! 3.x Bug Reporting”