Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Error search Invaliq Database query
Avatar
Hegemony
Member
Free Members
sp_UserOfflineSmall Offline
Feb 22, 2015 - 12:18 am

Hi,

i have a problem with

"list topic you have post"

"list topic you started"

got error like in title. Checking error log i found

file: xxxxxxxxxxxxxxxxxxxxxxxxx/wp-content/plugins/simple-press/forum/content/classes/sp-search-view-class.php
line: 222
function: select
error: Unknown column 'wp_sfposts.wp_sfposts.topic_id' in 'field list'

SELECT SQL_CALC_FOUND_ROWS DISTINCT wp_sfposts.wp_sfposts.topic_id FROM wp_sfposts JOIN wp_sftopics ON wp_sftopics.topic_id = wp_sfposts.topic_id WHERE wp_sfposts.user_id=10 AND wp_sfposts.forum_id IN (11,10,12,13) AND topic_hide_posters=0 ORDER BY wp_sfposts.topic_id DESC LIMIT 0, 30

 

i think error is becouse of  'wp_sfposts.wp_sfposts.topic_id

'wp_sfposts.wp_sfposts.topic_id' is double it should be  'wp_sfposts.topic_id' i guess

 

any suggestion how can fix this? i'm unable to use list topic post/started frown

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Feb 22, 2015 - 4:13 am

Wow....

Seems like there is a problem with the Hide Poster plugin that has been missed until now. Apologies for that. I will open a ticket quickly and take a look at what is going on. If it is a simple fix I will post it here in case you want to make the edit locally.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Feb 22, 2015 - 6:33 am

Again - sorry about this. The search code and query was changed and this addition to the search query was overlooked. If you Do want to make an edit to allow it to function then here are the details. It is very simple.

The file you need to edit is in the Simple:Press Plugins folder - i.e., where our own plugins are located. You need the file /problem-with-post-edit-buttonide-poster/sp-hide-poster-plugin.php

At line 213 is this function:

function sp_hide_poster_search_query($query, $searchterm, $searchtype, $searchinclude, $seachthis) {
    if ($searchtype == 4 || $searchtype == 5) {
        $query->fields = str_replace('topic_id' , SFPOSTS.'.topic_id', $query->fields);
        $query->where.= ' AND topic_hide_posters=0';
        $query->where = str_replace('user_id' , SFPOSTS.'.user_id', $query->where);
        $query->join.= SFTOPICS.' ON '.SFTOPICS.'.topic_id = '.SFPOSTS.'.topic_id';
    }
    return $query;
}

You just need to remove the line of code:

$query->fields = str_replace('topic_id' , SFPOSTS.'.topic_id', $query->fields);

and all should then be well.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Hegemony
Member
Free Members
sp_UserOfflineSmall Offline
Feb 22, 2015 - 8:21 am

OMG! Its workedlaugh

Is not important since you solution fixed the problem at all but can I ask if you have any idea how i have create this error so i will try to avoid and not repeat in future or it's is just a random issue? 

thanks for fast help I would never tired to repeat Simple Press Team is one of best support eversmile

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Feb 22, 2015 - 9:12 am

Thanks. And you're welcome.

We will release the fix to the hide posters plugin in the next round of updates so just update when it is available and the fix will be permanent.

andy-signature.png
YELLOW
SWORDFISH
Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 617
Members: 17359
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10125
Posts: 79620