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

jlea9378’s picture

help please!!

markusd1984’s picture

Issue summary: View changes

@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.

markusd1984’s picture

I 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.

markusd1984’s picture

Assigned: Unassigned » markusd1984
Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.