- Posts: 49
- Thank you received: 0
Custom Properties Field Values not saving commas.
- sa
- Topic Author
- Offline
- Senior Member
Less
More
13 years 2 months ago #31
by sa
Custom Properties Field Values not saving commas. was created 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?
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.
- andrea_4g
- Offline
- Administrator
Less
More
- Posts: 1122
- Thank you received: 163
13 years 2 months ago #34
by andrea_4g
Replied by andrea_4g on topic Re: Custom Properties Field Values not saving commas.
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
with
We'll update all CP packages in the coming days.
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);
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.
- sa
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 49
- Thank you received: 0
13 years 2 months ago #37
by sa
Replied by sa on topic Re: Custom Properties Field Values not saving commas.
Hi,
We tried replacing the code as suggested, but the labels are still not saving the commas.
Any other suggestions?
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.
- andrea_4g
- Offline
- Administrator
Less
More
- Posts: 1122
- Thank you received: 163
13 years 2 months ago #38
by andrea_4g
Replied by andrea_4g on topic Re: Custom Properties Field Values not saving commas.
You have to replace the regex in file :
administrator/components/com_customproperties/tables/cpvalue.php at line 166
too.
administrator/components/com_customproperties/tables/cpvalue.php at line 166
too.
Please Log in or Create an account to join the conversation.
- sa
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 49
- Thank you received: 0
13 years 2 months ago #39
by sa
Replied by sa on topic Re: Custom Properties Field Values not saving commas.
That does the trick. Thank you
Please Log in or Create an account to join the conversation.
Time to create page: 0.167 seconds