News:

Looking for documentation? Take a look on our wiki

Main Menu

Fatal Error when VM Search plugin enabled

Started by rand486, December 06, 2012, 22:05:17 PM

Previous topic - Next topic

rand486

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.

bytelord

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
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

rand486

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

bytelord

An if maybe will be better .... if joomla version 1.5 then ... else ...


Regards
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

rand486

Yes, I did use an if statement - just trying to keep the instructions basic, as most Joomla users aren't PHP developers.  :)

Thanks again!

axelf

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.

jenkinhill

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
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum