plugin vmshipment error with PHP 8 with set weight_countries

Started by macigatto, July 31, 2022, 09:24:16 AM

Previous topic - Next topic

macigatto

hello,please help me

joomla 3.10.10
vm 3.8.8

when i have move from PHP 7 to PHP 8 i got this error.
I have some countries with shipment cost set with weight.
In these it is not possible to complete order for this error:

implode(): Argument #2 ($array) must be of type ?array, string given
Call stack
#   Function   Location
1   ()   JROOT/administrator/components/com_virtuemart/plugins/vmpsplugin.php:1072
2   implode()   JROOT/administrator/components/com_virtuemart/plugins/vmpsplugin.php:1072
3   vmPSPlugin->checkConditions()   JROOT/plugins/vmshipment/weight_countries/weight_countries.php:246
4   plgVmShipmentWeight_countries->checkConditions()   JROOT/administrator/components/com_virtuemart/plugins/vmpsplugin.php:934
5   vmPSPlugin->getSelectables()   JROOT/administrator/components/com_virtuemart/plugins/vmpsplugin.php:225
6   vmPSPlugin->onCheckAutomaticSelected()   JROOT/administrator/components/com_virtuemart/plugins/vmpsplugin.php:207
7   vmPSPlugin->plgVmOnCheckAutomaticSelected()   JROOT/libraries/joomla/event/event.php:70
8   JEvent->update()   JROOT/libraries/joomla/event/dispatcher.php:160
9   JEventDispatcher->trigger()   JROOT/components/com_virtuemart/helpers/cart.php:2048
10   VirtueMartCart->checkAutomaticSelectedPlug()   JROOT/administrator/components/com_virtuemart/helpers/calculationh.php:1628
11   calculationHelper->calculateMethodPrice()   JROOT/administrator/components/com_virtuemart/helpers/calculationh.php:1670
12   calculationHelper->calculateShipmentPrice()   JROOT/administrator/components/com_virtuemart/helpers/calculationh.php:967
13   calculationHelper->getCheckoutPrices()   JROOT/components/com_virtuemart/helpers/cart.php:2162
14   VirtueMartCart->getCartPrices()   JROOT/components/com_virtuemart/helpers/cart.php:2261
15   VirtueMartCart->prepareCartData()   JROOT/components/com_virtuemart/controllers/cart.php:86
16   VirtueMartControllerCart->display()   JROOT/libraries/src/MVC/Controller/BaseController.php:702
17   Joomla\CMS\MVC\Controller\BaseController->execute()   JROOT/components/com_virtuemart/virtuemart.php:115
18   require_once()   JROOT/libraries/src/Component/ComponentHelper.php:402
19   Joomla\CMS\Component\ComponentHelper::executeComponent()   JROOT/libraries/src/Component/ComponentHelper.php:377
20   Joomla\CMS\Component\ComponentHelper::renderComponent()   JROOT/libraries/src/Application/SiteApplication.php:194
21   Joomla\CMS\Application\SiteApplication->dispatch()   JROOT/libraries/src/Application/SiteApplication.php:233
22   Joomla\CMS\Application\SiteApplication->doExecute()   JROOT/libraries/src/Application/CMSApplication.php:225
23   Joomla\CMS\Application\CMSApplication->execute()   JROOT/index.php:49

thanks to help


pinochico

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

GJC Web Design

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 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

macigatto

do you mean that VM 3.8.8 do not support PHP 8?

thank you

GJC Web Design

Quotedo you mean that VM 3.8.8 do not support PHP 8?

Most probably .. from memory debugging for php8 started with the VM4 series
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 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

macigatto

hello,
I have tried with VM 4.0.6
but still this error with PHP 8.
I think it is a bug to resolve.
0 - implode(): Argument #2 ($array) must be of type ?array, string given
thank you

macigatto

I have resolved putting a try catch to manage the error:

JROOT/plugins/vmshipment/weight_countries/weight_countries.php:245

try{
      $result[$hash] = parent::checkConditions($cart, $method, $cart_prices);
         }
         catch (Throwable $e) {
                     
                    }


e-trader

Will this be updated in a new VM release?
4.0.6 10690 AIO still has the PHP8 bug.
Have to stay on PHP7 in the meanwhile....