Page 1 of 1

Error With K2

Posted: 30 Jun 2009, 18:44
by longtex
First - yes, I searched, but "K2" won't search because it's only two characters... so...

We've added phocagallery last week, for our Public Information Officer to use in building news-related picture galleries - very, very nice.

I was trying to test K2 in our new Joomla site. It looks pretty good - although it would be nice for it to have a script to convert (or copy) existing articles into the K2 article base.

Then I tried to write a K2 article... and... ERROR! Same error occurs when trying to edit existing one, also.

Code: Select all

Fatal error: Class 'JSite' not found in /var/www/example.com/cms/plugins/content/phocagallery.php on line 37
I uninstalled and reinstalled K2, changed to the 2.0 beta, and still the error persists. I didn't want to uninstall phoca, because our PIO has already got photos in it and I didn't want to ruin her work.

I mentioned this in the K2 user forum, and there is another user with the same message there, but I thought this error would be of interest to Phoca developers and users as well, and perhaps this group might have a better (or quicker) idea about what's the problem.

Thanks - Tex

Re: Error With K2

Posted: 30 Jun 2009, 21:12
by Jan
Hi, the problem is, I don't know what is a K2 :( :oops: :(

Re: Error With K2

Posted: 30 Jun 2009, 21:45
by longtex
Jan wrote:Hi, the problem is, I don't know what is a K2 :( :oops: :(
Darn - sorry... I'm just so excited about Joomla that I feel it must be true so is everyone! K2 is a Joomla extension apparently quite new. Link: http://extensions.joomla.org/extensions ... 61/details

It seems to have some sort of imaging plugin in mind and as I do not install that one, perhaps it defaults to what it finds - namely Phocagallery - and for whatever reason does not define Jsite (what is Jsite?).

K2 seems to be getting some buzz (or maybe I'm just too enthusiastic?) and therefore it seems to me it would be good to make sure K2 and Phoca play together properly.

Oh... just another question: we are looking at other templates (we use for now the "standard" rhuk_milkyway), and as we look I would like to consider if there are templates with known inconsistencies vis-a-vis Phoca? I research now templates such as Rocketthemes, Joomla24 and so on. If there is somewhere a list of potential problems, could you give me a link?

Thanks - Tex

Re: Error With K2

Posted: 30 Jun 2009, 22:48
by Jan
Hi, I did all Phoca extensions for working with all standard templates,so if the template has standard coding, there should not be a problem. Of course, there can be some conflict in every template (e.g. the same name will be used in css), so you need to test it :( As Phoca extensions use mostly "phoca" names in e.g. CSS, the conflict with some other template should be minimal.

Jan

Re: Error With K2

Posted: 01 Jul 2009, 00:49
by longtex
Jan wrote:Hi, I did all Phoca extensions for working with all standard templates,so if the template has standard coding, there should not be a problem. Of course, there can be some conflict in every template (e.g. the same name will be used in css), so you need to test it :( As Phoca extensions use mostly "phoca" names in e.g. CSS, the conflict with some other template should be minimal.Jan
Jan, Phocagallery works perfectly except with K2. I use the standard rhuk_milkyway template. After installing Com K2 , then when New Article is invoked in regular Article manager, it's still good (I do not see anything in that Article editor about Phoca, so I don't know what is the plugin doing - is it for standard Article? I don't know - I don't see it, although the regular "Image" button is there as always - maybe I just don't have phocagallery turned on for standard New Article editing?)

But, for some reason when K2 New Article is invoked, it somehow apparently wants to run phocagallery plugin, and phocagallery throws the error message about Jsite which I mentioned in first message. What is Jsite? How does phocagallery normally find it? Here's the code I see in phocagallery.php (partial only to show the exact code) :
function onPrepareContent( &$article, &$params, $limitstart )
{
$user = &JFactory::getUser();
$gid = $user->get('aid', 0);
$db = &JFactory::getDBO();
$menu = &JSite::getMenu(); <----- this is the offending line mentioned in the error message
$document = &JFactory::getDocument();

// LIBRARY
$library = &PhocaLibrary::getLibrary();
$libraries['pg-css-sbox-plugin'] = $library->getLibrary('pg-css-sbox-plugin');
This seems to mean that Jsite hasn't been defined. I don't know if it's completely missing and won't work for anything, or if the regular New Article manager defines it properly and only K2 doesn't, or what?

How and where does the phocagallery plugin get run? What code defines "Jsite"?

Re: Error With K2

Posted: 02 Jul 2009, 20:37
by Jan
Hi, you can find the class here:

includes\application.php

This class should be loaded before content is displayed.

Jan