• I had a repeater custom field which has subfields like “1_poz_ad”, “1_poz_en”, “1_poz_boy” when I tried to make a calculated field like “1_poz_ad * 1_poz_en” I saw they all result with “0”.

    Then I tried to figure out what’s going on for a day, then I saw that when I change the field names to full-alphabetic names it started working again.

    I changed “1_poz_en” to “first_poz_en” then it started working again.

    I don’t know if the author still around for this plugin but wanted to share it with community.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor nick6352683

    (@nick6352683)

    Thanks for sharing,

    I wonder if this is an ACF issue or not… I also wonder if the subfield names started with a letter and numbers are allowed elsewhere… for example “poz_ad_1” as oppose to “1_poz_ad”.

    I’ll do some tests and report back in a day or so…

    Plugin Contributor nick6352683

    (@nick6352683)

    Ok, I did some quick tests:

    1. I do confirm that starting the field names that will be part of any calculation with a number, the calculated field will not calculate. This is true whether the fields are sub fields (ie: fields in a Repeater field), or not.

    2. However, all is not lost: Ending any field name with a number will work as I pondered above.

    3. And since we are sharing hints, while doing these tests, I discovered that when you create a Field Group, you won’t see the “Read Only” setting for each field, until you save the field group first. So create a field group, give it a name, and save it. Then reload the page to see the “Read Only” settings.

    For now, that’s all I have for you…

    I’d like to add to this.

    I have 11 different forms, each with pretty simple calculations. Each field uses the Select option, and the options are Yes and No, with values of 1 and 0. I use a penultimate field to calculate the totals of all fields, and then a final field to calculate total/number of fields then * 100 to get a final score.

    8 of these forms work perfectly, 3 do not. I’ve beaten my head against the wall for 2 days trying to troubleshoot, and I think I finally figured it out. And it’s crazy enough that I wanted to come post it here in case it can help others facing this same issue.

    To save time, I started shortening the field names to something like, web_1, web_2, web_3…. rather than coming up with new names for each field. It seems this is the issue. Once I changed up the field names, the calculations started working.

    I’ve confirmed this on 2 of the 3 forms that were not calculating. Now they are working just fine.

    To confirm, changing the names up to something like, website_1, pages_2, etc, works just fine.

    Hope this helps!

    One more follow-up to this troubleshooting.

    In the 3rd broken form, my field names were unique, but did have dashes in a couple of them, which broke the calculations because they were construed as minuses instead of dashes.

    Once I replaced them with underscores, the calculations work just fine!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Bug Report About Field Names Containing Numbers’ is closed to new replies.