Howdy, Stranger!

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

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

Bugfix: class.faq.php > public faqs are displayed in featured section in sidebar

Public faqs appear in the sidebar featured section on the frontpage.

affected file 1: include > class.faq.php
affected file 2: include > client > templates > sidebar.tmpl.php

Because we don't know all the places where the relevant function "getFeatured()" is embedded, we decided to write a new function "getFeaturedFaq()".

Please insert in "class.faq.php" after the "static function getFeatured() {" from line 344 to line 348 after the closing tag "}" the following lines:

    /* DMT EXTENDED additional function featured faq */
    static function getFeaturedFaq() {
        return static::objects()
            ->filter(array('ispublished'=>self::VISIBILITY_FEATURED))
            ->order_by('-ispublished');
    }

Save the changes and upload it to your server in the right place.

Now you have to edit "sidebar.tmpl.php" and replace the following code in line 22:

    $faqs = FAQ::getFeatured()->select_related('category')->limit(5);

with

     <?php $faqs = FAQ::getFeaturedFaq()->limit(5);

Save the changes and upload it to your server in the right place.

That's it, now only featured faqs will be displayed.

Best regards,
Jürgen

BTW: The bug crashing the page if a faq categorie is featured containing featured faq is solved with this bugfix, too.

Tagged:
Sign In or Register to comment.