Basic Information Profile Field

If you aren't speaking german, you can ask for support or post your request here.
Antworten
Benutzeravatar
southernyankee65
Beiträge: 22
Registriert: 19. Jan 2019, 18:35
Wohnort: Alabama, USA
Kontaktdaten:

Basic Information Profile Field

Beitrag von southernyankee65 »

I just installed the latest release 3.3.10 and was adding new profile fields.

I assigned the new profile field to the Basic Information category and chose the Checkbox data type. However, it is not prompting me for the check box values. I see nowhere that I can enter the values, I can only save the profile field. (the forum won't allow me to attach a screenshot).

Also, when I choose Radio button, it does not prompt me for the values until I click save and then it tells me to go back and fill in the values, which after I click the back link it then shows me the Values field. (sorry can't attach another file)

I am using MAMP Pro 5.2.2 with PHP 7.1.22 and MySQL 5.7.23 on Mac OS 10.14.2. My browser is Chrome.

Tom
Benutzeravatar
southernyankee65
Beiträge: 22
Registriert: 19. Jan 2019, 18:35
Wohnort: Alabama, USA
Kontaktdaten:

Re: Basic Information Profile Field

Beitrag von southernyankee65 »

I have also tried this in Safari with the same results. The values field does not appear for a checkbox field type.
Benutzeravatar
southernyankee65
Beiträge: 22
Registriert: 19. Jan 2019, 18:35
Wohnort: Alabama, USA
Kontaktdaten:

Re: Basic Information Profile Field

Beitrag von southernyankee65 »

This is also happening on the Dropdown category type as well.

It seems like the Javascript isn't changing the boxes on the screen as the data type is being changed.

Is it not supposed to dynamically change with the selection?

Tom
XimeX
Developer
Beiträge: 1148
Registriert: 12. Jul 2015, 13:21
Wohnort: Austria

Re: Basic Information Profile Field

Beitrag von XimeX »

If you choose checkbox it has only a true/false state.
If you want more checkboxes you have to add more fields.

if you choose radio button or dropdown you should see a new textbox called "Value list". Hover over the question mark to get the info how to enter your values. (each row is a value)
Benutzeravatar
fasse
Administrator
Beiträge: 6041
Registriert: 12. Nov 2005, 16:06

Re: Basic Information Profile Field

Beitrag von fasse »

Hi Tom,

the value list should appear automatically (view our demo). Can you look if there is a javascript-error at your page.

Best regards
Fasse
Benutzeravatar
southernyankee65
Beiträge: 22
Registriert: 19. Jan 2019, 18:35
Wohnort: Alabama, USA
Kontaktdaten:

Re: Basic Information Profile Field

Beitrag von southernyankee65 »

It does not show any errors. I have in fact created a test checkbox field on your demo site and it allows the profile field to be saved. There is no error checking like the radio button to ensure at least one value list item completed.
Benutzeravatar
southernyankee65
Beiträge: 22
Registriert: 19. Jan 2019, 18:35
Wohnort: Alabama, USA
Kontaktdaten:

Re: Basic Information Profile Field

Beitrag von southernyankee65 »

I have also cloned the GitHub repository and the latest beta also behaves in the same way.

I looked at the code in the file fields_new.php and it appears that the checkbox element is only allowing it to be a boolean type field without the ability to have multiple options where a member could check multiple items.

If an admin needed to test for multiple conditions, say 20, the only way to do this presently is with a single checkbox field which means you would have to create 20 profile fields to test for each condition rather than using one checkbox field with 20 options.

For example

Option Checkbox - Have you ever eaten any of these bugs?

[] Scorpion [] Cockroach [] Fly [] Spider [] Knat

[] Lice [] Weevil [] Centipede

Using the above example I would have to have eight profile fields to determine the condition of each item.

It appears that there isn't multiple $fieldProperty values in the profile_new.php file when calling for this.

I still can't explain why I cannot see the 'field value' when creating a Checkbox data type, but I'll keep looking.

Tom
Benutzeravatar
southernyankee65
Beiträge: 22
Registriert: 19. Jan 2019, 18:35
Wohnort: Alabama, USA
Kontaktdaten:

Re: Basic Information Profile Field

Beitrag von southernyankee65 »

[quote="XimeX"]If you choose checkbox it has only a true/false state.
If you want more checkboxes you have to add more fields.

if you choose radio button or dropdown you should see a new textbox called "Value list". Hover over the question mark to get the info how to enter your values. (each row is a value)[/quote]

Please see my comment above. A form can have multiple checkboxes for a single field. This isn't congruent with how forms work. Having multiple questions is very poor form.
Benutzeravatar
southernyankee65
Beiträge: 22
Registriert: 19. Jan 2019, 18:35
Wohnort: Alabama, USA
Kontaktdaten:

Re: Basic Information Profile Field

Beitrag von southernyankee65 »

Looking into this further, I think this could be achieved by storing values for multiple checkboxes and adding some code to display those values with checkboxes (like you do with radio buttons).

The values would be stored like you do for the radio button data type, allowing for multiple checkbox values (like the radio button values) which would be stored as comma separated boolean values (0 or 1) in the adm_user_data table in the usd_value_field.

So using my example of the bugs in my reply above above, the profile field would look like this:

[u]NAME[/u]
[b]Name[/b]: Bugs Eaten
[b]Internal name[/b]: BUGS_EATEN
[b]Category[/b]: Basic Information (All organizations)

[u]DISPLAY[/u]
[b]Data type[/b]: Checkbox
[b]Value List[/b]:
[code] Scorpion
Cockroach
Fly
Spider
Gnat
Lice
Weevil
Centipede[/code]

[b]Icon[/b]:
[b]URL[/b]:

[u]PERMISSIONS[/u]
Field to see for all users
Field editable only for user with permission Edit profile of all users
Mandatory field that has to be filled in always.
Field is displayed during registration

[u]DESCRIPTION[/u]
Please check which bugs you have eaten in your lifetime.

So, we'll say Paul checked the boxes for Fly, Spider, and Gnat

The only change in the MySQL database would be the usf_value_list field would have the values stored just like they are for radio button data types.

The Paul's record in the adm_user_data table would then be populated with the following for this profile field:

user_id = 1
usd_user_id = 18130
usd_usf_id = 26
usd_value = 0,0,1,0,1,1,0,0

You are currently storing the values in the usd_value as a varchar(4000), which shouldn't cause backwards compatibility problems as far as I can see, because if someone created a checkbox profile field in an earlier version the data would still be valid (0 or 1) for a single checkbox without a value assigned. This situation could be tested with a conditional statement to see if multiple values have been assigned to usf_value_list, meaning there should be multiple checkboxes and multiple values in the usd_values field, or if no value assigned to the usf_value list, this is a single checkbox and should have only one value (0 or 1) in the usd_value field.

Hope this makes sense.

Tom
Antworten