Osticket: Unable to add FAQ after adding Category - v1.10-rc.2-376-g784184b

Created on 3 May 2016  ·  5Comments  ·  Source: osTicket/osTicket

osTicket Version v1.10-rc.2-376-g784184b (784184b) —  Up to date
Web Server Software Apache/2.4.6 (CentOS) PHP/5.4.16
MySQL Version 5.5.47
PHP Version 5.4.16

If I go to the page /scp/kb.php I can see that there are 0 (zero) categories in the drop down. I also see 0 (zero) FAQ entries in that drop down.

Then go to /scp/categories.php and add a category. The category is added correctly.

Then go back to /scp/kb.php to add a FAQ entry into the KB and I am no longer able to activate either of the drop downs, and I see the following in my apache error log:

PHP Fatal error: Call to a member function sort() on a non-object in /var/www/html/include/staff/faq-categories.inc.php on line 147

Most helpful comment

BTW I have reverted from

146: if (count($categories)) {
147: $categories->sort(function($a) { return $a->getLocalName(); });

to this:

146: if (count($categories)) {
147: usort($categories, function($a, $b) {
148: return strcmp($a->getLocalName(), $b->getLocalName());
149: });

and it works.

All 5 comments

I'm getting this as well...

BTW I have reverted from

146: if (count($categories)) {
147: $categories->sort(function($a) { return $a->getLocalName(); });

to this:

146: if (count($categories)) {
147: usort($categories, function($a, $b) {
148: return strcmp($a->getLocalName(), $b->getLocalName());
149: });

and it works.

same problem :(

thanks @rbukovansky it works 👍

I believe this is formally fixed in #3216

Was this page helpful?
0 / 5 - 0 ratings