VirtueMart Forum

VirtueMart 2 + 3 + 4 => Installation, Migration & Upgrade => Topic started by: JulesM2 on July 31, 2013, 16:02:04 PM

Title: Weird error after upgrading to 2.0.20b
Post by: JulesM2 on July 31, 2013, 16:02:04 PM
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
Title: Re: Weird error after upgrading to 2.0.20b
Post by: Bufon53 on August 08, 2013, 21:18:50 PM
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
Title: Re: Weird error after upgrading to 2.0.20b
Post by: Milbo on August 09, 2013, 13:19:43 PM
Which php version do you use?
Title: Re: Weird error after upgrading to 2.0.20b
Post by: Joe Bourque on August 25, 2013, 19:12:41 PM
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
Title: Re: Weird error after upgrading to 2.0.20b
Post by: mizu on August 26, 2013, 08:22:23 AM
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
Title: Re: Weird error after upgrading to 2.0.20b
Post by: Maxim Pishnyak on September 01, 2013, 11:02:35 AM
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.
Title: Re: Weird error after upgrading to 2.0.20b
Post by: Milbo on September 01, 2013, 12:57:21 PM
I chose the first solution, thx.
Title: Re: Weird error after upgrading to 2.0.20b
Post by: Milbo on September 08, 2013, 13:35:28 PM
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
Title: Re: Weird error after upgrading to 2.0.20b
Post by: Milbo on September 08, 2013, 13:53:37 PM
Hmm, I found this

return preg_replace("~[^\w".preg_quote($custom,'~')."]~", '', $source);
Title: Re: Weird error after upgrading to 2.0.20b
Post by: toad78 on September 09, 2013, 02:22:19 AM
Thank you, Milbo. I will give this a try.

I guess VM 2 is not bug free?

Title: Re: Weird error after upgrading to 2.0.20b
Post by: Maxim Pishnyak on September 12, 2013, 12:45:26 PM
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.
Title: Re: Weird error after upgrading to 2.0.20b
Post by: toad78 on September 12, 2013, 17:44:16 PM
Yes, I noticed that prior to my comment.
Title: Re: Weird error after upgrading to 2.0.20b
Post by: Maxim Pishnyak on September 12, 2013, 20:59:09 PM
Thanx for that. This is my work.
Title: Re: Weird error after upgrading to 2.0.20b
Post by: AnSit on September 20, 2013, 19:42:05 PM
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?
Title: Re: Weird error after upgrading to 2.0.20b
Post by: jenkinhill on September 20, 2013, 23:20:47 PM
And in the current version, 2.0.22d ?
Title: Re: Weird error after upgrading to 2.0.20b
Post by: AnSit on September 20, 2013, 23:24:09 PM
Oh! Already there is a new version! :) Thanks for the info!

It turned out that the server host was at fault and have lost some php settings!
Fixed and it worked!
Title: Re: Weird error after upgrading to 2.0.20b
Post by: AnSit on September 22, 2013, 00:18:01 AM
After changing the settings on the php frontend error disappeared. And in the backend remains. But after updating to 2.0.22d - gone! Thank you!