News:

Looking for documentation? Take a look on our wiki

Main Menu

Problem with double quotation marks

Started by sscheidegger, December 29, 2011, 11:58:38 AM

Previous topic - Next topic

sscheidegger

Hi all

Found the following VM bug when using double quotation marks in the category name or product name: A product/category name with double quotation marks (example: <The "one" product>) can be stored and will display correctly in FE and BE. However when the product/category is edited afterwards, the name is not loaded correctly and on saving the product/category again, parts of the name get lost (example: <The >).

I guess this is an easy one ;-)

Milbo

I fear that is an evil one.

Use html entities for things like !"ยง$% and so on. That is afaik the most correct method.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

sscheidegger

Very interesting. I tried to use &quot; instead of ". The behaviour is exactly the same! <The &quot;one&quot; product> can be stored and displays as <The "one" product>. But when I edit the product, it shows <The > in the name field and stores it like that.

From the observed behaviour I'd say the special characters are escaped correctly before storing them to the database. About displaying it later in the FE I'm not sure, in the html code of the website I find both, <The &quot;one&quot; product> for the page title and <The "one" product> for the product name! However, I don't mind as long as it displays correctly.

The real problem happens when loading the edit form of the BE. There, the product/category name doesn't use html entities for displaying them. The html code is
<input type="text" class="inputbox"  name="product_name" id="product_name" value="The "one" product" size="32" maxlength="255" />

Hope this helps!

jjk

Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

jan suhr

I have the same problem trying to set inch in my produktnames, like 17" and so on.

When saving the product the " and everything after it is gone. Tried &quot; but that gave the same kind of error.

I don't think it has anything to do with PHP-versions in this case since I have tried other shops on the same system and they can handle the inch/quote without any problems.

Over half of the products in this shop has inches in their productnames. I don't like to write 17in or for Swedish 17tum on the products.

Jan
Jan Suhr
Color Consult AB
Stockholm, Sweden

behemoth

I've just come across this problem. Is there a suggested fix? The site I'm working on has a number of products that are referenced by their size in inches, represented by a ".

behemoth

I have a workaround for what I'm doing here. It appears I can substitute the quotation mark with the HTML entity &quot; in the csv file I import via CSVi and it appears to work ok. It doesn't answer the question, but if anybody else is in the same situation as me, it does work.

ryandiaz

Related bug: When my product name starts with quotation mark (")

for example: "Happy Birthday" Paper Napkins

When one clicks Add to Cart, the entire product name gets dropped from inside the ajax facebox popup box. Instead of saying: "Happy Birthday" Paper Napkins has been added to your cart.  It says: has been added to your cart.

As a work around, I have removed all instances of quotation marks from my product names.  But you can see where this would be a problem if someone relied on using quotation marks.

Joomla 2.5.9 | Virtuemart 2.0.20b
[glow=red,2,300]Joomla 1.5.22 | Virtuemart 1.1.6 Stable | PHP 5.3.13[/glow]

Milbo

Quote from: jan suhr on December 30, 2011, 17:22:42 PM
I don't think it has anything to do with PHP-versions in this case since I have tried other shops on the same system and they can handle the inch/quote without any problems.
The whole thing is so complex, because there are different php versions and for this versions the handling is different. That means, there is a solution for any php method. But maybe the other shopsystem is strong on php 5.2 and vm on php5.3.

Quote from: behemoth on February 27, 2013, 14:17:52 PM
I have a workaround for what I'm doing here. It appears I can substitute the quotation mark with the HTML entity &quot; in the csv file I import via CSVi and it appears to work ok. It doesn't answer the question, but if anybody else is in the same situation as me, it does work.

But this shows that your editor is not correctly configured. This is the next problem, that you can configure your editor in joomla, if it should replace " by the correct html entity, or not. It depends if you use TinyMce or JCE.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

jjk

Just for info - somebody else who wanted to use quotes in the titles instead of the word inches uses double single quotes as a workaround.
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

lindapowers

#10
I just noticed that when customers enter their address like this:

street 1, (cofee shop)

the system only displays: street 1 ignoring the ( ) and the text inside.

Don't know if is related to this issue.

Regards

behemoth

Quote from: behemoth on February 27, 2013, 14:17:52 PM
I have a workaround for what I'm doing here. It appears I can substitute the quotation mark with the HTML entity &quot; in the csv file I import via CSVi and it appears to work ok. It doesn't answer the question, but if anybody else is in the same situation as me, it does work.

But this shows that your editor is not correctly configured. This is the next problem, that you can configure your editor in joomla, if it should replace " by the correct html entity, or not. It depends if you use TinyMce or JCE.
[/quote]

Sorry I didn't reply sooner.

I'm not using the Joomla editor. There are so many products, these are managed via CSVi. The problem is in inputting them into the csv files in the first place, but not really within the scope of Joomla or Virtuemart.