PHP-GTK2 Cookbook Forum
Welcome, Guest
Please Login or Register.    Lost Password?
Re:bugging out in Virtuemart 2 (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: Re:bugging out in Virtuemart 2


#5507
jason.farmer (User)
Fresh Boarder
Posts: 9
graphgraph
User Offline Click here to see the profile of this user
bugging out in Virtuemart 2 9 Months, 4 Weeks ago Karma: 0  
Joomla 2.5.6 vm 2.1.10 - latest versions freshly installed on xampp using php 5.3.5 & mysql 5.5

Virtuemart now advertises that it supports joomla content plugins...

I am trying to include joomla articles into product descriptions. This was working fine for me in J1.5 vm 1.1 but I am trying to get all up to date...

I am getting the following error ...
Fatal error: Class 'ContentHelperRoute' not found in plugins\content\include_content_item\include_content_item\include_content_item.lib.php on line 242

I have posted on the Virtuemart forum asking for help, but was wondering if you had any insider info that might be useful ...

e.g. Does this error message suggest something that vm has not done to support plugins properly? Is that something I could fix?

Any help greatly appreciated.
 
  The administrator has disabled public write access.

#5510
jason.farmer (User)
Fresh Boarder
Posts: 9
graphgraph
User Offline Click here to see the profile of this user
Re:bugging out in Virtuemart 2 9 Months, 3 Weeks ago Karma: 0  
deleted
 
 
Last Edit: 2012/08/26 06:36 By jason.farmer. Reason: removing duplicate post
  The administrator has disabled public write access.

#5511
jason.farmer (User)
Fresh Boarder
Posts: 9
graphgraph
User Offline Click here to see the profile of this user
Re:bugging out in Virtuemart 2 9 Months, 3 Weeks ago Karma: 0  
Hi Some more info ...

Within Virtuemart

include_content_item 1 works
include_content_item 1 readmore=1 fails


Any ideas what code is missing in Virtuemart?
 
 
Last Edit: 2012/08/26 06:35 By jason.farmer.
  The administrator has disabled public write access.
#5512
jason.farmer (User)
Fresh Boarder
Posts: 9
graphgraph
User Offline Click here to see the profile of this user
Re:bugging out in Virtuemart 2 9 Months, 3 Weeks ago Karma: 0  
SOLVED (for include_content_item 2.5.11)

The include_content_item plugin uses the Class ContentHelperRoute when readmore is used. This class is defined when the plugin is used within Joomla articles, but not necessarily when it is used elsewhere.

Needed to add code to define the class if it wasnt defined.

Editted include_content_item.php adding
Code:
if(!class_exists('ContentHelperRoute')) {
	require_once JPATH_BASE.'/components/com_content/helpers/route.php';
}
after
Code:
jimport( 'joomla.language.helper');
giving
Code:
<?php
/**
* include_content_item plugin
* This plugin allows you to insert or include one content item
* into another content item.
* Author: kksou
* Copyright (C) 2006-2008. kksou.com. All Rights Reserved
* License: GNU/GPL http://www.gnu.org/copyleft/gpl.html
* Website: http://www.kksou.com/php-gtk2
* v1.5 May 3, 2008
* v1.6.10 July 8, 2011 support for Joomla 1.6
*/

defined( '_JEXEC' ) or die( 'Direct Access to this location is not allowed.' );

jimport( 'joomla.event.plugin' );
jimport( 'joomla.language.helper');
if(!class_exists('ContentHelperRoute')) {
	require_once JPATH_BASE.'/components/com_content/helpers/route.php';
}

$lib = dirname(__FILE__).'/include_content_item/include_content_item.lib.php';
require_once($lib);

class plgContentinclude_content_item extends JPlugin {

	function plgContentinclude_content_item( &$subject, $params ) {
		parent::__construct( $subject, $params );
 	}

	function onContentPrepare( $context, &$row, &$params, $limitstart=0 ) {

		$plugin = new Plugin_IncludeContentItem($row);

		return true;
	}
}

?>
which now works in virtuemart as well as elsewhere.
 
 
Last Edit: 2012/08/26 08:25 By jason.farmer.
  The administrator has disabled public write access.
#5513
jason.farmer (User)
Fresh Boarder
Posts: 9
graphgraph
User Offline Click here to see the profile of this user
Re:bugging out in Virtuemart 2 9 Months, 3 Weeks ago Karma: 0  
Well - my fix didn't actually work

It bugged out while trying to edit a joomla article with a path not found error... (cos JPATH_BASE now pointed to administrator which doesnt have the necessary file available) ... no idea why content plug ins are being called when editing an article... but whatever

I reversed out the change to include_content_item.php and put the same additional code into include_content_item.lib.php, just before the call to ContentHelperRoute - a real old hack but this seems to be working...
 
  The administrator has disabled public write access.
#5514
kksou (Admin)
Admin
Posts: 1680
graph
User Online Now Click here to see the profile of this user
Re:bugging out in Virtuemart 2 9 Months, 3 Weeks ago Karma: 27  
Hi Jason,

Thanks much for sharing. You seem to know Joomla framework better than me! I'm ok with PHP programming, but the Joomla framework confuses me sometimes, especially across the different versions of Joomla.

Regards,
/kksou
 
  The administrator has disabled public write access.
#5516
jason.farmer (User)
Fresh Boarder
Posts: 9
graphgraph
User Offline Click here to see the profile of this user
Re:bugging out in Virtuemart 2 9 Months, 3 Weeks ago Karma: 0  
Always a pleasure - Thank you for writing such a great plugin! It should be part of the Joomla core.
 
  The administrator has disabled public write access.



Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop

Blog - Forum - Privacy Policy - Contact Us
Links - Classes - Social Business - BPM - Web - General
Copyright © 2006-2013. kksou.com. All Rights Reserved