VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: ViPeS on August 12, 2023, 10:48:40 AM

Title: Errors after upgrading to VM 4.2.0.10905
Post by: ViPeS on August 12, 2023, 10:48:40 AM
Product page has errors after upgrading to VM 4.2.0.10905

Deprecated: Required parameter $htmlIn follows optional parameter $selected in /home/viinis/domains/virtuvinis.lt/public_html/plugins/vmshipment/rules_shipping_advanced/rules_shipping_base.php on line 491

Deprecated: Required parameter $shipCounter follows optional parameter $cart_prices in /home/viinis/domains/virtuvinis.lt/public_html/plugins/vmshipment/rules_shipping_advanced/rules_shipping_base.php on line 515

PS:
Errors were given by a third-party plugin VM Shipment - Advanced Shipping by Rules for VirtueMart, which was not used, but was published.
Removing the plugin solved the problem.
Title: Re: Errors after upgrading to VM 4.2.0.10905
Post by: Milbo on August 13, 2023, 19:57:03 PM
Thank you, the plugin is now part of the core, fixed.
Title: Re: Errors after upgrading to VM 4.2.0.10905
Post by: man.of.earth on August 15, 2023, 00:53:46 AM
Advanced Order Numbers ( https://www.open-tools.net/virtuemart/advanced-ordernumbers.html (https://www.open-tools.net/virtuemart/advanced-ordernumbers.html) ) would be also a great addition to VM.
Title: Re: Errors after upgrading to VM 4.2.0.10905
Post by: GJC Web Design on August 15, 2023, 14:11:39 PM
agree - almost always asked by clients why the order/invoice numbers are random and asked for sequential...
Title: Re: Errors after upgrading to VM 4.2.0.10905
Post by: Milbo on August 17, 2023, 15:31:27 PM
Please use https://extensions.virtuemart.net/shopper-order/orders/automated-numbers-detail

As far as I know it works almost with the same princip as the old ordernumber, but you can also modify a lot others
Username
Name
Password
Shoppernumber
Invoicenumber
Ordernumber
Title: Re: Errors after upgrading to VM 4.2.0.10905
Post by: Milbo on August 17, 2023, 16:12:42 PM
Quote from: GJC Web Design on August 15, 2023, 14:11:39 PM
agree - almost always asked by clients why the order/invoice numbers are random and asked for sequential...
They are not random. They have for security reasons 2 random chars, as far as I know. and both have a sequential number on default core
Title: Re: Errors after upgrading to VM 4.2.0.10905
Post by: MAD King on August 20, 2023, 22:45:16 PM
Quote from: Milbo on August 13, 2023, 19:57:03 PM
Thank you, the plugin is now part of the core, fixed.

What do you mean by that? "the plugin is now part of the core"

I have the same issues. While I could fix line 491, I cannot figure out line 515.
Title: Re: Errors after upgrading to VM 4.2.0.10905
Post by: Milbo on August 21, 2023, 20:28:34 PM
Both problems are fixed in the core version.

it is now part of the core. A member payed for it. I think a silvermembership. Or gold, it was not that expensive to update the plugin to work with j4, Php8.2 and vm4.0.22.

I wonder about the messages, because both is fixed, by


public function plgVmDisplayListFEShipment (VirtueMartCart $cart, $selected, &$htmlIn) {


and

function plgVmOnCheckAutomaticSelectedShipment (VirtueMartCart $cart, array $cart_prices, &$shipCounter) {


Quote from: ViPeS on August 12, 2023, 10:48:40 AM
PS:
Errors were given by a third-party plugin VM Shipment - Advanced Shipping by Rules for VirtueMart, which was not used, but was published.
Removing the plugin solved the problem.
]

Hmm, should be installed unpublished, like the payments. Going to check this.[/code]
Title: Re: Errors after upgrading to VM 4.2.0.10905
Post by: MAD King on August 21, 2023, 20:33:23 PM
I am still getting this error:

Deprecated: Required parameter $shipCounter follows optional parameter $cart_prices in plugins\vmshipment\rules_shipping_advanced\rules_shipping_base.php on line 515
Title: Re: Errors after upgrading to VM 4.2.0.10905
Post by: Milbo on August 21, 2023, 20:40:19 PM

array $cart_prices

That just says it must be an array. Maybe you must remove the array for your php versoin (which one btw).
Title: Re: Errors after upgrading to VM 4.2.0.10905
Post by: MAD King on August 21, 2023, 20:49:14 PM
PHP 8.0.28
Title: Re: Errors after upgrading to VM 4.2.0.10905
Post by: Milbo on August 21, 2023, 20:50:32 PM
Hmm, Does it work for you, if you remove the "array" from the seconed parameter?
Title: Re: Errors after upgrading to VM 4.2.0.10905
Post by: MAD King on August 21, 2023, 21:00:49 PM
Quote from: Milbo on August 21, 2023, 20:50:32 PM
Hmm, Does it work for you, if you remove the "array" from the seconed parameter?

I am not a programmer.
How do I remove that and with what do I have to replace it?
Title: Re: Errors after upgrading to VM 4.2.0.10905
Post by: Milbo on August 21, 2023, 21:06:38 PM
Quote from: Milbo on August 21, 2023, 20:28:34 PM


function plgVmOnCheckAutomaticSelectedShipment (VirtueMartCart $cart, array $cart_prices, &$shipCounter) {


So just


function plgVmOnCheckAutomaticSelectedShipment (VirtueMartCart $cart, $cart_prices, &$shipCounter) {
Title: Re: Errors after upgrading to VM 4.2.0.10905
Post by: MAD King on August 21, 2023, 21:28:56 PM
The code I have currently in under line 515 is this

function plgVmOnCheckAutomaticSelectedShipment (VirtueMartCart $cart, array $cart_prices = array(), &$shipCounter) {

There are two arrays in it.
Title: Re: Errors after upgrading to VM 4.2.0.10905
Post by: ViPeS on August 21, 2023, 22:25:02 PM
Quote from: Milbo on August 21, 2023, 20:50:32 PM
Hmm, Does it work for you, if you remove the "array" from the seconed parameter?
The error
Deprecated: Required parameter $shipCounter follows optional parameter $cart_prices in /home/viinis/domains/virtuvinis.lt/public_html/plugins/vmshipment/rules_shipping_advanced/rules_shipping_base.php on line 515
is gone.

But error
Deprecated: Required parameter $htmlIn follows optional parameter $selected in /home/viinis/domains/virtuvinis.lt/public_html/plugins/vmshipment/rules_shipping_advanced/rules_shipping_base.php on line 491
remained


         * @author Valerie Isaksen
* @author Max Milbers
*/
public function plgVmDisplayListFEShipment (VirtueMartCart $cart, $selected = 0, &$htmlIn) {
return $this->displayListFE ($cart, $selected, $htmlIn);
}


Replaced $selected = 0, with $selected, — and the error disappeared
Title: Re: Errors after upgrading to VM 4.2.0.10905
Post by: MAD King on August 21, 2023, 23:54:08 PM
Quote from: ViPeS on August 21, 2023, 22:25:02 PM
Quote from: Milbo on August 21, 2023, 20:50:32 PM
Hmm, Does it work for you, if you remove the "array" from the seconed parameter?
The error
Deprecated: Required parameter $shipCounter follows optional parameter $cart_prices in /home/viinis/domains/virtuvinis.lt/public_html/plugins/vmshipment/rules_shipping_advanced/rules_shipping_base.php on line 515
is gone.

But error
Deprecated: Required parameter $htmlIn follows optional parameter $selected in /home/viinis/domains/virtuvinis.lt/public_html/plugins/vmshipment/rules_shipping_advanced/rules_shipping_base.php on line 491
remained


         * @author Valerie Isaksen
* @author Max Milbers
*/
public function plgVmDisplayListFEShipment (VirtueMartCart $cart, $selected = 0, &$htmlIn) {
return $this->displayListFE ($cart, $selected, $htmlIn);
}


Replaced $selected = 0, with $selected, — and the error disappeared


The line in my file looks totally different.
Title: Re: Errors after upgrading to VM 4.2.0.10905
Post by: Milbo on August 23, 2023, 00:17:20 AM
Looks like the server did not update your files, for whatever reason.
ViPes also your line is fixed in the core code, hmmm.
Title: Re: Errors after upgrading to VM 4.2.0.10905
Post by: MAD King on August 23, 2023, 00:36:23 AM
He is talking about line 491.
I am line 515 with the issue.
I don't have issue with line 491.

Deprecated: Required parameter $shipCounter follows optional parameter $cart_prices in G:\XAMPP\htdocs\cnp\plugins\vmshipment\rules_shipping_advanced\rules_shipping_base.php on line 515