Zen Cart Logo
Forums / General Questions / Error: Unknown modifier '$' in main_product_image.php

Error: Unknown modifier '$' in main_product_image.php

Views: 1,390

Results 1 to 13 of 13
25 Sep 2012, 6:51 PM
#1
divinelighting avatar

divinelighting

Zen Follower

Join Date:
Jun 2006
Location:
Atlanta, GA
Posts:
124
Plugin Contributions:
0

Error: Unknown modifier '$' in main_product_image.php

I'm getting this in my error log. Any ideas? I'm using Image Handle 3, but the error occurs whether or not Image Handler is active.

PHP Warning: preg_replace(): Unknown modifier '$' in /includes/modules/4a/main_product_image.php on line 22

25 Sep 2012, 8:21 PM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Error: Unknown modifier '$' in main_product_image.php

There is no folder /includes/modules/4a/ in the standard distribution

25 Sep 2012, 8:24 PM
#3
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

Re: Error: Unknown modifier '$' in main_product_image.php

I am guessing /A4/ is the name of the template override folder

25 Sep 2012, 8:30 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Error: Unknown modifier '$' in main_product_image.php

kobra, "4a" is probably the custom template override foldername.

divinelightning, What's the image filename involved when the error is triggered?

25 Sep 2012, 10:47 PM
#5
divinelighting avatar

divinelighting

Zen Follower

Join Date:
Jun 2006
Location:
Atlanta, GA
Posts:
124
Plugin Contributions:
0

Re: Error: Unknown modifier '$' in main_product_image.php

4a is my active template. I don't know the file, but it is triggered very frequently. Not with every page view, but maybe 1/10 page views.

25 Sep 2012, 10:59 PM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Error: Unknown modifier '$' in main_product_image.php

Lemme say it another way: do any of your images have a $ in their filename? If so, remove it.

26 Sep 2012, 8:26 PM
#7
divinelighting avatar

divinelighting

Zen Follower

Join Date:
Jun 2006
Location:
Atlanta, GA
Posts:
124
Plugin Contributions:
0

Re: Error: Unknown modifier '$' in main_product_image.php

Unable to find images with '$'. This is the line the error refers to

$products_image_base = preg_replace('/'.$products_image_extension . '$/', '', $products_image);

replaced with

$products_image_base = preg_replace('/'.$products_image_extension . '/', '', $products_image);

which did not work because then I got the error

[26-Sep-2012 19:24:37 UTC] PHP Warning:  preg_replace(): Unknown modifier '/' in /home/divine/domains/divinelighting.com/public_html/includes/modules/4a/main_product_image.php on line 22
26 Sep 2012, 8:38 PM
#8
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Error: Unknown modifier '$' in main_product_image.php

I'm using Image Handle 3
There is no custom template file in IH3 for main_product_image.php but you have a custom version at /includes/modules/4a/main_product_image.php

What is this from??
Have you tried deleting it?

26 Sep 2012, 11:35 PM
#9
divinelighting avatar

divinelighting

Zen Follower

Join Date:
Jun 2006
Location:
Atlanta, GA
Posts:
124
Plugin Contributions:
0

Re: Error: Unknown modifier '$' in main_product_image.php

IH3 download has "Required Core Edits/includes/modules/YOUR_TEMPLATE/main_product_image.php"

27 Sep 2012, 2:59 AM
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Error: Unknown modifier '$' in main_product_image.php

Okay, back WAY UP and start at the VERY BASICS.
Do ANY of your image filenames have ANYTHING OTHER THAN letters and numbers, and a single "dot" in them? If so, change them.

27 Sep 2012, 3:46 AM
#11
divinelighting avatar

divinelighting

Zen Follower

Join Date:
Jun 2006
Location:
Atlanta, GA
Posts:
124
Plugin Contributions:
0

Re: Error: Unknown modifier '$' in main_product_image.php

There are thousands of pictures. I've glanced through them and seen the following characters:
~._ space#-
Which of these aren't allowable?

27 Sep 2012, 6:07 AM
#12
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Error: Unknown modifier '$' in main_product_image.php

divinelighting:

There are thousands of pictures. I've glanced through them and seen the following characters:
~._ space#-
Which of these aren't allowable?

The 'safe' characters are the underscore and minus. All of the others you list should be avoided (yes, even the [space]).

Cheers
Rod

27 Sep 2012, 9:26 AM
#13
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Error: Unknown modifier '$' in main_product_image.php

You're using Image Handler, and the documentation for Image Handler discusses acceptable characters.
So does the Zen Cart FAQ on images: http://www.zen-cart.com/content.php?100-how-do-i-add-multiple-images-to-a-product ... see the big text near the end of the article.