Zen Cart Logo
Forums / Setting Up Categories, Products, Attributes / Symbols truncate Product Name and Description after editing

Symbols truncate Product Name and Description after editing

Views: 1,277

Results 1 to 3 of 3
3 Mar 2010, 12:18 PM
#1
sprainbrook avatar

sprainbrook

New Zenner

Join Date:
Mar 2010
Posts:
4
Plugin Contributions:
0

Symbols truncate Product Name and Description after editing

When editing a product, the Description field frequently become truncated at an html symbol or stray curly quote.

For example, entering Description "Some Product® description" will preview, save and display correctly on the site. When the Edit page loads, this will be truncated as "Some Product".

A stray curly quote (very hard to avoid these) will do almost the same thing, so "This product won’t stain carpets" previews fine but does not display on the site correctly. When you click Edit it becomes "This procuct won" and the rest is truncated.

Similarly, and possibly related, using an html symbol in the Product Name initially saves ok, but a subsequent Edit turns the symbol into an ascii character, so ® in the Name or Description becomes ® and stays ® when you save the edit.

I can certainly learn to work around this limitation. Is there a list of symbols which are known to malfunction? Then I can find/replace my existing site's database before I transfer hundreds of products to Zen Cart. I can probably tweak code to fix this, but I'm really focused on getting the site running rather than code tweaking.

Thanks for your help. Zen Cart is wonderful!

5 Mar 2010, 12:44 AM
#2
sprainbrook avatar

sprainbrook

New Zenner

Join Date:
Mar 2010
Posts:
4
Plugin Contributions:
0

Re: Symbols truncate Product Name and Description after editing

Should I post this in a different category? I'm completely stuck now. I have narrowed the problem down to the preview modules where html entities are converted to text, and text symbols in the Description cause truncation. Makes no difference using HTMLArea or plain text editor. My DB which I need to move is absolutely littered with symbols which break Zen Cart, even after converting all of the html entities and replacing all of the curly quotes with straight quotes.

5 Mar 2010, 2:59 AM
#3
sprainbrook avatar

sprainbrook

New Zenner

Join Date:
Mar 2010
Posts:
4
Plugin Contributions:
0

Re: Symbols truncate Product Name and Description after editing

Sorry I have to keep adding in replies. There does not seem to be a way to edit my original post in this forum, so I have to keep adding on...

**Here is a way to replicate the problem. **Zen Cart is version 1.3.8a. Start a new test product:

Original baseline test product info entered into Product>New Product
AAAManufacturer® Product™
Manufacturer® Product™. Has this &amp that. A non breaking phrase. Some greek α and β

HTML source on New Product>Preview page
<input type="hidden" name="products_name[1]" value="AAAManufacturer&reg; Product&trade;">
<input type="hidden" name="products_description[1]" value="Manufacturer&reg; Product&trade;. Has this &amp that. A&nbsp;non&nbsp;breaking&nbsp;phrase. Some greek &alpha; and &beta;">

MySQL data after Preview and Insert (exactly the same as baseline)
AAAManufacturer® Product™
Manufacturer® Product™. Has this &amp that. A non breaking phrase. Some greek α and β

So far so good! HTML entities were perfectly preserved through New>Preview>Insert. No problems editing and updating directly in MySQL table.

The trouble starts upon subsequent editing of this existing product:

Product>Edit loads this corrupted version. The trouble starts right here.
AAAManufacturer® Product™
Manufacturer® Product™. Has this & that. A non breaking phrase. Some greek α and β

HTML source on Product>Edit page
<input type="hidden" name="products_name[1]" value="AAAManufacturer® Product™">
<input type="hidden" name="products_description[1]" value="Manufacturer® Product™. Has this & that. A non breaking phrase. Some greek &#945; and &#946;">
(Note, in the above phrase "A non breaking phrase", the spaces are NOT normal chr(32) space chars.

Product>Edit>Preview stays the same as above.

What MySQL contained after Product>Edit>Preview>Update
AAAManufacturer
Manufacturer