News:

Looking for documentation? Take a look on our wiki

Main Menu

Update to PHP8 and Virtuemart

Started by Kuubs, November 09, 2022, 08:44:07 AM

Previous topic - Next topic

Kuubs

Hello,

I have a weird problem with updating to PHP8 and Virtuemart. I have installed all the latest updates for Virtuemart, it runs on 4.0.6. Joomla 3.10.11. Everything runs great on PHP7.4. But the moment I switch over to PHP8 I get random white screens. For example when I try to edit a product in the backend, it gives me a white screen. What is even more weird is that there are no errors in the error logs. Does anyone else run on PHP8 smoothly?

I did some more testing and it seems that I also cannot edit Category, I cannot edit Shop, Article, Media, like every edit task is not possible. I get an error 500 screen without any explanation. I tried setting error reporting to full, in Joomla and Virtuemart but that doesn't do anything.

Also there is a weird deprecated message that seems to be core to Virtuemart:

Deprecated: Required parameter $htmlIn follows optional parameter $selected in

Is this a known message?

jenkinhill

It might help if you mention which version of PHP8?
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Kuubs

#2
Quote from: jenkinhill on November 09, 2022, 11:09:25 AM
It might help if you mention which version of PHP8?

It's PHP version 8.0.25

I tried updating to the newest Virtuemart 4.0.7 but that doesn't fix the issue. I'm still getting error 500.

Ok when I use the new administrator template I don't get the error message. Thats weird. Also because the new administrator template misses some stuff (like calculating cost price)

StefanSTS

If you get a white screen on adding a new product, update your language files.
Which language are you using?

Stefan
--
Stefan Schumacher
www.jooglies.com - VirtueMart Invoice Layouts

Please use only stable versions with even numbers for your live shop! Use Alpha versions only if you know what risk you are taking.

Kuubs

#4
Quote from: StefanSTS on November 09, 2022, 13:44:03 PM
If you get a white screen on adding a new product, update your language files.
Which language are you using?

Stefan

Okay will do. I'm using the Dutch language

Unfortunately updating the language doesn't work, i still get error 500 screen.

StefanSTS

The Dutch language files seem to have the necessary changes (after having a quick look).
https://www.virtuemart.net/community/translations/virtuemart/nl-NL

Try to use the Joomla Language Debug and find out if the right files are used.
There are two/four places where language files can be stored.
Either in the component's language folder or the Joomla language folder.
And that needs to be checked for admin and site.

/administrator/components/com_virtuemart/language
/components/com_virtuemart/language

/administrator/language
/language

Maybe there are old files in a folder that gets used first.
Somewhere on docs.joomla.org they describe which folder is used first.

Stefan
--
Stefan Schumacher
www.jooglies.com - VirtueMart Invoice Layouts

Please use only stable versions with even numbers for your live shop! Use Alpha versions only if you know what risk you are taking.

Kuubs

Quote from: StefanSTS on November 09, 2022, 15:06:55 PM
The Dutch language files seem to have the necessary changes (after having a quick look).
https://www.virtuemart.net/community/translations/virtuemart/nl-NL

Try to use the Joomla Language Debug and find out if the right files are used.
There are two/four places where language files can be stored.
Either in the component's language folder or the Joomla language folder.
And that needs to be checked for admin and site.

/administrator/components/com_virtuemart/language
/components/com_virtuemart/language

/administrator/language
/language

Maybe there are old files in a folder that gets used first.
Somewhere on docs.joomla.org they describe which folder is used first.

Stefan

Hm I tried but having an error 500 without any other log or anything else is really hard to debug. I cannot find why it doesn't work. It doesn't give me anything to work with. It's just an error 500. I tried installing the language files, I tried language debug, it's just not working.

StefanSTS

Did you check if you updated all language files I mentioned?

STS
--
Stefan Schumacher
www.jooglies.com - VirtueMart Invoice Layouts

Please use only stable versions with even numbers for your live shop! Use Alpha versions only if you know what risk you are taking.

Kuubs

Quote from: StefanSTS on November 09, 2022, 15:46:32 PM
Did you check if you updated all language files I mentioned?

STS

Yes and I don't think it has anything to do with the language files. Because when I activate the new administrator template of Virtuemart everything does open. Thats weird no?

StefanSTS

Searching for %1s and %2s I still found some occurences in the nl-NL language files. Didn't search all of them before.

Maybe there are some interested parties that want to fix that. Since those will give a white screen too.

Stefan
--
Stefan Schumacher
www.jooglies.com - VirtueMart Invoice Layouts

Please use only stable versions with even numbers for your live shop! Use Alpha versions only if you know what risk you are taking.

jenkinhill

Quote from: Kuubs on November 09, 2022, 15:54:06 PM
when I activate the new administrator template of Virtuemart everything does open. Thats weird no?

AFAIK the old admin template has not been bugfixes to work in new versions. The new admin template will become the default template to be used in future versions.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Kuubs

Quote from: jenkinhill on November 10, 2022, 16:48:28 PM
Quote from: Kuubs on November 09, 2022, 15:54:06 PM
when I activate the new administrator template of Virtuemart everything does open. Thats weird no?

AFAIK the old admin template has not been bugfixes to work in new versions. The new admin template will become the default template to be used in future versions.

Aha ok. Weird that it hasn't been the standard template in the newest versions, but thanks for the answer!

Milbo

Quote from: StefanSTS on November 09, 2022, 15:06:55 PM
Maybe there are old files in a folder that gets used first.
Somewhere on docs.joomla.org they describe which folder is used first.

But VM priorises the relative directories
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Kuubs

Quote from: Milbo on November 10, 2022, 19:54:53 PM
Quote from: StefanSTS on November 09, 2022, 15:06:55 PM
Maybe there are old files in a folder that gets used first.
Somewhere on docs.joomla.org they describe which folder is used first.

But VM priorises the relative directories

I found the issue. It has nothing to do with language files. It's the mediahandler.php file:

public_html/administrator/components/com_virtuemart/helpers/mediahandler.php:1315

This line:

$html .= '<td rowspan = "8" min-width = "'.(VmConfig::get('img_width',90)+10).'px" overflow="hidden">';

Gives the following error:

Unsupported operand types: string + int

When the +10 is removed the administrator works again. Also the old template.

GJC Web Design

was already found by Stefan and IMHO is fixed in the latest RC version

https://dev.virtuemart.net/attachments/download/1340/com_virtuemart.4.0.7.10732_package_or_extract.zip

QuoteI tried updating to the newest Virtuemart 4.0.7 but that doesn't fix the issue.

meaningless ... pls use the full version numbers otherwise we waste our time chasing bugs that are already fixed
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