Author Topic: Product edit in admin - PHP v8.0 "Unsupported operand types: string + int"  (Read 4207 times)

xur82

  • Beginner
  • *
  • Posts: 12
Virtuemart 4.0.6
Joomla 4.15

Working fine with php 7.4, but if I switch to php v 8.0 I have an error when trying to edit a product in Virtuemart Admin..
Unsupported operand types: string + int
and the product details will not display.

Any help would be appreciated, thanks

pinochico

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 1707
    • MiniJoomla
  • Skype Name: support-easysoftware
  • VirtueMart Version: 3
wait for version for PHP8 :)
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products

xur82

  • Beginner
  • *
  • Posts: 12
I have a choice on my hosting account 8.0 (which is what I am trying) and 8.1
cheers

xur82

  • Beginner
  • *
  • Posts: 12
My original post should have said php 8.0
Since your reply I just tried 8.1 and have the same error/problem with that php version too

pinochico

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 1707
    • MiniJoomla
  • Skype Name: support-easysoftware
  • VirtueMart Version: 3
Our hosting is from PHP52 to PHP8.1

cheers too  8)
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products

Jac62

  • Beginner
  • *
  • Posts: 3
  • A beginner
Same problem with Joomla 3.10.10 and PHP 8.0.
Error in front end: Unsupported operand types: string % string

It works fine with PHP 7.4
Does anyone have a clue ?
Thanks

Jac62

  • Beginner
  • *
  • Posts: 3
  • A beginner
VM 4.0.6
Same problem with Joomla 3.10.10 and PHP 8.0.
Error in front end: Unsupported operand types: string % string

It works fine with PHP 7.4
Does anyone have a clue ?
Thanks

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 10878
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.8.8
supply the bug trace with debugging so we know where it is happening...
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Jac62

  • Beginner
  • *
  • Posts: 3
  • A beginner
Hi,

in php 8, with the debug mode, the page remains blank.
Here is the code from the previous page that calls the product categories. Thanks.

{
    "__default": {
        "session": {
            "counter": 42,
            "timer": {
                "start": 1659594535,
                "last": 1659688896,
                "now": 1659688900
            },
            "token": "s3VZZJHjSFZhQrTj5QmVHFxOfhZa7i7d"
        },
        "registry": {
            "com_virtuemart": {
                "category": {
                    "limit": ""
                },
                "categoryc13m0": {
                    "limitstart": 0
                },
                "categoryc23m0": {
                    "limitstart": 0
                },
                "categoryc15m0": {
                    "limitstart": 0
                }
            }
        },
        "user": {
            "id": 0,
            "name": null,
            "username": null,
            "email": null,
            "password": null,
            "password_clear": "",
            "block": null,
            "sendEmail": 0,
            "registerDate": null,
            "lastvisitDate": null,
            "activation": null,
            "params": null,
            "groups": [],
            "guest": 1,
            "lastResetTime": null,
            "resetCount": null,
            "requireReset": null,
            "aid": 0
        },
        "plg_system_languagefilter": {
            "language": "fr-FR"
        }
    },
    "__vm": {
        "manage": 0,
        "vmlastvisitedItemid": 123,
        "vmlastvisitedcategoryid": 0,
        "vmlastvisitedmanuid": 0,
        "vmcartlastVendorId": 1
    }
}

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4719
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
If you have a blank page, activate the debug log file in PHP. So you have the informations
But blank page should show the php debug trace if you have set it correctly

e-trader

  • Jr. Member
  • **
  • Posts: 73
Re: Product edit in admin - PHP v8.0 "Unsupported operand types: string + int"
« Reply #10 on: December 04, 2022, 15:00:19 PM »
VirtueMart 4.0.6 10690
php 8.0
joomla 3.10.11


Error: 0 Unsupported operand types: string + int

Call stack
#   Function   Location
1   ()   JROOT/administrator/components/com_virtuemart/helpers/mediahandler.php:1314
2   VmMediaHandler->displayFileHandler()   JROOT/administrator/components/com_virtuemart/helpers/mediahandler.php:1106
3   VmMediaHandler->displayFilesHandler()   JROOT/components/com_virtuemart/views/user/tmpl/edit_vendor.php:116
4   include()   JROOT/libraries/src/MVC/View/HtmlView.php:701
5   Joomla\CMS\MVC\View\HtmlView->loadTemplate()   JROOT/components/com_virtuemart/helpers/shopfunctionsf.php:1067
6   shopFunctionsF::buildTabs()   JROOT/components/com_virtuemart/views/user/tmpl/edit.php:73
7   include()   JROOT/libraries/src/MVC/View/HtmlView.php:701
8   Joomla\CMS\MVC\View\HtmlView->loadTemplate()   JROOT/components/com_virtuemart/helpers/vmview.php:69
9   VmView->display()   JROOT/components/com_virtuemart/views/user/view.html.php:245
10   VirtuemartViewUser->display()   JROOT/components/com_virtuemart/controllers/user.php:59
11   VirtueMartControllerUser->display()   JROOT/libraries/src/MVC/Controller/BaseController.php:702
12   Joomla\CMS\MVC\Controller\BaseController->execute()   JROOT/components/com_virtuemart/virtuemart.php:114
13   require_once()   JROOT/libraries/src/Component/ComponentHelper.php:402
14   Joomla\CMS\Component\ComponentHelper::executeComponent()   JROOT/libraries/src/Component/ComponentHelper.php:377
15   Joomla\CMS\Component\ComponentHelper::renderComponent()   JROOT/libraries/src/Application/SiteApplication.php:194
16   Joomla\CMS\Application\SiteApplication->dispatch()   JROOT/libraries/src/Application/SiteApplication.php:233
17   Joomla\CMS\Application\SiteApplication->doExecute()   JROOT/libraries/src/Application/CMSApplication.php:225
18   Joomla\CMS\Application\CMSApplication->execute()   JROOT/index.php:49

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10621
  • VM4.0.232 Eagle Owl
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 4 on joomla 3
Re: Product edit in admin - PHP v8.0 "Unsupported operand types: string + int"
« Reply #11 on: December 05, 2022, 19:27:33 PM »
imho fixed in vm4.0.8, but tomorrow comes 4.0.10
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

subn3t

  • Beginner
  • *
  • Posts: 7
  • Fan
  • VirtueMart Version: 4.0.6 10690
Re: Product edit in admin - PHP v8.0 "Unsupported operand types: string + int"
« Reply #12 on: January 26, 2023, 18:59:55 PM »
When viewing cart in front end we get "Unsupported operand types: string * float". Works with PHP 7.4. With PHP8 we get the error. Any ideas?

Joomla  3.10.11
Virtuemart 4.0.12 10777
PHP 8.1.14
MySQLi 5.7.35

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 28694
  • Always on vacation
    • Jenkin Hill Internet
Re: Product edit in admin - PHP v8.0 "Unsupported operand types: string + int"
« Reply #13 on: January 27, 2023, 10:56:55 AM »
Maybe coming from your template. Try Protostar?

Providing an error trace would show the source of the error. In Joomla Global Configuration set "Error Reporting" as "Maximum" and enable the “Debugging" option. In VirtueMart Configuration and set PHP Development mode for “all”.
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VirtueMart 4.0.22 10858  J 3.10.11 PHP 8.0.27

subn3t

  • Beginner
  • *
  • Posts: 7
  • Fan
  • VirtueMart Version: 4.0.6 10690
Re: Product edit in admin - PHP v8.0 "Unsupported operand types: string + int"
« Reply #14 on: January 28, 2023, 11:54:44 AM »
Thank you for the reply.

We tried with the Protostar - same error.

Switched the error reporting to Maximum and now both front end and back end are broken . The page only says:

-----------------QUOTE------------

Deprecated: Joomla\Input\Input implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in /home/username/public_html/libraries/vendor/joomla/input/src/Input.php on line 41

Deprecated: Return type of Joomla\Input\Input::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/username/public_html/libraries/vendor/joomla/input/src/Input.php on line 170

Deprecated: Joomla\CMS\Input\Input implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in /home/username/public_html/libraries/src/Input/Input.php on line 31

Warning: session_name(): Session name cannot be changed after headers have already been sent in /home/username/public_html/libraries/joomla/session/handler/native.php on line 128

Deprecated: Joomla\CMS\Input\Cookie implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in /home/username/public_html/libraries/src/Input/Cookie.php on line 0

Warning: session_cache_limiter(): Session cache limiter cannot be changed after headers have already been sent in /home/username/public_html/libraries/joomla/session/handler/native.php on line 235
Error: Failed to start application: Failed to start the session because headers have already been sent by "/home/username/public_html/libraries/vendor/joomla/input/src/Input.php" at line 41.

-----------END OF QUOTE ---------

Everything worked with PHP7.4.
Any help will be greatly appreciated.