Custom Properties Field Values not saving commas.

More
13 years 2 months ago #31 by sa
I'm inputting a bunch of names in the following format: last name, first name.
The labels do not retain the comma when I try to save the field values.

How do I fix this?

Please Log in or Create an account to join the conversation.

More
13 years 2 months ago #34 by andrea_4g
We run a few tests and I can say that commas are not "harmful" in value labels. While testing we found that we allowed ampersands that are instead a bad thing because they break tags recognition.
Thus we fixed the code to allow commas and strip ampersands.
It's an easy fix.
Edit file administrator/components/com_customproperties/models/cpfield.php
replace/modify line 421
Code:
$result = preg_replace("/[:,\/,\,]/", "", $field_or_value_label);
with
Code:
$result = preg_replace("/[\&:\/\\\]/", "", $field_or_value_label)

We'll update all CP packages in the coming days.
The following user(s) said Thank You: sa

Please Log in or Create an account to join the conversation.

More
13 years 2 months ago #37 by sa
Hi,

We tried replacing the code as suggested, but the labels are still not saving the commas.

Any other suggestions?

Please Log in or Create an account to join the conversation.

More
13 years 2 months ago #38 by andrea_4g
You have to replace the regex in file :
administrator/components/com_customproperties/tables/cpvalue.php at line 166
too.

Please Log in or Create an account to join the conversation.

More
13 years 2 months ago #39 by sa
That does the trick. Thank you

Please Log in or Create an account to join the conversation.

Time to create page: 0.167 seconds