Author Topic: plugin vmshipment error with PHP 8 with set weight_countries  (Read 212 times)

macigatto

  • Beginner
  • *
  • Posts: 11
  • A beginner
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

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 1522
    • MiniJoomla
  • Skype Name: support-easysoftware
  • VirtueMart Version: 3
Re: plugin vmshipment error with PHP 8 with set weight_countries
« Reply #1 on: July 31, 2022, 20:17:12 pm »
back to PHP7
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

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 10510
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.6.8
Re: plugin vmshipment error with PHP 8 with set weight_countries
« Reply #2 on: July 31, 2022, 22:04:28 pm »
btw fixed in the VM 4 series
GJC Web Design
VirtueMart and Joomla Developers - php developers http://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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

macigatto

  • Beginner
  • *
  • Posts: 11
  • A beginner
Re: plugin vmshipment error with PHP 8 with set weight_countries
« Reply #3 on: August 01, 2022, 09:27:49 am »
do you mean that VM 3.8.8 do not support PHP 8?

thank you

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 10510
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.6.8
Re: plugin vmshipment error with PHP 8 with set weight_countries
« Reply #4 on: August 01, 2022, 11:47:26 am »
Quote
do 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 http://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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

macigatto

  • Beginner
  • *
  • Posts: 11
  • A beginner
Re: plugin vmshipment error with PHP 8 with set weight_countries
« Reply #5 on: August 03, 2022, 11:28:25 am »
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

  • Beginner
  • *
  • Posts: 11
  • A beginner
Re: plugin vmshipment error with PHP 8 with set weight_countries
« Reply #6 on: August 03, 2022, 12:04:16 pm »
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) {
                     
                    }