phpMyFAQ icon indicating copy to clipboard operation
phpMyFAQ copied to clipboard

Not able to save an faq into a restricted category

Open modelrailroader opened this issue 7 months ago • 2 comments

If I set a category for a new category which is restricted (so can only be seen by a certain group), I'm not able to save the faq. I get the following error message in the dev tools:

phpMyFAQ Fatal error

Uncaught exception: 'TypeError'

Message: 'phpMyFAQ\Filter::filterArray(): Argument #1 ($array) must be of type array, null given, called in /home/www/public_html/wordpress/ipad-faq/src/phpMyFAQ/Faq/Permission.php on line 170'

Stack trace:

#0 /home/www/public_html/wordpress/ipad-faq/src/phpMyFAQ/Faq/Permission.php(170): phpMyFAQ\Filter::filterArray()
#1 /home/www/public_html/wordpress/ipad-faq/src/phpMyFAQ/Controller/Administration/FaqController.php(322): phpMyFAQ\Faq\Permission->createPermissionArray()
#2 [internal function]: phpMyFAQ\Controller\Administration\FaqController->update()
#3 /home/www/public_html/wordpress/ipad-faq/src/phpMyFAQ/Application.php(101): call_user_func_array()
#4 /home/www/public_html/wordpress/ipad-faq/src/phpMyFAQ/Application.php(47): phpMyFAQ\Application->handleRequest()
#5 /home/www/public_html/wordpress/ipad-faq/admin/api/index.php(30): phpMyFAQ\Application->run()
#6 {main}

Thrown in '/home/www/public_html/wordpress/ipad-faq/src/phpMyFAQ/Filter.php' on line 87

If I select the restricted category, the option "Zugriff für alle Gruppen" is disabled in the next tab of the editor but in the list, there are no selections for the group which has access to the category. I think thats the reason why there is a missing array in the request.

phpMyFAQ v. 4.0.7

modelrailroader avatar Jun 01 '25 15:06 modelrailroader

This is interesting as all groups are pre-selected by default to avoid this.

thorsten avatar Jun 01 '25 15:06 thorsten

I will take a look if this works later on.

@thorsten UPDATE: The pre-selection works but the issue persists.

modelrailroader avatar Jun 01 '25 16:06 modelrailroader