Invoice creation error (VM4) - orders with specific shipping method only

Started by Can.Y, November 13, 2023, 10:43:58 AM

Previous topic - Next topic

Can.Y

Does anyone happen to know why I cannot create a new invoice? I have checked everywhere I can but don't have a single clue. :'(
Joomla 4.3.4  VM 4.2.0 10905
(Fresh install J4 site)

Following is the error msg:

array_push(): Argument #1 ($array) must be of type array, null given


Call stack
# Function Location
1 () JROOT/libraries/vendor/tecnickcom/tcpdf/tcpdf.php:16933
2 array_push() JROOT/libraries/vendor/tecnickcom/tcpdf/tcpdf.php:16933
3 TCPDF->getHtmlDomArray() JROOT/libraries/vendor/tecnickcom/tcpdf/tcpdf.php:17214
4 TCPDF->writeHTML() JROOT/libraries/vendor/tecnickcom/tcpdf/tcpdf.php:5828
5 TCPDF->MultiCell() JROOT/libraries/vendor/tecnickcom/tcpdf/tcpdf.php:17109
6 TCPDF->writeHTMLCell() JROOT/components/com_virtuemart/helpers/vmpdf.php:202
7 VmVendorPDF->PrintContents() JROOT/components/com_virtuemart/helpers/vmpdf.php:65
8 VmPdf::createVmPdf() JROOT/components/com_virtuemart/controllers/invoice.php:289
9 VirtueMartControllerInvoice->getInvoicePDF() JROOT/components/com_virtuemart/controllers/invoice.php:79
10 VirtueMartControllerInvoice->display() JROOT/administrator/components/com_virtuemart/controllers/orders.php:49
11 VirtuemartControllerOrders->callInvoiceView() JROOT/libraries/src/MVC/Controller/BaseController.php:678
12 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT/administrator/components/com_virtuemart/virtuemart.php:77
13 require_once() JROOT/libraries/src/Dispatcher/LegacyComponentDispatcher.php:71
14 Joomla\CMS\Dispatcher\LegacyComponentDispatcher::Joomla\CMS\Dispatcher\{closure}() JROOT/libraries/src/Dispatcher/LegacyComponentDispatcher.php:73
15 Joomla\CMS\Dispatcher\LegacyComponentDispatcher->dispatch() JROOT/libraries/src/Component/ComponentHelper.php:361
16 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT/libraries/src/Application/AdministratorApplication.php:143
17 Joomla\CMS\Application\AdministratorApplication->dispatch() JROOT/libraries/src/Application/AdministratorApplication.php:186
18 Joomla\CMS\Application\AdministratorApplication->doExecute() JROOT/libraries/src/Application/CMSApplication.php:293
19 Joomla\CMS\Application\CMSApplication->execute() JROOT/administrator/includes/app.php:61
20 require_once() JROOT/administrator/index.php:32

Can.Y

I modified the tcpdf.php and invoice.php files followed the revisions record.
https://dev.virtuemart.net/projects/virtuemart/repository/virtuemart/revisions/10932
https://dev.virtuemart.net/projects/virtuemart/repository/virtuemart/revisions/10921

Now, the error msg turned to
count(): Argument #1 ($value) must be of type Countable|array, null given


# Function Location
1 () JROOT/libraries/vendor/tecnickcom/tcpdf/tcpdf.php:19547
2 TCPDF->closeHTMLTagHandler() JROOT/libraries/vendor/tecnickcom/tcpdf/tcpdf.php:18300
3 TCPDF->writeHTML() JROOT/libraries/vendor/tecnickcom/tcpdf/tcpdf.php:5828
4 TCPDF->MultiCell() JROOT/libraries/vendor/tecnickcom/tcpdf/tcpdf.php:17111
5 TCPDF->writeHTMLCell() JROOT/components/com_virtuemart/helpers/vmpdf.php:202
6 VmVendorPDF->PrintContents() JROOT/components/com_virtuemart/helpers/vmpdf.php:65
7 VmPdf::createVmPdf() JROOT/components/com_virtuemart/controllers/invoice.php:289
8 VirtueMartControllerInvoice->getInvoicePDF() JROOT/components/com_virtuemart/controllers/invoice.php:79
9 VirtueMartControllerInvoice->display() JROOT/administrator/components/com_virtuemart/controllers/orders.php:49
10 VirtuemartControllerOrders->callInvoiceView() JROOT/libraries/src/MVC/Controller/BaseController.php:678
11 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT/administrator/components/com_virtuemart/virtuemart.php:77
12 require_once() JROOT/libraries/src/Dispatcher/LegacyComponentDispatcher.php:71
13 Joomla\CMS\Dispatcher\LegacyComponentDispatcher::Joomla\CMS\Dispatcher\{closure}() JROOT/libraries/src/Dispatcher/LegacyComponentDispatcher.php:73
14 Joomla\CMS\Dispatcher\LegacyComponentDispatcher->dispatch() JROOT/libraries/src/Component/ComponentHelper.php:361
15 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT/libraries/src/Application/AdministratorApplication.php:143
16 Joomla\CMS\Application\AdministratorApplication->dispatch() JROOT/libraries/src/Application/AdministratorApplication.php:186
17 Joomla\CMS\Application\AdministratorApplication->doExecute() JROOT/libraries/src/Application/CMSApplication.php:293
18 Joomla\CMS\Application\CMSApplication->execute() JROOT/administrator/includes/app.php:61
19 require_once() JROOT/administrator/index.php:32

Can.Y

#2
I found that if I stop using the shipping method "Advanced Shipping by Rules for VirtueMart", the invoice creation issue will just gone!

But I really really need to use this shipping method.
Does anyone know how to solve this? :'(

Can.Y

Finally! I find it!
I removed the table element from "Shipment Description" and the invoice can be created perfectly.
(There are no such problems while in Joomla3 VM3)

Hope this helps.  :)