VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: rand486 on December 06, 2012, 22:05:17 PM

Title: Fatal Error when VM Search plugin enabled
Post by: rand486 on December 06, 2012, 22:05:17 PM
Running VM 2.0.14 and Joomla 1.5.26 on Rochenhost.

When we first set up Virtuemart 2 on our site, I was very happy that eStore products showed up in the Joomla Search bar results.  However, somewhere along the way, search results stopped appearing, and instead, I get the classic white PHP error page with the following error:

QuoteFatal error: Using $this when not in object context in /home/<removed>/public_html/plugins/search/virtuemart.php on line 177

I've tried replacing the files from a fresh 2.0.14 VM install to no avail.  Any clue how to resolve this?

All search results on the VM forums say to increase the PHP memory limit, but that's not the problem.
Title: Re: Fatal Error when VM Search plugin enabled
Post by: bytelord on December 06, 2012, 23:05:48 PM
Hi,

Yes there is a $this->loadLanguage (); that is supported on joomla 2.5, please try to replace this line with:

$this->Jlang = JFactory::getLanguage();

and post back your results

Regards
Title: Re: Fatal Error when VM Search plugin enabled
Post by: rand486 on December 11, 2012, 15:47:30 PM
That did it!  Thanks!

Note for others who may come across this:  The line bytelord refers to appears twice in the file.  Replace both instances.

I also noted that the PLG_SEARCH_VIRTUEMART_PRODUCTS language entry didn't exist, so I added a line to public_html/language/en-GB/en-GB.com_search.ini that read:

PLG_SEARCH_VIRTUEMART_PRODUCTS=eStore
Title: Re: Fatal Error when VM Search plugin enabled
Post by: bytelord on December 11, 2012, 15:49:20 PM
An if maybe will be better .... if joomla version 1.5 then ... else ...


Regards
Title: Re: Fatal Error when VM Search plugin enabled
Post by: rand486 on December 11, 2012, 15:55:13 PM
Yes, I did use an if statement - just trying to keep the instructions basic, as most Joomla users aren't PHP developers.  :)

Thanks again!
Title: Re: Fatal Error when VM Search plugin enabled
Post by: axelf on February 18, 2013, 23:04:10 PM
Greetings,
having a same problem, but this is not working on J 1.5
"replace this line with: $this->Jlang = JFactory::getLanguage();"

any suggestions how to fix this on J1.5 and VM 2.0.18a?


Thanks in advance.
Title: Re: Fatal Error when VM Search plugin enabled
Post by: jenkinhill on February 19, 2013, 10:14:20 AM
Joomla 1.5 is no longer supported.  http://virtuemart.net/news/list-all-news/426-end-of-life-for-virtuemart-11-heidelpay-now-in-virtuemart-2012

"We decided to declare now the end of life for VirtueMart 1.1, and that the version 2 of VirtueMart is not any longer maintaining joomla 1.5 compatibility." 4 October 2012