VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: lostmail on February 11, 2023, 15:29:49 PM

Title: Unsupported operand types: string * int
Post by: lostmail on February 11, 2023, 15:29:49 PM
HI there,
I set in my htaccess from AddHandler php74-cgi .php to AddHandler php81-cgi .php

Now I have the problem, that i get this message when i click categories/sub categories:

"0 Unsupported operand types: string + int"

I have an older backup as test environment which i updated with to current joomla and vm but here the error message is not coming up...same server/webspace.

Any idea what is crashing the category navigation ?

Another strange thing is that in category navigation some links open the subcategories and some links don`t open them (but they have su-categories) - than only the category overvie in main page is visible but not in the category navigation tree.
But clicking a sub category in main page the same error message comes up
"0 Unsupported operand types: string + int"

Changin back to PHP7.4 the problem does not exist (beside the trouble with the not showing sub-menus in category try at some main categories..some slide out the sub categories - some not)....

Thank you.
Title: Re: Unsupported operand types: string * int
Post by: AH on February 11, 2023, 17:28:17 PM
Currently VM supports up to PHP 8.0
Title: Re: Unsupported operand types: string * int
Post by: lostmail on February 11, 2023, 19:23:53 PM
Changed to 8.0 - same problem
https://www.bts-autoteile.de/_TEST/index.php/de/neuheiten
Title: Re: Unsupported operand types: string * int
Post by: GJC Web Design on February 11, 2023, 21:16:57 PM
you need to provide an error trace ... no one can just "guess" where this error comes from..

Could just as easily be from a 3rd party ext or template
Title: Re: Unsupported operand types: string * int
Post by: lostmail on February 11, 2023, 23:43:18 PM
Like this one ?


QuoteUnsupported operand types: string * int

Call stack
#    Function    Location
1    ()    JROOT/templates/horme_3_pro/html/com_virtuemart/sublayouts/badges.php:9
2    include()    JROOT/components/com_virtuemart/helpers/shopfunctionsf.php:567
3    shopFunctionsF::renderVmSubLayout()    JROOT/templates/horme_3_pro/html/com_virtuemart/sublayouts/products.php:129
4    include()    JROOT/components/com_virtuemart/helpers/shopfunctionsf.php:567
5    shopFunctionsF::renderVmSubLayout()    JROOT/templates/horme_3_pro/html/com_virtuemart/category/default.php:210
6    include()    JROOT/libraries/src/MVC/View/HtmlView.php:701
7    Joomla\CMS\MVC\View\HtmlView->loadTemplate()    JROOT/components/com_virtuemart/helpers/vmview.php:81
8    VmView->display()    JROOT/components/com_virtuemart/views/category/view.html.php:534
9    VirtuemartViewCategory->display()    JROOT/components/com_virtuemart/controllers/category.php:61
10    VirtueMartControllerCategory->display()    JROOT/libraries/src/MVC/Controller/BaseController.php:702
11    Joomla\CMS\MVC\Controller\BaseController->execute()    JROOT/components/com_virtuemart/virtuemart.php:128
12    require_once()    JROOT/libraries/src/Component/ComponentHelper.php:402
13    Joomla\CMS\Component\ComponentHelper::executeComponent()    JROOT/libraries/src/Component/ComponentHelper.php:377
14    Joomla\CMS\Component\ComponentHelper::renderComponent()    JROOT/libraries/src/Application/SiteApplication.php:194
15    Joomla\CMS\Application\SiteApplication->dispatch()    JROOT/libraries/src/Application/SiteApplication.php:233
16    Joomla\CMS\Application\SiteApplication->doExecute()    JROOT/libraries/src/Application/CMSApplication.php:225
17    Joomla\CMS\Application\CMSApplication->execute()    JROOT/index.php:49
Title: Re: Unsupported operand types: string * int
Post by: lostmail on February 11, 2023, 23:54:00 PM
Switched shop/configuration/templates to category template vmbeez3 - Standard and now I receive some more information:

Quote#0 Unsupported operand types: string * int

/www/htdocs/w014c4cc/bts-autoteile.de/_TEST/templates/horme_3_pro/html/com_virtuemart/sublayouts/badges.php:9
Call stack
#    Function    Location
1    ()    JROOT/templates/horme_3_pro/html/com_virtuemart/sublayouts/badges.php:9
2    include()    JROOT/components/com_virtuemart/helpers/shopfunctionsf.php:567
3    shopFunctionsF::renderVmSubLayout()    JROOT/templates/horme_3_pro/html/com_virtuemart/sublayouts/products.php:129
4    include()    JROOT/components/com_virtuemart/helpers/shopfunctionsf.php:567
5    shopFunctionsF::renderVmSubLayout()    JROOT/templates/horme_3_pro/html/com_virtuemart/category/default.php:210
6    include()    JROOT/libraries/src/MVC/View/HtmlView.php:701
7    Joomla\CMS\MVC\View\HtmlView->loadTemplate()    JROOT/components/com_virtuemart/helpers/vmview.php:81
8    VmView->display()    JROOT/components/com_virtuemart/views/category/view.html.php:534
9    VirtuemartViewCategory->display()    JROOT/components/com_virtuemart/controllers/category.php:61
10    VirtueMartControllerCategory->display()    JROOT/libraries/src/MVC/Controller/BaseController.php:702
11    Joomla\CMS\MVC\Controller\BaseController->execute()    JROOT/components/com_virtuemart/virtuemart.php:128
12    require_once()    JROOT/libraries/src/Component/ComponentHelper.php:402
13    Joomla\CMS\Component\ComponentHelper::executeComponent()    JROOT/libraries/src/Component/ComponentHelper.php:377
14    Joomla\CMS\Component\ComponentHelper::renderComponent()    JROOT/libraries/src/Application/SiteApplication.php:194
15    Joomla\CMS\Application\SiteApplication->dispatch()    JROOT/libraries/src/Application/SiteApplication.php:233
16    Joomla\CMS\Application\SiteApplication->doExecute()    JROOT/libraries/src/Application/CMSApplication.php:225
17    Joomla\CMS\Application\CMSApplication->execute()    JROOT/index.php:49

In line 9 I found:
$ndate = strtotime ('now') - ($days * 86400); ?>

Is that a problem in php 8.0 ?
Title: Re: Unsupported operand types: string * int
Post by: lostmail on February 12, 2023, 00:14:07 AM
Commented out this line for testing in /templates/horme_3_pro/html/com_virtuemart/sublayouts/badges.php:9 :

//$ndate = strtotime ('now') - ($days * 86400); ?>

Now the site works....categories and products are now loading.

What does PHP8 have a problem with this line ?
Title: Re: Unsupported operand types: string * int
Post by: jenkinhill on February 12, 2023, 12:07:24 PM
Same as in this thread:  http://forum.virtuemart.net/index.php?topic=149069.msg533461#msg533461
Title: Re: Unsupported operand types: string * int
Post by: lostmail on February 12, 2023, 14:42:00 PM
PERFECT SOLUTION.

Works  now as it should.

Thank you !

Did not find that thread in my forum searches...