Advertisement

05.14.2008 at 08:34AM PDT, ID: 23401840
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

6.4

Joomla: _session not initialized

Asked by alberthendriks in PHP Scripting Language, Miscellaneous Web Development

Tags: , ,

I am inside a joomla administrator component. It is an extension to administrator/com_menus. The extension comes from virtuemart and it should make it possible to select a virtuemart category when creating a new menu item. However, the extension was meant for an older version of Joomla. I'm trying to make it work for version 1.0.15.
The problem is that $my->id is equal to zero, even when I am logged in (remember that I am in the administrator). The cause is probably related to the notices I get:

Notice: Trying to get property of non-object in includes\joomla.php on line 1204
Notice: Trying to get property of non-object in includes\joomla.php on line 1205
Notice: Trying to get property of non-object in includes\joomla.php on line 1206
Notice: Trying to get property of non-object in includes\joomla.php on line 1207

These notes are caused by $this->_session not being set before the attached code from the core is executed (where $user->id = intval ... is line 1204).
$mainframe->initSession() is by the way never called but I don't know if it should be.

Why is _session not set when the Joomla core calls getUser?Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
function getUser() {
global $database;
$user = new mosUser( $this->_db );
 
$user->id = intval( $this->_session->userid );
$user->username = $this->_session->username;
$user->usertype = $this->_session->usertype;
$user->gid = intval( $this->_session->gid );
...
[+][-]05.19.2008 at 03:52AM PDT, ID: 21596504

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: PHP Scripting Language, Miscellaneous Web Development
Tags: Joomla!, Joomla!, 1.0.15
Sign Up Now!
Solution Provided By: alberthendriks
Participating Experts: 0
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628