By Kevin on Thursday, 05 February 2015
Posted in Technical Issues
Replies 6
Likes 0
Views 653
Votes 0
Characters in a json string are stripped on save after entering the string as the Default Value parameter for a Textbox field. This string:

[{"membership":[{"name":"Silver","background":"B3B3B3","label":"141619"},{"name":"Gold","background":"BA9C00","label":"383000"},{"name":"Platinum","background":"9C9D9E","label":"141619"}]}]


becomes this after save:

[{
Hello Eileen,

Can you provide us your backend and FTP access so we can have a better look on your issue here?
·
Thursday, 05 February 2015 12:44
·
0 Likes
·
0 Votes
·
0 Comments
·
Yes, also I wasn't as clear as I could have been. The issue above is when editing from the back-end and attempting to set the "default" value. I have other perhaps related issues. Thank you Nik for time looking here.


  1. As illustrated in the attached, it appears that an html field does not return a value from getFieldData

  2. same apparently for a Text field

  3. It appears the default for a "Textarea" field is not persistent or respected

  4. Lastly, the first of the two Textarea fields behaves similarly, however I did set that field from the front-end. Later I set it to "". Question: would this user edit from "something" to "nothing" cause the "Default" value to appear in this area or is it expected that the Default value for all custom fields only applies before that field is ever edited by the user? Of course I intend certain of these fields not to be visible to the user during display or editing so it's not critical for me but it'd be good to know if this is a bug or just the way it works.
·
Thursday, 05 February 2015 13:12
·
0 Likes
·
0 Votes
·
0 Comments
·
BTW to see the generated debug messages just click on your profile "About" link.

Adding on in addition to the issues, related questions:


  1. what's the difference between getFieldData and getFieldValue? Neither appear operative in the examples above. Does one return and object if the data has to be stored that way (i.e. address) and the other used when the data is ordinal?

  2. Do custom variable "Default" values only apply during the "Display" of a profile, or do they become part of the profile variables accessible via getFieldxxx function calls?
·
Friday, 06 February 2015 06:12
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Eileen,

I've fixed the joomla_fullname.php file. Please my changes. As for the second text field, it doesn't show any data because you have put the wrong unique key; TEST_TEXTAREA2 instead of TEST_TEXTAREA_2. Hope this helps.
·
Friday, 06 February 2015 12:28
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Nik,

Well it looks like Penguasaan Bahasa Melayu Saya Lemah, almost as bad as my PHP

Terima Kasih Berbanyak-Banyak
·
Friday, 06 February 2015 23:27
·
0 Likes
·
0 Votes
·
0 Comments
·
Haha, nice one Eileen!
·
Saturday, 07 February 2015 02:23
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post