Skip to Content Skip to Menu

[SOLVED] JSite Fatal Error

  • mwalshy
  • mwalshy
  • OFFLINE
  • Posts: 10
  • Thanks: 1
  • Karma: 0
12 years 1 month ago - 12 years 1 month ago #210541 by mwalshy
[SOLVED] JSite Fatal Error was created by mwalshy
Hi All -

I'm getting the following error when I'm trying to access CB Users through Administrator:


Fatal error: Class 'JSite' not found in <span>/</span>home<span>/</span>XXXX/public_html/administrator/components/com_joomdle/helpers/content.php on line 1124

This is coming from the CB Joomdle My courses plugin when it calls JoomdleHelperContent::getMenuItem() this in turn runs the following code in the Joomdle helper: $menu = &JSite::getMenu();

The JSite class doesn't appear to be showing up from inside of cbTabHandler.

Any ideas on what may be going on here?

Thanks for the help.
Last edit: 12 years 1 month ago by krileon.

Please Log in or Create an account to join the conversation.

  • mwalshy
  • mwalshy
  • OFFLINE
  • Posts: 10
  • Thanks: 1
  • Karma: 0
12 years 1 month ago #210542 by mwalshy
Replied by mwalshy on topic Re: JSite Fatal Error (SOLVED)
Got it for anyone else that needs it.

In Joomla 2.5+ you can't call JSite(). Instead:

$app = JFactory::getApplication();
$menu = $app->getMenu();
The following user(s) said Thank You: krileon

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48444
  • Thanks: 8280
  • Karma: 1443
12 years 1 month ago #210543 by krileon
Replied by krileon on topic Re: JSite Fatal Error
You probably need to use a Joomla import to load in the Joomla API you need. CB doesn't need Joomla API except core functionality, which is always present as CB has its own API.

To utilize Joomlas content helper using CB API only you can do the below (I use this in CB Articles and CB Blogs, confirmed working).
Code:
require_once ( $_CB_framework->getCfg( 'absolute_path' ) . '/components/com_content/helpers/route.php' );

Ensure the global $_CB_framework is added in your function.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum