Author Topic: Apostrophes  (Read 152 times)

six gun

  • Beginner
  • *
  • Posts: 34
  • Why is coding so difficult sometimes?
    • C60 in olive oil
Apostrophes
« on: July 05, 2018, 06:57:59 am »
i feel sure this must have been dealt with elsewhere on the forum but i cannot find it.
I do not have this problem anywhere else in Joomla.
When i save text with an apostrophe in it, it is saved as [& # 39 ;] i am separating the characters so it does not save in the forum as ' an apostrophe.
i only have this issue in French as i do not use apostrophes otherwise.
i can sort this out by going into the database and replacing the [& # 39 ;] with '
This occurs every time i save text box inputs such as product title, meta key, meta description.

Is there anyway to get round this - as i am editing product entries quite a lot at the moment i feel like i have done this quite a few times.

hellorain

  • Jr. Member
  • **
  • Posts: 91
    • Raincreatives - Virtuemart & Mobile Commerce Experts
  • Skype Name: support.raincreatives
Re: Apostrophes
« Reply #1 on: July 05, 2018, 07:27:05 am »
Hello,

You have to pass string some  method like addslashes(string). that will sort out.

Best Regards,
hellorain.
Raincreatives - Virtuemart & Mobile Commerce Experts

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 7783
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.2.14
Re: Apostrophes
« Reply #2 on: July 05, 2018, 12:40:24 pm »
I also hit this problem with the display of products names containing a <br /> - saved as  &#60;br /&#62;

I translated at template level -- e.g.

$name = str_replace('&#60;br /&#62;', '<br />', $product->product_name);
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

jjk

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3327
  • using Matomo instead of Google Analytics
Re: Apostrophes
« Reply #3 on: July 05, 2018, 16:14:53 pm »
I didn't find the exact cause of the problem yet. It is probably related to a changed filter in revision 9722. In VirtueMart 3.2.15 the issue seems to be solved for the product name, but it still exists for the meta data.

However, if you are typing on a Windows system, you can use one of the following alt codes to enter 'real' quotes/apostrophes as a workaround.
Alt 0145    ‘    curly single open quote
Alt 0146    ’    curly single close quote
Alt 0147    “    curly double open quote
Alt 0148    ”    curly double close quote
Alt 0132    „    low curly doublequote

There are more variants of apostrophes, but I tested only the ones mentioned above.
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

six gun

  • Beginner
  • *
  • Posts: 34
  • Why is coding so difficult sometimes?
    • C60 in olive oil
Re: Apostrophes
« Reply #4 on: July 08, 2018, 12:28:10 pm »
What a star.
i just used the Num Lock -
Press Alt key + 0146 for the ' sign.
Saved this and bingo - it works a treat.

Fantastic advice.