calcom / cal.com

Scheduling infrastructure for absolutely everyone.
https://cal.com
Other
31.76k stars 7.74k forks source link

[CAL-4388] Variable {name} in "with event name" for the calendar does not work #16770

Open joseuo94 opened 2 weeks ago

joseuo94 commented 2 weeks ago

Variable {name} in "with event name" for the calendar does not work. when booked it says: [object Object] and Jose Urena.

image.png

image.png

From SyncLinear.com | CAL-4388

FurquanAnwer commented 2 weeks ago

I would love to work on this.

kunal2899 commented 1 week ago

@joseuo94 I got the issue and would like to work on this if issue still persists. Also can you please throw slight light on steps to reproduce this. Thanks!

utkershrajvenshi commented 5 days ago

Hi @joseuo94 , not able to reproduce this issue. Could you share some details of the scenarios where it fails. Screenshot from 2024-10-04 00-47-51

Screenshot from 2024-10-04 00-48-12

lachieh commented 4 days ago

I was the one who reported this via support to cal.com so I can add the repro steps here:

  1. Create an event type
  2. Go to Advanced > Under "Booking Questions" > Click "Edit" on the "Your name" field
  3. Toggle On the 'Split "Full name" into "First name" and "Last name"' field: (Notice that on the separate fields, the top right indicates that the variable should be name.firstName and name.lastName) Screenshot 2024-10-04 at 2 13 21 PM
  4. At this point, if an event is booked and the "With event name" field is set to include the {name} variable, it will show up as "[Object object]" anywhere the event name is displayed. ⚠️ Fix: the name property type should be checked for object vs string and output as `${name.firstName} ${name.lastName}`
  5. If you attempt to use the suggested name.firstName variable in the name, you are presented with an error and will be unable to save the form: ⚠️ Fix: allow object properties to be used as replacement values in client-side validation if name is split" Screenshot 2024-10-04 at 2 19 02 PM
  6. I went a step further and submitted the event updates via a curl request to skip the client-side validation which accepted the change, however the replacement does not work. ⚠️ Fix: update server side to correctly evaluate the template when a value is accessed by object dot notation. Screenshot 2024-10-04 at 2 30 30 PM