VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: Tentaurus on August 29, 2017, 12:02:54 PM

Title: User Info -> company name / how to store special characters
Post by: Tentaurus on August 29, 2017, 12:02:54 PM
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"
Title: Re: User Info -> company name / how to store special characters
Post by: Studio 42 on September 17, 2017, 01:50:43 AM
& is the HTML special char for &.
This should not give any trouble in normal cases.
Title: Re: User Info -> company name / how to store special characters
Post by: Tentaurus on September 17, 2017, 11:31:08 AM
yes I know, but when I export userinfo data as csv (via CSVI) I get "&"
Title: Re: User Info -> company name / how to store special characters
Post by: Studio 42 on September 17, 2017, 12:02:22 PM
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.
Title: Re: User Info -> company name / how to store special characters
Post by: jenkinhill on September 17, 2017, 12:05:46 PM
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 & ?
Title: Re: User Info -> company name / how to store special characters
Post by: Tentaurus on September 18, 2017, 08:36:32 AM
@Studio42: of course I can replace after export...
@jenkinhill: CSVI does not convert - & is stored in the db...
Title: Re: User Info -> company name / how to store special characters
Post by: Studio 42 on September 18, 2017, 11:46:50 AM
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.
Title: Re: User Info -> company name / how to store special characters
Post by: Milbo on September 18, 2017, 13:05:55 PM
You must set for your user the right (acl) to write raw. All others are filtered as html
Title: Re: User Info -> company name / how to store special characters
Post by: Tentaurus on September 18, 2017, 13:31:21 PM
@Milbo: where can I set this right? I guess it's on Joomla group level?
Title: Re: User Info -> company name / how to store special characters
Post by: jenkinhill on September 18, 2017, 13:52:19 PM
Joomla System / Global Configuration / Permissions. Select Virtuemart & configure permissions for "Allow raw input "
Title: Re: User Info -> company name / how to store special characters
Post by: Tentaurus on September 18, 2017, 14:08:32 PM
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.
Title: Re: User Info -> company name / how to store special characters
Post by: Milbo on September 20, 2017, 21:15:37 PM
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.