News:

Looking for documentation? Take a look on our wiki

Main Menu

Quotes in Product Child Name causes truncation (SOLVED)

Started by rayge, June 19, 2013, 22:58:23 PM

Previous topic - Next topic

rayge

I am not sure why but product names such as
1 3/4" Insert Medal in Silver with coin edge
gets truncated to
1 3/4
can someone validate this for me and tell me how to fix it? we are due to launch in 2 days!
I Use: Joomla 3.4.1 & VM 3.0.9

rayge

OKay when i View source it shows the full name but ofcourse if i save anything it will kill it. we should be using htmlentities in these fields in order to solve this.
Can someone give me direction on where i can change the code?
I Use: Joomla 3.4.1 & VM 3.0.9

Milbo

#2
You said it yourself. You must use html entities for the name and the short description. The reason is that people want be able to style their names with html.

We can do a poll about it, how it should be. One one hand it would be better to convert it directly. On the other hand the description is using the editors and must not be converted. Maybe a configuration option, ... hmmm.

Try the attached file, copy it to /BE/controllers.

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

rayge

#3
Well the product title itself has been handling quotes just fine.. its the child product name that I saw the issue.
I would agree that any textarea item should be able to handle html though but a text field would be treated differently.
IE quotes aren't an issue in a text area field for the most part.
<textarea></textarea> VS <input value=""> yanno?

Just my own opinion of course ;P

I tested that script at it didnt change the quotes in the child product name at all. just FYI
Maybe i put it in the wrong page?
/administrator/components/com_virtuemart/controllers/
Right?

OK here is what i was talking about..
/administrator/components/com_virtuemart/views/product/tmpl/product_edit_information.php
Line 344
thats the item i am seeing issues with.
<td><input type="text" class="inputbox" name="childs[<?php echo $child->virtuemart_product_id ?>][product_name]" size="32" value="<?php echo $child->product_name ?>" /></td>

If you look at like 63
<input type="text" class="inputbox"  name="product_name" id="product_name" value="<?php echo htmlspecialchars($this->product->product_name); ?>" size="32" maxlength="255" />

Shouldnt that be the same as like 344?
SO if you change it to
<td><input type="text" class="inputbox" name="childs[<?php echo $child->virtuemart_product_id ?>][product_name]" size="32" value="<?php echo htmlspecialchars($child->product_name); ?>" /></td>

everything shoudl be happy.. andy ou dont need to keep that controller file you just changed.

I Use: Joomla 3.4.1 & VM 3.0.9

Milbo

Ehrm no.
One time it is the name of the product and the other time it is the name of the child product.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

rayge

#5
Hmm well when I made the change I did everything worked as expected.
and when I tried your file it didnt fix anything.

SO what is wrong with the modification i made?

THANKS!
I Use: Joomla 3.4.1 & VM 3.0.9

Milbo

No, what I just meant is that you are talking about the edit field in the parent, which is for the child. Now I also understood what you meant with the child name.

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