Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with PHP8.1 on Sitemap page in admin panel #209

Closed
vinprom1 opened this issue Jan 20, 2023 · 1 comment
Closed

Error with PHP8.1 on Sitemap page in admin panel #209

vinprom1 opened this issue Jan 20, 2023 · 1 comment
Labels
PHP 8+ Fixes for PHP 8.0 and 8.1+ compatibility

Comments

@vinprom1
Copy link

Error when open /admin/index.php?page=site_map with PHP8.1 (in PHP7.4 work fine)

TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /templates_c/e9672fb4d91ca01e8a2228f9e4b44bffcf040c4a_0.geo_tset.site_map_category.php:50
Stack trace:
#0 /vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_63ca4e9c5593c7_98046444()
#1 /vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode()
#2 /vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(383): Smarty_Template_Compiled->render()
#3 /templates_c/b1821f320aad8afd58b028add6adfa08895b1117_0.geo_tset.admin_site_map_index.php(44): Smarty_Internal_Template->_subTemplateRender()
#4 /vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_63ca4e9c554197_91139282()
#5 /vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode()
#6 /vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(216): Smarty_Template_Compiled->render()
#7 /vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(238): Smarty_Internal_Template->render()
#8 /vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(116): Smarty_Internal_TemplateBase->_execute()
#9 /classes/php5_classes/Template.class.php(485): Smarty_Internal_TemplateBase->fetch()
#10 /classes/geo_smarty_plugins/function.body_html.php(50): geoTemplate::loadInternalTemplate()
#11 /templates_c/48330c44fba757c8d0301f61fc1cc670b997acd9_0.geo_tset.index.php(252): smarty_function_body_html()
#12 /vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_63ca4e95c9d7e9_35299192()
#13 /vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode()
#14 /vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(216): Smarty_Template_Compiled->render()
#15 /vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(238): Smarty_Internal_Template->render()
#16 /vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(116): Smarty_Internal_TemplateBase->_execute()
#17 /classes/php5_classes/View.class.php(1840): Smarty_Internal_TemplateBase->fetch()
#18 /admin/php5_classes/Admin.class.php(217): geoView->toString()
#19 /admin/php5_classes/Admin.class.php(576): geoAdmin->toString()
#20 /admin/index.php(16): geoAdmin->load_page()
#21 {main}

@blufyremedia blufyremedia added the PHP 8+ Fixes for PHP 8.0 and 8.1+ compatibility label May 10, 2023
@iBeleave
Copy link

count no longer works in smarty templates if called on non-countable or null value
suggested fix, just check if the item exists, which seems to work fine in smarty. Replace the lines shown below in
\admin\templates\site_map\category.tpl

- {if count($category.children_pages) > 0}
+ {if $category.children_pages}
- {if count($category.children_categories) > 0}
+ {if $category.children_categories}	

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PHP 8+ Fixes for PHP 8.0 and 8.1+ compatibility
Projects
None yet
Development

No branches or pull requests

3 participants