Topic-icon FB request not working

Support Specialist
12 years 6 months ago #38986 by alzander
Replied by alzander on topic FB request not working
Can you check the code you implemented again? It's fixing one of the issues, but not the other. Mainly, there's a missing single-quote at the end of the query shown in your error message.

Please make sure you added . "'" at the end. That's :
period-space-double quote-single quote-double quote

I hope that helps, again, but if not, let me know.

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

None
12 years 6 months ago #38988 by al3xandr0sss
Replied by al3xandr0sss on topic FB request not working
Yes it seems to be as you told me to change it. I even copied it directly from you. I paste below few lines before and few lines after directly from my file.

$query = $this->_db->getQuery(true);
$query->update($this->_db->qn('#__jfbconnect_notification'))
->set($this->_db->qn('modified') . "=" . $this->_db->q($now))
->set($this->_db->qn('status') . "=" . $this->_db->q(1))
->where($this->_db->qn('fb_user_to') . "=" . $this->_db->q($this->_fbUserId))
->where($this->_db->qn('fb_request_id') . "='" . implode("' OR fb_request_id = '", $this->_fbRequestIds)) . "'";
$this->_db->setQuery($query);
$this->_db->execute();

Maybe you see somewhere a space i dont see? I think its allright.

PS what do you mean that this would solve only one problem and not the other? Is there two problems? Which ones?
The topic has been locked.
Active Subscriptions:

None
12 years 6 months ago - 12 years 6 months ago #38989 by al3xandr0sss
Replied by al3xandr0sss on topic FB request not working
If you think i might be entering a wrong character or a space somewhere that i shouldnt you can just send me your notification.php(5.2.1 version) corrected, so as to upload it and overwrite.
Last edit: 12 years 6 months ago by al3xandr0sss.
The topic has been locked.
Active Subscriptions:

None
12 years 6 months ago - 12 years 6 months ago #39023 by al3xandr0sss
Replied by al3xandr0sss on topic FB request not working
How do we proceed? I See that a ' is missing however with the code change you suggested it didnt fix it. And not only that. Before the code change it was working half of the times. Now every time it displays the sql error.
Last edit: 12 years 6 months ago by al3xandr0sss.
The topic has been locked.
Support Specialist
12 years 6 months ago #39061 by alzander
Replied by alzander on topic FB request not working
I apologize. It took some extra investigation. There was a bug in the code I posted above with the closing ' mark. Please update it to:
$query = $this->_db->getQuery(true); 
$query->update($this->_db->qn('#__jfbconnect_notification')) 
->set($this->_db->qn('modified') . "=" . $this->_db->q($now)) 
->set($this->_db->qn('status') . "=" . $this->_db->q(1)) 
->where($this->_db->qn('fb_user_to') . "=" . $this->_db->q($this->_fbUserId)) 
->where($this->_db->qn('fb_request_id') . "='" . implode("' OR fb_request_id = '", $this->_fbRequestIds) . "'");
Basically, the "'" should be before the last ) instead of after it.

Please try that and let us know how it goes, and, again, sorry for the issues!

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

None
12 years 6 months ago #39085 by al3xandr0sss
Replied by al3xandr0sss on topic FB request not working
It seems to be working now. Thank you. Earlier you mentionned something about two issues. Maybe i understood wrong. Is there anything else or thats just it?

Regards
The topic has been locked.
Support Specialist
12 years 6 months ago #39087 by alzander
Replied by alzander on topic FB request not working
There were 2 separate changes that needed to be made to that query. It sounds like you got them both going now.

Sorry for the trouble, and thanks for pointing that out. That fix will be in the next release as well.

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

None
12 years 5 months ago - 12 years 5 months ago #39912 by dcasmr
Replied by dcasmr on topic FB request not working
Hello,
I am having exactly the same issues and using JFBConnect 5.2.2. My https seem to work fine. The page displays blank on facebook. When I enable the maximum errors, nothing is reported. I also modified the php codes using the latest suggestion to no avail.
Also, I verified that the notification table is in the database, request are created in admin panel. One thing that is weird is that the message is that the custom message that I created with the request is not sent to the user in facebook.
Please help.
Thanks
Luke
Last edit: 12 years 5 months ago by dcasmr.
The topic has been locked.
Support Specialist
12 years 5 months ago #39920 by alzander
Replied by alzander on topic FB request not working
I'm not sure why that fix didn't make it into the v5.2.2 release. It was marked to go in there, but it seems like another change reverted that code. I'm very sorry about that. The fix will definitely be in the next release.

As to your current issue, the fix above is still the correct fix for it. Basically, that last line needs to be updated in the query to look like:
->where($this->_db->qn('fb_request_id') . "='" . implode("' OR fb_request_id = '", $this->_fbRequestIds) . "'");
That last portion of . "'" is what's important.

If you're not seeing anything when you enable error reporting, it means that your server has errors forced to off. You won't be able to display them without contacting your hosting company or modifying your Apache/PHP configuration manually... Joomla will not be able to override that setting, like it should be able to.

If the code fix above is implemented correctly, but still not working, then try commenting out that whole section of code, like below:
/*
            $query = $this->_db->getQuery(true);
            $query->update($this->_db->qn('#__jfbconnect_notification'))
                    ->set($this->_db->qn('modified') . "=" . $this->_db->q($now))
                    ->set($this->_db->qn('status') . "=" . $this->_db->q(1))
                    ->where($this->_db->qn('fb_user_to') . "=" . $this->_db->q($this->_fbUserId))
                    ->where($this->_db->qn('fb_request_id') . "='" . implode("' OR fb_request_id = '", $this->_fbRequestIds) . "'");
            $this->_db->setQuery($query);
            $this->_db->execute();
*/
That /* and */ at the beginning and end will skip that block of code entirely. The worst that may happen then, for now, is that a Request won't be properly marked as read. That will narrow down if that block of code is what's causing the white screen though, which will help us figure things out much better.

Thanks,
Alex
The topic has been locked.