Open question without category issue

Please report bugs here!

Moderator: Thorsten

Post Reply
cross
Posts: 3
Joined: Thu Aug 17, 2023 6:12 pm

Open question without category issue

Post by cross »

We had an open question get created without a category. This caused the following error:

2023/08/15 20:32:00 [error] 712365#712365: *16176 FastCGI sent in stderr: "PHP message: phpMyFAQ TypeError: phpMyFAQ\Strings::htmlentities(): A
rgument #1 ($string) must be of type string, null given, called in /opt/bitnami/faq/admin/record.questions.php on line 98 in /opt/bitnami/faq/s
rc/phpMyFAQ/Strings.php on line 306

Temporary fix:

// Change the line between the <strong> tags.
<strong>
<?php if ($category->categoryName[$openQuestion->getCategoryId()]['name']) { ?>
<?=Strings::htmlentities($category->categoryName[$openQuestion->getCategoryId()]['name']) ?>
<?php } else { ?>
<?=Strings::htmlentities(" ") ?>
<?php } ?>
</strong>
Thorsten
Posts: 15565
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Open question without category issue

Post by Thorsten »

Hi,

which version do you use?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
cross
Posts: 3
Joined: Thu Aug 17, 2023 6:12 pm

Re: Open question without category issue

Post by cross »

At the time, we were on 3.1.16.
It looks like this error has gone away with 3.2.2 which we are now on.
cross
Posts: 3
Joined: Thu Aug 17, 2023 6:12 pm

Re: Open question without category issue

Post by cross »

Now on 3.2.2 our new Questions are not being saved.
The log shows that the category id is not set in the request.
I tried selecting another category before submitting the new question. Same issue. No category id in the post request.
Here's the log:
"POST /api.service.php?action=ask-question HTTP/1.1" 200 53 "https://<our site url is here>/index.php?action=ask&category_id=0"
Thorsten
Posts: 15565
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Open question without category issue

Post by Thorsten »

Hi,

that's fixed in the upcoming 3.2.3 release.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Post Reply