[fixed] Malformed SQL in plugin

More
10 years 11 months ago - 10 years 11 months ago #18256 by tripslip38
I've just begin beta testing with a few other users, and encountered this error.

Joomla 3.1.1
Jomsocial 2.8.4
plg_geommunitylocator 2.3.4

I get a 1064 error, which I think is malformed SQL. I ran the query that is echoed from the error, and the problem is obvious:
Code:
SELECT j.latitude, j.longitude, j.friendcount,j.thumb, u. FROM bcp3jm_community_users AS j LEFT JOIN bcp3jm_users AS u ON u.id = j.userid WHERE j.userid='3885' AND j.latitude<255 AND j.longitude<255

The u. table in the SELECT clause has no column specified. Once I added something like u.id, the query ran fine.

I found this section of code in the plugin:
Code:
$query = "SELECT j.latitude, j.longitude, j.friendcount,j.thumb, u.".$this->db->nameQuote($fnaming)." FROM #__community_users AS j LEFT JOIN #__users AS u ON u.id = j.userid WHERE j.userid='".$fid."' AND j.latitude<255 AND j.longitude<255";

Apparently $this->db->nameQuote($fnaming) is not correct or not being set, resulting in the malformed SQL.

Any tips on how to fix this would be appreciated. I've had to temporarily disabled the plugin, because the error is fatal.
Last edit: 10 years 11 months ago by nordmograph.

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

More
10 years 11 months ago #18259 by nordmograph
Replied by nordmograph on topic Malformed SQL in plugin
Hello

Yes, you're right, I updated the package yesterday for this issue.
replace
$this->db->nameQuote($fnaming)
with
$fnaming

- Need help? Post the URL of the related page (eventualy as confidential info), it will help solve your issue faster.
- An error, notice or warning? report the exact message including the line number
- If you get a white page , enable error reporting and / or check your server error logs.

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

Time to create page: 0.312 seconds
Powered by Kunena Forum
Disclaimer: Nordmograph is not affiliated with or endorsed by The Joomla! Project™. Any products and services provided through this site are not supported or warrantied by The Joomla! Project or Open Source Matters, Inc. Use of the Joomla!® name, symbol, logo and related trademarks is permitted under a limited license granted by Open Source Matters, Inc.