User Info -> company name / how to store special characters

Started by Tentaurus, August 29, 2017, 12:02:54 PM

Previous topic - Next topic

Tentaurus

When I store a company name with special characters - in my case "&", for instance "Face & More", in the database (column _virtuemart_userinfos.company) it's stored as "Face & More"
It seems this is the way as VM stored this data. But is this correct? When I create an export (via CSVI export) I get some trouble...

In the column _virtuemart_userinfos.name it's stored (correctly) as "Face & More"

Studio 42

& is the HTML special char for &.
This should not give any trouble in normal cases.

Tentaurus

yes I know, but when I export userinfo data as csv (via CSVI) I get "&"

Studio 42

You wrote "But is this correct? ", yes or no, in the shop, this should never give any trouble, if you export it. YOu can search and replace & after export. The only problem is if you need to search for "Face & More" you get no result, but searching by company name in user fields is not possible in VM core.

jenkinhill

The ampersand is a reserved character in HTML. Encoding &, £ etc characters is important to an HTML document so that it can render properly and safely as a web page. Is CSVI converting the stored & to & ?
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Tentaurus

@Studio42: of course I can replace after export...
@jenkinhill: CSVI does not convert - & is stored in the db...

Studio 42

You have to wait for max or a full dev, if they want to change this.
I don't know myself why they encode the char, it's not needed.

Milbo

You must set for your user the right (acl) to write raw. All others are filtered as html
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Tentaurus

@Milbo: where can I set this right? I guess it's on Joomla group level?

jenkinhill

Joomla System / Global Configuration / Permissions. Select Virtuemart & configure permissions for "Allow raw input "
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Tentaurus

#10
I changed the setting for VM / public to "Allow raw input"
Same result: in the db is stored A&O (instead of A&O)

Happens also when I change customer data in the BE (as Superuser)

Maybe we're talking about different things: I'm asking to store A&O in the database exactly as it's written. Not A&O
Because CSVI reads exactly what's stored in the db.

Milbo

Hmm, I wonder a bit about this. But maybe I wrote a general htmlentity stuff when the data is written to the db. I fear I have no fast solution.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/