VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: stawebnice on January 27, 2022, 16:34:03 PM

Title: VM 3.8.8.10472: Missing format specifier at end of string - product card in BE
Post by: stawebnice on January 27, 2022, 16:34:03 PM
Hi,

I just tested VM 3.8.8.10472 on Joomla 3.10.5 and PHP 8 and even though front-end does not show any errors, when I try to open product card in administration, I get this error:
Missing format specifier at end of string

Is it a bug or is this version not compatible with PHP 8?

Thanks!

Petra
Title: Re: VM 3.8.8.10472: Missing format specifier at end of string - product card in BE
Post by: Jörgen on January 27, 2022, 16:54:01 PM
Try to change to English, prob Still there ?

Jörgen
Title: Re: VM 3.8.8.10472: Missing format specifier at end of string - product card in BE
Post by: Jumbo! on January 27, 2022, 17:07:17 PM
It is a PHP 8 related issue. You have to wait until VirtueMart becomes fully compatible with PHP 8.

Downgrade to PHP 7, which should resolve the issue.
Title: Re: VM 3.8.8.10472: Missing format specifier at end of string - product card in BE
Post by: pinochico on January 27, 2022, 18:20:51 PM
Quote from: Jumbo! on January 27, 2022, 17:07:17 PM
It is a PHP 8 related issue. You have to wait until VirtueMart becomes fully compatible with PHP 8.

Downgrade to PHP 7, which should resolve the issue.

Yes, the problem is reported on the any forum:
https://forum.virtuemart.de/thread/3990-fehlermeldung-wenn-man-ein-produkt-aufrufen-ändern-möchte/
https://forum.joomla.de/thread/13216-probleme-mit-virtuemart/
https://forum.joomla.org/viewtopic.php?t=985113

but not fixed in last version (com_virtuemart.3.8.9.10583_package_or_extract.zip) too.

We are waiting ;D not downgrade
Title: Re: VM 3.8.8.10472: Missing format specifier at end of string - product card in BE
Post by: stawebnice on January 31, 2022, 22:01:03 PM
@jorgen switching to English on Czech site is not a solution.
Yes, downgrading to 7.4 solves the issue.  But still looking forward to the full compatibility with PHP 8. Because it looks like all my other extensions are compatible... so I can't wait ;)
Title: Re: VM 3.8.8.10472: Missing format specifier at end of string - product card in BE
Post by: Jörgen on January 31, 2022, 22:08:46 PM
@stawebnice

I did not mean to switch to english permanently, problems with translations have been known to create issues. And switching to english in back end is a very fast test to rule out language issues. This time it seems to be a an PHP 8 issue.

Quote from the Joomla forum:
QuoteAnyhow it is most likely a mistake in the "other" software and not in VM. VM works just fine...Are you using PHP 8 if so set back to PHP 7.4 in your hosting control panel. PHP8 is not yet Stable

Jörgen @ Kreatuv Fotografi
Title: Re: VM 3.8.8.10472: Missing format specifier at end of string - product card in BE
Post by: stawebnice on January 31, 2022, 22:21:51 PM
Yes, from front-end it looks fine, so if we wouldn't need to update a product, we would hardly notice it...
Title: Re: VM 3.8.8.10472: Missing format specifier at end of string - product card in BE
Post by: Milbo on April 16, 2022, 22:46:02 PM
The reason is the missing $ in the placeholders.
%s, %1s, %d, and so on must become %1$s, respectivly %1$d. and of course the given number must preserved. Just the "old" rule, php8 is more restrictiv than php7
Title: Re: VM 3.8.8.10472: Missing format specifier at end of string - product card in BE
Post by: dandyse on September 20, 2022, 13:22:13 PM
Ehm ... no ... it must be $%1s NOT %1$s.
Title: Re: VM 3.8.8.10472: Missing format specifier at end of string - product card in BE
Post by: StefanSTS on January 27, 2023, 20:01:48 PM
Quote from: dandyse on September 20, 2022, 13:22:13 PM
Ehm ... no ... it must be $%1s NOT %1$s.

Really? The PHP docs say it the same way Milbo says.
You might want to quote a reliable source.

Stefan
Title: Re: VM 3.8.8.10472: Missing format specifier at end of string - product card in BE
Post by: Milbo on January 27, 2023, 21:04:44 PM
It is really freaky topic, this guys say the % must go completly?

https://wordpress.org/support/topic/uncaught-valueerror-missing-format-specifier-at-end-of-string/

At least they suffer the same problem. But I really wonder how joomla does it, why they do not have that hassle. So we have not solved all mysteries here
Title: Re: VM 3.8.8.10472: Missing format specifier at end of string - product card in BE
Post by: pico71 on February 19, 2023, 12:17:13 PM
I Have the same error In MY JOOMLA\Virtuemart installation
JOOMLA 3.10.11
VM: 4.0.12

Editing a product from backend give me this error:
"Missing format specifier at end of string"

Looking into the VM folder language (Administrator and Component) - I have only the gb-EN LANGuages (even if my JOOMLA site is ITALIAN\ENGLISH).
Whick file have I check\correct to solve this issue ?
P.
Title: Re: VM 3.8.8.10472: Missing format specifier at end of string - product card in BE
Post by: niosme on February 23, 2023, 14:37:54 PM
I fixed that by commenting the lines 142 till 146 in /administrator/components/com_virtuemart/helpers/vmtext.php.
Or take the attached file unzip it and replace it to the path above get that fixed.

Dont know if this the right solution but fixed the problem and everything works like a charm!
Title: Re: VM 3.8.8.10472: Missing format specifier at end of string - product card in BE
Post by: razor7 on July 26, 2023, 22:30:27 PM
Thanks a lot! Updating VM lang packs solved the issue
Title: Re: VM 3.8.8.10472: Missing format specifier at end of string - product card in BE
Post by: Milbo on August 11, 2023, 22:47:03 PM
Thank you Niosme, gave me a grib to find a solution for it.
Title: Re: VM 3.8.8.10472: Missing format specifier at end of string - product card in BE
Post by: kilombo on December 23, 2023, 17:56:54 PM
Jesus....

How come this has not been solved yet... after i opened this thread https://forum.virtuemart.net/index.php?topic=150874.0
VirtueMart 4.2.0 10905 still has the same issue on PHP 8, the most simple solution is to change the back office language to english... Awkward how this issue has not been solved yet after so long...