Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

Private type FAQ Category visible in search

Hi,

In FAQ search page (kb-search.inc.php at the end of code), private FAQ Categorie's names with link, are visible in right column and that shouldn't happen.
Is there any fix for that?

osTicket Version     v1.10.1 (9ae093d) — Up to date
Web Server Software     Apache/2.4.25 (Debian)
MySQL Version     10.1.26
PHP Version     7.0.19-1

Regards
George

Comments

  • This might be related to the old 1.7 issue that was similar. 
    https://github.com/osTicket/osTicket-1.7/pull/691

    I've reported this to the devs to take a look at.
  • Thanks for the reply.
  • The ->exclude was missing in the foreach (kb-search.inc.php)

    foreach (Category::objects()
                            ->exclude(Q::any(array('ispublic'=>Category::VISIBILITY_PRIVATE, 'faqs__ispublished'=>FAQ::VISIBILITY_PRIVATE)))
                            ->annotate(array('faqs_count'=>SqlAggregate::count('faqs')))
                            ->filter(array('faqs_count__gt'=>0))
                            as $C) { ?>
                                <div><a href="?cid=<?php echo urlencode($C->getId()); ?>"
                                    ><?php echo $C->getLocalName(); ?></a></div>
                        <?php } ?>
  • edited November 13
    Dear lord you're right....that's a bit embarrassing lol

    I will make a pull request that fixes this issue, but I'm going to remove the ...
    , 'faqs__ispublished'=>FAQ::VISIBILITY_PRIVATE
    ... part, as you only need to exclude the categories not the faqs themselves (they will never appear in the sidebar on search).
  • Here is the pull request: https://github.com/osTicket/osTicket/pull/4083

    Thanks again for the report and suggested fix! Cheers.
Sign In or Register to comment.