Skip to content

Scheduling infrastructure for absolutely everyone.

Handle empty label from Custom inputs (#7871)

Hariom Balhara20b3efbcb62d
diff --git a/packages/features/bookings/lib/getBookingFields.ts b/packages/features/bookings/lib/getBookingFields.ts
index 42304c9ad7e..9bfd75e6dc4 100644
--- a/packages/features/bookings/lib/getBookingFields.ts
+++ b/packages/features/bookings/lib/getBookingFields.ts
@@ -295,12 +295,13 @@ export const ensureBookingInputsHaveSystemFields = ({
// Backward Compatibility: If we are migrating from old system, we need to map `customInputs` to `bookingFields`
if (handleMigration) {
- customInputs.forEach((input) => {
+ customInputs.forEach((input, index) => {
bookingFields.push({
label: input.label,
editable: "user",
// Custom Input's slugified label was being used as query param for prefilling. So, make that the name of the field
- name: slugify(input.label),
+ // Also Custom Input's label could have been empty string as well. But it's not possible to have empty name. So generate a name automatically.
+ name: slugify(input.label || `${input.type}-${index + 1}`),
placeholder: input.placeholder,
type: CustomInputTypeToFieldType[input.type],
required: input.required,