Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to add FAQ after adding Category - v1.10-rc.2-376-g784184b #3096

Closed
Taps7734 opened this issue May 3, 2016 · 5 comments
Closed

Unable to add FAQ after adding Category - v1.10-rc.2-376-g784184b #3096

Taps7734 opened this issue May 3, 2016 · 5 comments

Comments

@Taps7734
Copy link

Taps7734 commented May 3, 2016

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

@rbukovansky
Copy link
Contributor

I'm getting this as well...

@rbukovansky
Copy link
Contributor

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.

@balojs
Copy link

balojs commented Jun 7, 2016

same problem :(

@balojs
Copy link

balojs commented Jun 7, 2016

thanks @rbukovansky it works 👍

balojs added a commit to balojs/osTicket-1.8 that referenced this issue Jun 8, 2016
Unable to add FAQ after adding Category - v1.10-rc.2-376-g784184b osTicket#3096
Knowledgebase: Fatal error: Call to a member function sort() on a non-object in (develop) osTicket#3186
@greezybacon
Copy link
Contributor

I believe this is formally fixed in #3216

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants