Author Topic: html entities .. and custom parameters - quorvia_product_cart_variant  (Read 513 times)

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 9651
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.6.8
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

Code: [Select]
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

Code: [Select]
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

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

Code: [Select]
$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 http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3165
  • VirtueMart Version: 3.6.11
Re: html entities .. and custom parameters - quorvia_product_cart_variant
« Reply #1 on: April 23, 2020, 14:48:20 pm »
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.9.18
php 7.3

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 9651
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.6.8
Re: html entities .. and custom parameters - quorvia_product_cart_variant
« Reply #2 on: April 23, 2020, 14:49:56 pm »
agree ..  something is different in VM as to what was previously happening on "save"
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3165
  • VirtueMart Version: 3.6.11
Re: html entities .. and custom parameters - quorvia_product_cart_variant
« Reply #3 on: April 23, 2020, 15:00:43 pm »
and is different in admin customfield save vs admin product customfield save
regards
A

Joomla 3.9.18
php 7.3

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4329
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: html entities .. and custom parameters - quorvia_product_cart_variant
« Reply #4 on: April 23, 2020, 17:32:50 pm »
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.