VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: jelly on November 22, 2023, 15:33:22 PM

Title: task=orderdone problems: 5 arguments are required, 4 given
Post by: jelly on November 22, 2023, 15:33:22 PM
Joomla! 4.4.0.
Virtuemart 4.2.0.


Last week everything worked ok, paymentprovider plugin worked neatly, etc. I did not launch my new webshop yet because of some language overrides I wanted to make / because of finetuning / testing some more.

Today... after finetuning, testing shows problems at placing an order!

I no longer receive order-emails and all orders say THANK YOU FOR YOUR ORDER, plus... warnings and errors.


Can this be because of language overrides I made? (Like taking out the brackets in the subject line of the order email: [])


The problem occurs at URL ending at:   cart?task=orderdone

Quote
The requested page cannot be found.

An error occurred while processing the request.

This page may not be accessible because:

an outdated bookmark/favorite
an incorrectly typed address
a search engine has an outdated list of this website
there is no access to this page

Quote
5 arguments are required, 4 given


I activated DEBUG which shows:


Call stack
# Function Location
1 () JROOT/administrator/components/com_virtuemart/helpers/vmtext.php:149
2 sprintf()               JROOT/administrator/components/com_virtuemart/helpers/vmtext.php:149
3 vmText::sprintf() JROOT/components/com_virtuemart/views/invoice/view.html.php:304
4 VirtuemartViewInvoice->display()               JROOT/components/com_virtuemart/views/invoice/view.html.php:346
5 VirtuemartViewInvoice->renderMailLayout() JROOT/components/com_virtuemart/helpers/shopfunctionsf.php:877
6 shopFunctionsF::sendVmMail() JROOT/administrator/components/com_virtuemart/models/orders.php:2485
7 VirtueMartModelOrders->notifyCustomer()               JROOT/administrator/components/com_virtuemart/models/orders.php:1566
8 VirtueMartModelOrders->updateStatusForOneOrder() JROOT/plugins/vmpayment/standard/standard.php:162
9 plgVmPaymentStandard->plgVmConfirmedOrder() JROOT/libraries/src/Plugin/CMSPlugin.php:289
10 Joomla\CMS\Plugin\CMSPlugin->Joomla\CMS\Plugin\{closure}() JROOT/libraries/vendor/joomla/event/src/Dispatcher.php:486
11 Joomla\Event\Dispatcher->dispatch()                           JROOT/libraries/src/Application/EventAware.php:111
12 Joomla\CMS\Application\WebApplication->triggerEvent() JROOT/administrator/components/com_virtuemart/helpers/vdispatcher.php:41
13 vDispatcher::trigger()                                   JROOT/components/com_virtuemart/helpers/cart.php:1896
14 VirtueMartCart->confirmedOrder()                JROOT/components/com_virtuemart/helpers/cart.php:1575
15 VirtueMartCart->confirmDone()                     JROOT/components/com_virtuemart/controllers/cart.php:95
16 VirtueMartControllerCart->display()                 JROOT/components/com_virtuemart/controllers/cart.php:205
17 VirtueMartControllerCart->updatecart()                JROOT/libraries/src/MVC/Controller/BaseController.php:693
18 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT/components/com_virtuemart/virtuemart.php:129
19 require_once() JROOT/libraries/src/Dispatcher/LegacyComponentDispatcher.php:71
20 Joomla\CMS\Dispatcher\LegacyComponentDispatcher::Joomla\CMS\Dispatcher\{closure}() JROOT/libraries/src/Dispatcher/LegacyComponentDispatcher.php:73
21 Joomla\CMS\Dispatcher\LegacyComponentDispatcher->dispatch() JROOT/libraries/src/Component/ComponentHelper.php:361
22 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT/libraries/src/Application/SiteApplication.php:208
23 Joomla\CMS\Application\SiteApplication->dispatch() JROOT/libraries/src/Application/SiteApplication.php:249
24 Joomla\CMS\Application\SiteApplication->doExecute() JROOT/libraries/src/Application/CMSApplication.php:293
25 Joomla\CMS\Application\CMSApplication->execute() JROOT/includes/app.php:61
26 require_once() JROOT/index.php:32


I am really with my hands in my hair: what is suddenly wrong? What can I do???

I hope someone can help me out.
Title: Re: task=orderdone problems: 5 arguments are required, 4 given
Post by: Roderic on November 22, 2023, 17:17:33 PM
I had the same error message with one of my sites, the problem turned out to be an older plug-in for sequential order numbers that wasn't PHP 8.x compatible.

After I deactivated this plug-in, the problem was solved. Perhaps you have the same or a similar outdated plug-in that comes into play when placing the order. Try disabling all 3rd party plug-ins and try again.
Title: Re: task=orderdone problems: 5 arguments are required, 4 given
Post by: GJC Web Design on November 22, 2023, 18:48:05 PM
certainly looks like your lang over rides are causing a problem.. the text substitutions must be the same as the original

1   ()   JROOT/administrator/components/com_virtuemart/helpers/vmtext.php:149
2   sprintf()                 JROOT/administrator/components/com_virtuemart/helpers/vmtext.php:149
3   vmText::sprintf()   JROOT/components/com_virtuemart/views/invoice/view.html.php:304
Title: Re: task=orderdone problems: 5 arguments are required, 4 given
Post by: jelly on November 23, 2023, 15:40:47 PM
@Roderic, thanks for your reply. I have turned off my payment provider plugin (that is the only 3rd party plugin I use), but the problem was still present.

@GJC, thanks for your reaction. I think the language overrides are a problem too. Strange since I never had that problem before.

I checked administrator/components/com_virtuemart/helpers/vmtext.php:149

This line says:
return call_user_func_array('sprintf', $args);

But it gives me no clue which language override string is the problem, does it tell you something?

I took a look at /components/com_virtuemart/views/invoice/view.html.php:304

Here it says:
$this->subject = vmText::sprintf('COM_VIRTUEMART_MAIL_SUBJ_VENDOR_'.$orderDetails['details']['BT']->order_status, $this->shopperName, strip_tags($this->currencyV->

At both I see sprintf mentioned... but that is as far as I can tell something about it  ::) :D

Title: Re: task=orderdone problems: 5 arguments are required, 4 given
Post by: jelly on November 23, 2023, 16:46:36 PM
Hmmm, I deleted ALL my language overrides (since it was too timeconsuming to find out which one I added lastly) and... all works again.

I thought the language overrides were harmless? That seems not the case.

Still I do not know which one was / were the one(s) that caused the problem.

Next week I will add them again, one by one, and will mention the error inducing ones here, I hope that will help developers in some way?