Closed (fixed)
Project:
FAQ Search
Version:
6.x-1.3-beta3
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
19 Mar 2012 at 15:21 UTC
Updated:
19 Apr 2018 at 11:09 UTC
Jump to comment: Most recent
Unpublished FAQ's are appearing in the search results.
FAQ_Ask 6.x-2.1+17-dev (2012-Mar-12)
FAQ Search 6.x-1.3-beta3
Frequently Asked Questions 6.x-1.13
Comments
Comment #1
jlea9378 commentedhelp please!!
Comment #2
markusd1984 commented@jlea9378 have you received any help on this?
I just discovered the same! A user clicked the search result and to my surprise wasn't able to access the FAQs, since it's unpublished.
Pity this wasn't implemented into the search query but would be really good to have.
Comment #3
markusd1984 commentedI got help from EricLavault on stackoverflow
https://stackoverflow.com/questions/49655161/how-to-exclude-unpublished-...
I modified the db_query in faq_search.find.inc for 7.x-1.0-alpha1 but hopefully can be used for 6.x too:
$result = db_query("SELECT f.question, f.nid
FROM {faq_questions} f INNER JOIN {node} n ON f.nid = n.nid AND n.status = 1
WHERE f.question LIKE :term ORDER BY f.question asc", array(':term' => '%%' . $term . '%%'));
Which is working. Now only published nodes (faq's) will return in the search result.
Comment #4
markusd1984 commented