VirtueMart Forum

VirtueMart Dev/Coding Central: VM1 (old version) => Virtuemart 1.1 Development (Archiv) => Quality & Testing VirtueMart 1.1.x => Topic started by: aravot on October 29, 2010, 19:57:44 PM

Title: Alternative image mouse-over doesn't work in VM description
Post by: aravot on October 29, 2010, 19:57:44 PM
VM 1.1.6 rev 2605

Alternative image mouse-over doesn't work in VM description, it works in Joomla content, see video http://www.protechsystems.us/stuff/joomla/vm/alternative-image.htm
Title: Re: Alternative image mouse-over doesn't work in VM description
Post by: zanardi on October 31, 2010, 12:15:30 PM
This is because JavaScript is removed by default from product description. In ps_product::add and ps_product::update you have:


$fields = array ( 'vendor_id' => $vendor_id,
'product_sku' => vmGet($d,'product_sku'),
'product_name' => vmGet($d,'product_name'),
'product_desc' => vmRequest::getVar('product_desc', '', 'default', '', VMREQUEST_ALLOWHTML),
'product_s_desc' => vmRequest::getVar('product_s_desc', '', 'default', '', VMREQUEST_ALLOWHTML),
...


The mask "VMREQUEST_ALLOWHTML" strips anything except from HTML. If you change that into "VMREQUEST_ALLOWRAW" you will have your "onmouseover" effect.

So this behaviour is "by design", and not a bug. Should we change it? After all, if Joomla content allows this kind of JavaScript, why shouldn't we do that in product description?

I'd like to have other opinions.
Title: Re: Alternative image mouse-over doesn't work in VM description
Post by: aravot on November 02, 2010, 19:11:39 PM
Since no one has replied, I say lets add it.
Title: Re: Alternative image mouse-over doesn't work in VM description
Post by: zanardi on November 03, 2010, 10:04:56 AM
If it's all the same for you i'd like to have some more opinions. I'll ask that in the chat.
Title: Re: Alternative image mouse-over doesn't work in VM description
Post by: aravot on November 03, 2010, 16:39:58 PM
Sure, the more input the better.
Title: Re: Alternative image mouse-over doesn't work in VM description
Post by: deannak on December 21, 2010, 22:07:54 PM
I was trying to add JavaScript to VM descriptions and ran into the same problem, but I was doing it to set up some Google Optimizer tests.  It would be helpful to me if it didn't strip out the JavaScript.
Title: Re: Alternative image mouse-over doesn't work in VM description
Post by: deannak on December 22, 2010, 03:00:29 AM
One more note here...  I used your method above so that I could put the Optimizer javascript into the description like I need.  That worked like a charm - thanks!

But, I then noticed that the javascript code also ended up in my Meta Description on the final webpage, which of course is not really the description I'd want showing up anywhere.

Thanks!  This has been very helpful.