News:

Support the VirtueMart project and become a member

Main Menu

Weird error after upgrading to 2.0.20b

Started by JulesM2, July 31, 2013, 16:02:04 PM

Previous topic - Next topic

JulesM2

Hi,

I did a manual upgrade by using the Extensions Manager in Joomla 2.5.13 because the Virtuemart updater didn't work. So here's the error I'm getting:

Warning: preg_replace() [function.preg-replace]: Unknown modifier ']' in /home/mysite/public_html/administrator/components/com_virtuemart/helpers/config.php on line 959

I installed the same version again, thinking that something might have gone wrong but I'm getting the same error on the second install. Not sure where to go from here.

Any help appreciated

Bufon53

Disculpa que responda en español, pero pude dar solución a ese error de la siguiente forma (me registre exclusivamente para dejar plasmada mi solución acá y ver si podía ayudarte)

Warning: preg_replace() [function.preg-replace]: Unknown modifier ']' in /home/mysite/public_html/administrator/components/com_virtuemart/helpers/config.php on line 959

Buscamos el archivo  config.php en la ruta /administrator/components/com_virtuemart/helpers/config.php

En la lina 959 encontraremos el siguiente codigo   return preg_replace('/[^\w'.preg_quote($custom).']/', '', $source);

y reemplazamos por return preg_replace('[^\w'.preg_quote($custom).']', '', $source);


Espero que esta solución pudiera ayudarlos al igual que me funciono a mi

Saludos y bendiciones

Milbo

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

Joe Bourque

I just installed a new site with Virtuemart 2.0.22a had the exact same error message.  I then upgraded to 22b and the error still appears.

HP Built On    Linux aboveweb.hostboxer.com 2.6.32-358.2.1.el6.x86_64 #1 SMP Wed Mar 13 00:26:49 UTC 2013 x86_64
Database Version    5.1.70-cll
Database Collation    utf8_general_ci
PHP Version    5.3.24
Web Server    Apache
WebServer to PHP Interface    cgi-fcgi
Joomla! Version    Joomla! 2.5.14 Stable [ Ember ] 01-August-2013 14:00 GMT

mizu

PHP 5.4.18
Joomla! 2.5.14
VM 2.0.22b

I had the same error.
The solution from Bufon53 fixed it for me.
Thanks, @Bufon53

Maxim Pishnyak

Better try
return preg_replace('/([^\w'.preg_quote($custom).'])/', '', $source);
or
return preg_replace('@[^\w'.preg_quote($custom).']@', '', $source);
contributed by Robert from Russian VM community.
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart

Milbo

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

Milbo

Looks like it is not done yet.

I found this

//return preg_replace('/[^\w'.preg_quote($custom).']/', '', $source); //creates error Warning: preg_replace(): Unknown modifier ']'
//return preg_replace('/([^\w'.preg_quote($custom).'])/', '', $source); //Warning: preg_replace(): Unknown modifier ']'
return preg_replace("[^\w".preg_quote($custom)."]", '', $source); //This seems to work even there is no seperator, the change is just the use of " instead '


But the php manual says here http://www.php.net/manual/en/regexp.reference.delimiters.php, that delimiters should be used. But I dont get it running with a delimiter. Hmmm
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Milbo

Hmm, I found this

return preg_replace("~[^\w".preg_quote($custom,'~')."]~", '', $source);
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

toad78

Thank you, Milbo. I will give this a try.

I guess VM 2 is not bug free?


Maxim Pishnyak

Quote from: toad78 on September 09, 2013, 02:22:19 AM
I guess VM 2 is not bug free?
Answer is in my signature and around my avatar.
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart

toad78


Maxim Pishnyak

You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart

AnSit

Greetings to the participants and the developer!

It looks like it has a continuation?!

Warning: preg_replace() [function.preg-replace]: Unknown modifier ']' in /home/troyandy/public_html/administrator/components/com_virtuemart/helpers/config.php on line 991

VM: 2.0.22c
PHP: 5.2.17

In the version of the problem?

jenkinhill

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