PHP fatal error

nattyidub
nattyidub
@admin83512
3 weeks ago
11 posts
Hi there,

just checked the error log and found the following:

[14-Jan-2024 13:31:48 Europe/Belgrade] PHP Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /var/www/dubwise.info/html/data/cache/jrElastic2/jrSearch_search_results_tpl^e023afa55fec7b06128fc518b67511db7a527701_1.string.php:84 [1]
Stack trace: [2]
#0 /var/www/dubwise.info/html/modules/jrCore-release-7.0.1/contrib/smarty4/libs/sysplugins/smarty_template_resource_base.php(123): content_65a3d434d1a209_11120745() [1]
#1 /var/www/dubwise.info/html/modules/jrCore-release-7.0.1/contrib/smarty4/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode() [1]
#2 /var/www/dubwise.info/html/modules/jrCore-release-7.0.1/contrib/smarty4/libs/sysplugins/smarty_internal_template.php(216): Smarty_Template_Compiled->render() [1]
#3 /var/www/dubwise.info/html/modules/jrCore-release-7.0.1/contrib/smarty4/libs/sysplugins/smarty_internal_templatebase.php(238): Smarty_Internal_Template->render() [1]
#4 /var/www/dubwise.info/html/modules/jrCore-release-7.0.1/contrib/smarty4/libs/sysplugins/smarty_internal_templatebase.php(134): Smarty_Internal_TemplateBase->_execute() [1]
#5 /var/www/dubwise.info/html/modules/jrCore-release-7.0.1/lib/skin.php(903): Smarty_Internal_TemplateBase->display() [1]
#6 /var/www/dubwise.info/html/modules/jrSearch/views/results.php(61): jrCore_parse_template() [1]
#7 /var/www/dubwise.info/html/modules/jrCore-release-7.0.1/lib/module.php(314): view_jrSearch_results() [1]
#8 /var/www/dubwise.info/html/modules/jrCore-release-7.0.1/router.php(119): jrCore_run_module_view_function() [1]
thrown in /var/www/dubwise.info/html/data/cache/jrElastic2/jrSearch_search_results_tpl^e023afa55fec7b06128fc518b67511db7a527701_1.string.php on line 84 [1]

FYI: it´s the first of it´s kind - just updated to the latest JR version a few days ago.

Regards,
Sven
michael
@michael
3 weeks ago
7,646 posts
We'll get that fixed. Probably a php 'improvement'. I think count() used to return 0 when given null.

thanks
nattyidub
nattyidub
@admin83512
2 weeks ago
11 posts
allright, thanks mate.
michael
@michael
2 weeks ago
7,646 posts
are you using an over-ridden search template:
/var/www/dubwise.info/html/data/cache/jrElastic2/jrSearch_search_results_tpl

is there a file at /skins/jrElastic2//jrSearch_search_results.tpl ?

If you are then look for somewhere in there that has a line like this:
 {if count($results) > 0}
and change it to:
 {if is_array($results) && count($results) > 0}

That change already exists in the base file that I think you have over-ridden. The base file is found at:
/modules/jrSearch/templates/search_results.tpl

It could also be that you have it over-ridden via the templates editor so check at:
ACP -> SKINS -> ELASTIC2 -> TEMPLATES
override.jpg
override.jpg  •  607KB

nattyidub
nattyidub
@admin83512
one week ago
11 posts
michael:I think you have over-ridden.

Sorry for my late response - have been quite busy. To answer your question: No, I haven´t.
updated by @admin83512: 01/29/24 05:51:22AM
michael
@michael
6 days ago
7,646 posts
ok, i dunno then. If you'd be willing to send some admin level login credentials to support at jamroom dot net along with a link to this thread, I'll login and see if I can spot whats going on.
nattyidub
nattyidub
@admin83512
5 days ago
11 posts
michael:
ok, i dunno then. If you'd be willing to send some admin level login credentials to support at jamroom dot net along with a link to this thread, I'll login and see if I can spot whats going on.

sure, creds are sent to support at jamroom dot net
michael
@michael
3 days ago
7,646 posts
I have logged in, thanks. Im not seeing how to trigger the error. do you know steps to get the error to occur?

Tags