pivotx / PivotX

GNU General Public License v2.0
4 stars 5 forks source link

module_search.php Uncaught ArgumentCountError: #8

Closed bcmans closed 1 year ago

bcmans commented 1 year ago

hi!

getting the following error in https://mywebsite.com/data/index.php?q=slapen&w=weblog&c=default PivotX - 3.0.0-rc2: PHP version 7.4

Fatal error: Uncaught ArgumentCountError: Too few arguments to function Extensions::haveHook(), 1 passed in /home//public_html/data/pivotx/modules/module_search.php on line 625 and exactly 2 expected in /home//public_html/data/pivotx/modules/module_extensions.php:582 Stack trace: #0 /home//public_html/data/pivotx/modules/module_search.php(625): Extensions->haveHook('weigh_search_re...') #1 /home//public_html/data/pivotx/modules/module_search.php(1047): searchIndex(Array, '', 'weblog', 'default', NULL) #2 /home//public_html/data/pivotx/modules/module_parser.php(568): searchResult(NULL) #3 /home//public_html/data/pivotx/modules/module_parser.php(117): Parser->renderSearch() #4 /home//public_html/data/pivotx/render.php(268): Parser->render() #5 /home//public_html/data/index.php(24): require_once('/home//...') #6 {main} thrown in /home//public_html/data/pivotx/modules/module_extensions.php on line 582

with php version 8.0

Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /home//public_html/data/pivotx/modules/module_search.php:491 Stack trace: #0 /home//public_html/data/pivotx/modules/module_search.php(1047): searchIndex(Array, '', 'weblog', 'default', NULL) #1 /home//public_html/data/pivotx/modules/module_parser.php(568): searchResult(NULL) #2 /home//public_html/data/pivotx/modules/module_parser.php(117): Parser->renderSearch() #3 /home//public_html/data/pivotx/render.php(268): Parser->render() #4 /home//public_html/data/index.php(24): require_once('/home//...') #5 {main} thrown in /home//public_html/data/pivotx/modules/module_search.php on line 491

was running 2.3.11 under php 7.3 and did not get any error.

Thank you for trying to help!

hansfn commented 1 year ago

Both fixed in this commit for flatfile datbase. (Fix for MySQL coming up.)

PS! Until 3.0.0 (or 3.0.0-rc3) is released, please use master - download this zip-file. I'm fixing a lot of PHP 8 issues ...