html entities .. and custom parameters - quorvia_product_cart_variant

Started by GJC Web Design, April 23, 2020, 00:11:18 AM

Previous topic - Next topic

GJC Web Design

Using the excellent quorvia_product_cart_variant custom plugin (https://forum.virtuemart.net/index.php?topic=127362.0 ) ...

From an older VM  (not sure when this problem started  - perhaps ~ vm3.2.0 ) many 100s of the customfield_params have been entered in the admin with line breaks

These were stored in the DB as

custom_drop="1 - Commercial script,\r\n2 - Palace,\r\n3 - English script,\r\n4 - Times,\r\n5 - TIMES VET,\r\n6 - Zurich,\r\n7 - Murray,\r\n8 - Script tina,\r\n9 - Bickley,\r\n10 - Edwardian,\r\n11 - American,\r\n12 - Garamond,\r\n13 - Comic Sans,\r\n14 - ARMY,\r\n15 - Amaze"|custom_drop_weight="0"|

after updating to VM3.6.10 if the product is stored again it saves these as

custom_drop="1 - Commercial script,
2 - Palace,
3 - English script,
4 - Times,
5 - TIMES VET,
6 - Zurich,
7 - Murray,
8 - Script tina,
9 - Bickley,
10 - Edwardian,
11 - American,
12 - Garamond,
13 - Comic Sans,
14 - ARMY,
15 - Amaze"|custom_drop_weight="0"|

which leads to this delightful display.. see screenshot

changing the

$selects[] = array('value' =>$valueWithPrice[0], 'text' => htmlentities($text) );

to

$selects[] = array('value' =>$valueWithPrice[0], 'text' => $text) ;

in the customfield display template corrects the select display but the display in the cart and email/invoice is still duff...


Lettertype 
6 - Zurich
Kleur Opdruk Donkerbruin

Removing the line breaks either in the DB or thru the admin of course solves everything but interested in why this has changed ..  where is this new save pattern coming from?

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

AH

Looks to be something to do with VM and the way it is saving the product_customfield data in the database
No issue when it saves the original _customfield data
Regards
A

Joomla 3.10.11
php 8.0

GJC Web Design

agree ..  something is different in VM as to what was previously happening on "save"
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

AH

and is different in admin customfield save vs admin product customfield save
Regards
A

Joomla 3.10.11
php 8.0

Studio 42

I said in 2012 that the solution is to use JSON to save all parameters to prevent this problems
About the problem, perhaps some user had a problem with encoding and Max added an encoding since. But the solution is to move the params to use json for all the datas.