Topic-icon Undo and disable future sharing error

Active Subscriptions:

None
13 years 3 months ago #31530 by aaronpie
When clicking on this link, I am getting the following error. I tried this with SEF on and off. (I am using AceSEF.)

Fatal error: Call to a member function get() on a non-object in /home/public_html/components/com_jfbconnect/controllers/opengraph.php on line 122
The topic has been locked.
Support Specialist
13 years 3 months ago #31540 by alzander
Hmm. Haven't heard of that one before. The only reason that error would be thrown is if JFBConnect can't find information about the user that's logged in.

Can you let me know:
* Are you logged into Joomla when that happens? You should be, as the action should only trigger when you are, but just checking.
* Is this a new installation of JFBConnect, or was it upgraded from a previous version? Mainly.. were you ever running v4.2 or below?
* Can you post the query-string portion of the URL, like:
index.php?option=com_jfbconnect&view=opengraph&...??

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
13 years 3 months ago #31548 by aaronpie
* Are you logged into Joomla when that happens? You should be, as the action should only trigger when you are, but just checking.
Yes I am logged into Joomla with my Facebook credentials.

* Is this a new installation of JFBConnect, or was it upgraded from a previous version? Mainly.. were you ever running v4.2 or below?
I upgraded from an older installation. Not sure what version I upgraded from.

* Can you post the query-string portion of the URL, like:
www.mysite.com/index.php?option=com_jfbc...&action=4&activity=3
The topic has been locked.
Support Specialist
13 years 3 months ago #31560 by alzander
Aaron,
Hmm. everything seems right from your posted. The only thing I realize I didn't ask was what version you are currently using. I'm assuming you're on JFBConnect v5.0, but if not, let me know.

I've gone over the code and I'm having a difficult time understanding why you'd be seeing that error (and we haven't heard of the issue before). The only thing I can ask is for you to open the /components/com_jfbconnect/controllers/opengraph.php file. Around line 118, you'll see:
private function disableAction($id)
    {
        $user = JFactory::getUser();
        $userModel = JFBConnectModelUserMap::getUser($user->get('id'));
        $ogDisabledActions = $userModel->params->get('og_actions_disabled', array());
That last line is the one throwing the error. Above that, I'd like you to add 2 lines, which should print out some extra stuff before the Fatal Error you're seeing. Please add the lines like so:
private function disableAction($id)
    {
        $user = JFactory::getUser();
        $userModel = JFBConnectModelUserMap::getUser($user->get('id'));
        echo "User Id: ".$user->get('id')."<br/>";
        print_r($userModel);
        $ogDisabledActions = $userModel->params->get('og_actions_disabled', array());
That will really narrow down whether the user just can't be found by JFBConnect or whether there has been an issue upgrading at some point and some fields we need aren't in your database. Either has a solution, we just need to know what we're dealing with.

Once edited, please post the full new output here and we'll figure out how to proceed.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
13 years 3 months ago #31563 by aaronpie
Here is the output:

User Id: 315
JFBConnectModelUserMap Object ( [_pagination] => [__state_set:protected] => [_db:protected] => JDatabaseMySQLi Object ( [name] => mysqli [nameQuote:protected] => ` [nullDate:protected] => 0000-00-00 00:00:00 [dbMinimum:protected] => 5.0.4 [_database:JDatabase:private] => tavolo5_prod2013 [connection:protected] => mysqli Object ( [affected_rows] => 1 [client_info] => 5.5.21 [client_version] => 50521 [connect_errno] => 0 [connect_error] => [errno] => 0 [error] => [field_count] => 10 [host_info] => Localhost via UNIX socket [info] => [insert_id] => 0 [server_info] => 5.5.30-cll [server_version] => 50530 [stat] => Uptime: 686033 Threads: 4 Questions: 2881629 Slow queries: 0 Opens: 6709 Flush tables: 1 Open tables: 256 Queries per second avg: 4.200 [sqlstate] => 00000 [protocol_version] => 10 [thread_id] => 57093 [warning_count] => 0 ) [count:protected] => 0 [cursor:protected] => mysqli_result Object
Warning: print_r() [function.print-r]: Couldn't fetch mysqli_result in /home/tav/public_html/components/com_jfbconnect/controllers/opengraph.php on line 123

Warning: print_r() [function.print-r]: Couldn't fetch mysqli_result in /home/tav/public_html/components/com_jfbconnect/controllers/opengraph.php on line 123

Warning: print_r() [function.print-r]: Property access is not allowed yet in /home/tav/public_html/components/com_jfbconnect/controllers/opengraph.php on line 123

Warning: print_r() [function.print-r]: Couldn't fetch mysqli_result in /home/tav/public_html/components/com_jfbconnect/controllers/opengraph.php on line 123

Warning: print_r() [function.print-r]: Property access is not allowed yet in /home/tav/public_html/components/com_jfbconnect/controllers/opengraph.php on line 123
( [current_field] => [field_count] => [lengths] => [num_rows] => [type] => ) [debug:protected] => [limit:protected] => 0 [log:protected] => Array ( ) [offset:protected] => 0 [sql:protected] => SELECT um.*, (SELECT COUNT(*) FROM #__jfbconnect_notification WHERE fb_user_from = um.fb_user_id) sent, (SELECT COUNT(*) FROM #__jfbconnect_notification WHERE fb_user_to = um.fb_user_id) received FROM #__jfbconnect_user_map um WHERE j_user_id = '315' [tablePrefix:protected] => fuxpr_ [utf:protected] => 1 [errorNum:protected] => 0 [errorMsg:protected] => [hasQuoted:protected] => [quo ted:protected] => Array ( ) ) [name:protected] => usermap [option:protected] => com_jfbconnect [state:protected] => JObject Object ( [_errors:protected] => Array ( ) ) [event_clean_cache:protected] => onContentCleanCache [_errors:protected] => Array ( ) [_id] => 0 [_data] => stdClass Object ( [id] => 4 [j_user_id] => 315 [fb_user_id] => 1551631625 [access_token] => AAABoFSCu9IsBANgwHXh17f864f9Ss82MZBxWMEHVOq5xXxXEZBnlkx2jaoMi6iPZCBZClZAKJCtTSrl3Jhp4mTO1C1HzrDiKIhaffKivsAQZDZD [authorized] => 1 [created_at] => 2013-03-05 16:22:07 [updated_at] => 2013-03-06 05:17:10 [params] => JRegistry Object ( [data:protected] => stdClass Object ( [og_actions_disabled] => Array ( ) ) ) [sent] => 0 [received] => 0 ) )
Fatal error: Call to a member function get() on a non-object in /home/tav5/public_html/components/com_jfbconnect/controllers/opengraph.php on line 124

The topic has been locked.
Support Specialist
13 years 3 months ago #31576 by alzander
Aaron,
Thanks for the output. Everything there looks exactly as it should. I'm not sure where the issue is coming from.

Could you private message me a set of super admin details for your site so we can investigate further? You can PM me by clicking the arrow under my name (<
) and hitting the mail icon.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
13 years 3 months ago #31661 by aaronpie
Sent you a PM yesterday.

- Aaron
The topic has been locked.
Support Specialist
13 years 3 months ago #31679 by alzander
Aaron,
Thanks for the PM. There's a few issues I see when going to your page that may or may not be related. First off, Open Graph Actions don't work on restricted content. Facebook needs to be able to visit the page that is being posted to a user's wall. That's how it gets the Open Graph tags and verifies that the page isn't spammy, malicious, or otherwise bad. The jReviews pages on your site are restricted, which means Facebook can't access them.

Are you trying to post content from public pages, or only those for registered users?

Another thing I noticed was that that if I tried to visit a jReviews listing when not logged in, there was a PHP error coming up. That was being caused by the Open Graph - Content plugin and was due an issue with how we fetch the default image from content categories. We're looking into that, but for now, I disabled the Open Graph - Content plugin. With that disabled, that properly shows the "You are not authorised to view this resource." text without a PHP error.

With that plugin disabled, can you test again to see if you have the issue when you use the Disable & Delete link.

If it fails, we'll need to test further. Since the action hasn't been submitted or approved by Facebook, we can't trigger the action. Therefore, we can't actually trigger the action without being a developer on your App. Can you go into your Facebook Developer area and go in the "Roles" section. In the developer section, click "Add" and add my users (This email address is being protected from spambots. You need JavaScript enabled to view it.) That way, we can properly trigger the actions and diagnose what's going wrong.

Thanks,
Alex
The topic has been locked.