Skip Navigation

[Escalated to 2nd Tier] Bug: Toolset should allow duplicate field names across repeating groups

This support ticket is created 5 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+01:00)

Tagged: 

This topic contains 1 reply, has 2 voices.

Last updated by Nigel 5 years, 1 month ago.

Assisted by: Nigel.

Author
Posts
#1217996

I found a bug in the Types plugin.

When editing a custom field group, Toolset does not allow duplicate field labels. This is fine and probably desired most of the time, but one exception is having an identically labeled fields in separate repeating field groups. This should be allowed, but currently, Toolset prevents it as an error.

Example:

Repeating Field Group #1
Label: Email
Slug: group-1-email

Repeating Field Group #2
Label: Email
Slug: group-2-email

This is perfectly valid, but Toolset will refuse to save because the labels are the same. The problem stems from the jQuery filter at /vendor/toolset/types/resources/js/fields-form.js:759

$('.wpcf-forms-field-name')

This filters out duplicate field labels EVEN ACROSS repeatable groups.

I believe the correct solution is to run the check once for all fields outside of a repeating group, and then run the check again for each repeating field group.

This gist provides the fix: hidden link

#1218231

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Hi Ben

I've escalated this as a usability issue (it's not really a bug), and I'll see what the developers say and whether they agree to change how it works.

I'll let you know.