Issues with MS SQL Queries
Describe the bug Many SQL query issues on many different pages.
Configuration phpMyFAQ on Windows Server 2019 using IIS and PHP 8.1 SQL Standard 2019 on Windows Server 2019 Standard No Elasticsearch
42000: [Microsoft][ODBC Driver 18 for SQL Server][SQL Server]Column "faqcategory_order.position" is invalid in the ORDER BY clause because it is not contained in either an aggregate function or the GROUP BY clause.
42000: [Microsoft][ODBC Driver 18 for SQL Server][SQL Server]Column 'faqdata.thema' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
I've discovered the functions and, after going through every link, found another related to Attachment management. The first one appears to be related to how categories are ordered and I can confirm that they are not ordered by name anymore. Otherwise, I'm unsure of what impact making the other changes makes.
src/phpMyFAQ/Category.php line 256: Remove fco.position
src/phpMyFAQ/faq.php line 2393: Add thema
(New) src/phpMyFAQ/Attachment/AttachmentCollection.php line 73: Add record_id,record_lang,filename,filesize,mime_type
Unsure if this is related or not, but after going into a category's properties and unchecking Show on startpage, I get the below fatal error. However, the change is successfully made.
phpMyFAQ Fatal error
Uncaught exception: 'TypeError'
Message: 'phpMyFAQ\Category::updateCategory(): Return value must be of type bool, resource returned'
Stack trace:
#0 D:\phpmyfaq\admin\category.main.php(228): phpMyFAQ\Category->updateCategory()
#1 D:\phpmyfaq\admin\index.php(404): require('...')
#2 {main}
Thrown in 'D:\phpmyfaq\src\phpMyFAQ\Category.php' on line 1144
Changing
src/phpMyFAQ/Category.php line 256: Remove fco.position
will break the sorting for categories.
@wwalker0307 do you have another idea how to fix this?
I was able to fix part of the category issues with this.
src/phpMyFAQ/Category.php line 253: Add fco.position (instead of removing it from the Order By)
It enabled me to see categories again in the admin panel (which was one of the issues).
@TheArchitectIO awesome, would you like to add a PR for this?
@thorsten I sure can.
Awesome!