VirtueMart Forum

VirtueMart 2 + 3 + 4 => Installation, Migration & Upgrade => Topic started by: Kuubs on November 09, 2022, 08:44:07 AM

Title: Update to PHP8 and Virtuemart
Post by: Kuubs on November 09, 2022, 08:44:07 AM
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?
Title: Re: Update to PHP8 and Virtuemart
Post by: jenkinhill on November 09, 2022, 11:09:25 AM
It might help if you mention which version of PHP8?
Title: Re: Update to PHP8 and Virtuemart
Post by: Kuubs on November 09, 2022, 13:00:16 PM
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)
Title: Re: Update to PHP8 and Virtuemart
Post by: 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
Title: Re: Update to PHP8 and Virtuemart
Post by: Kuubs on November 09, 2022, 14:18:29 PM
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.
Title: Re: Update to PHP8 and Virtuemart
Post by: 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
Title: Re: Update to PHP8 and Virtuemart
Post by: Kuubs on November 09, 2022, 15:18:33 PM
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.
Title: Re: Update to PHP8 and Virtuemart
Post by: StefanSTS on November 09, 2022, 15:46:32 PM
Did you check if you updated all language files I mentioned?

STS
Title: Re: Update to PHP8 and Virtuemart
Post by: Kuubs on November 09, 2022, 15:54:06 PM
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?
Title: Re: Update to PHP8 and Virtuemart
Post by: StefanSTS on November 10, 2022, 15:53:45 PM
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
Title: Re: Update to PHP8 and Virtuemart
Post by: 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.
Title: Re: Update to PHP8 and Virtuemart
Post by: Kuubs on November 10, 2022, 17:15:39 PM
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!
Title: Re: Update to PHP8 and Virtuemart
Post by: 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
Title: Re: Update to PHP8 and Virtuemart
Post by: Kuubs on November 11, 2022, 16:12:41 PM
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.
Title: Re: Update to PHP8 and Virtuemart
Post by: GJC Web Design on November 12, 2022, 11:12:44 AM
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
Title: Re: Update to PHP8 and Virtuemart
Post by: Kuubs on November 12, 2022, 23:52:41 PM
Quote from: GJC Web Design on November 12, 2022, 11:12:44 AM
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

It's 10732 im running