› Forums › Modern DFFS › Bug in lookup if the lookup value contains a hyphen
- This topic has 13 replies, 2 voices, and was last updated 1 month, 2 weeks ago by
Marcus Khoo.
-
AuthorPosts
-
-
January 31, 2023 at 23:15 #36343
Marcus Khoo
ParticipantI create List A and add a column “Entity”. I add list items and enter a string value into the “Entity” column that contains a hyphen (e.g. “Solar-Planet” or “Solar-Star”)
I create List B and add a Lookup colum “Entity” that looks up List A and Column Entity.
I create a DFFS New and Edit form for List B.
I create a new list item in List B. It creates OK
I EDIT the list item in List B and the displayed value of the lookup has removed all the characters before the hyphen. (for example if I selected “Solar-Planet” it now only shows the lookup string “Planet”. If I SAVE this form then it corrupts the lookup./Marcus
-
February 1, 2023 at 09:46 #36345
Marcus Khoo
ParticipantJust tried it with a comma and a space and I get the same effect.
-
February 1, 2023 at 15:45 #36348
Marcus Khoo
ParticipantBTW I am using Edge
-
February 1, 2023 at 16:47 #36349
Alexander Bautz
KeymasterHi,
I set up a test based on your description, but cannot reproduce it. Can you add some screenshots of the config, the lookup list and the error – if any in the dev tools (F12 > Console).If you don’t want to add the screenshots here you can email them to me.
Alexander
-
February 2, 2023 at 00:47 #36354
Marcus Khoo
ParticipantI have emailed you some screenshots and done some more investigation.
The lookup only seems to work correclty if you configure the lookup column to retrieve the “Title” column in the lookup list.
Any other column seems to produce the error occurs (e.g. the attached screenshot will produce the error)
Attachments:
-
February 2, 2023 at 16:28 #36358
Alexander Bautz
KeymasterThanks for the clarification – I’ll get this fixed and release a new version tomorrow.
Alexander
-
February 3, 2023 at 17:45 #36370
Marcus Khoo
ParticipantJust tried the new release and it works – but only if there is ONE lookup field on the form.
If you have TWO lookup columns with EACH lookup configured for the same source list and field then you get another error:
Attachments:
-
February 3, 2023 at 18:07 #36374
Alexander Bautz
KeymasterI’m not able to reproduce this error. Are you using any filters on these lookups or are they just plain lookup fields?
Alexander
-
February 3, 2023 at 18:22 #36376
Marcus Khoo
ParticipantThey are standard lookups, no filters, no custom code etc. Strange thing is that it does show the correct value in the choice field but also throws a red error:
Attachments:
-
February 3, 2023 at 18:32 #36379
Marcus Khoo
ParticipantIf I change the lookup to look up “Title” there is no error
-
February 3, 2023 at 19:06 #36381
Alexander Bautz
KeymasterOK, I’ll do some more testing and try to figure it out during the weekend.
Alexander
-
February 3, 2023 at 20:24 #36382
Alexander Bautz
KeymasterI think I found the cause, but need you to confirm: I think this was caused by a bug in my code that did not take into account that the value in the field could be null (empty).
Can you confirm that the value in the field you are using for your lookup was empty for one or more of the items in the lookup list?
Alexander
-
February 6, 2023 at 21:35 #36393
Alexander Bautz
KeymasterI have released a new version that should fix the remaining problem with the “cannot read properties of null” error.
Let me know how it works out.
Alexander
-
February 9, 2023 at 14:47 #36407
Marcus Khoo
Participant1.0.10.0 has fixed it.
Well done Alexander
-
-
AuthorPosts
- You must be logged in to reply to this topic.