You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi all,
I am writing to you about some Umbraco Forms issue that we are having with some old existing forms. The issue is related to duplicated keys: "Duplicates in a repeater are not allowed". Let me explain the full path of the issue.
We are running on Umbraco Forms 8.8.0 and we are having some existing forms. All is good on this version. The issue begins after upgrading Umbraco Forms to any newer version. The issue is related to existing forms when trying to view them in the backoffice Forms designer tab. It gives errors in the console and the output of it is that the selected form does not display.
Here is some of the error message:
Error: [ngRepeat:dupes] Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys. Repeater: fieldset in page. fieldSets track by fieldset.id, Duplicate key: 00000000-0000-0000-0000-000000000000
I investigated that a little and have some workaround - but it's something that for the long term we don't want to use as after the next Umbraco Forms upgrade it will be overridden again.
The fix is to remove the track by fieldset.id from this file umb-forms-designer-new.html
<div class="umb-forms__fieldset sortable" ng-repeat="fieldset in page.fieldSets" ng-class="{'-active':fieldset.state =='active'}" ng-click="setActive(fieldset)" data-umb="fieldset_{{$parent.$index}}_{{$index}}">
After that, it starts to work - displaying the forms fields. I did check and this was changed after merging some work for this issue: #647
And here question, what is your recommended approach to it? Is there a recommended way that doesn't have to change Umbraco files? Is this issue related to existing forms only?
Cheers,
Adrian
The text was updated successfully, but these errors were encountered:
Would you mind sharing one of your form definitions that shows this issue please @aochmann? You can email it to abl AT umbraco DOT dk if you prefer to not share it publicly here.
This will either be the JSON file on disk, or, if you are storing form definitions in the database, the contents of the Definition field of the UFForms table for the form in question.
I'd like to check it locally on the latest version of Forms and see if I can replicate the issue and review your suggested fix.
I suspect another approach to fix would be to manipulate the definitions of your forms to provide non-empty GUID IDs for the field set IDs. If you only have a few, that could be another option to take.
Thanks for sending over, I can replicate. I can confirm the workaround will fix it, which is quite straightforward for this one form, but how big a task it would be is tricky to say without knowing how many forms you have. I'll detail it anyway.
The crux of the issue is that the fieldsets on these older forms have empty GUIDs for IDs, and the back-office UI at this time (and looks like as of 8.7) has this expectation that they be unique.
So you could just manipulate the files to fix this up. For any that have more than one field set, like this one, replace:
Then save the file, restart the website, and they should be fine to edit again.
I don't think we can remove this track-by line to fix it, as that'll cause issue with the "copy form group" function that's been added in an earlier version.
We can though add some code to handle this legacy state, where if we find fields sets with empty GUIDs, we initialise them to unique, non-empty values when the form is being loaded in the back-office. It then loads OK. We'll include that in the next patch release for Forms 8.
Hi all,
I am writing to you about some Umbraco Forms issue that we are having with some old existing forms. The issue is related to duplicated keys: "Duplicates in a repeater are not allowed". Let me explain the full path of the issue.
We are running on Umbraco Forms 8.8.0 and we are having some existing forms. All is good on this version. The issue begins after upgrading Umbraco Forms to any newer version. The issue is related to existing forms when trying to view them in the backoffice Forms designer tab. It gives errors in the console and the output of it is that the selected form does not display.
Here is some of the error message:
I investigated that a little and have some workaround - but it's something that for the long term we don't want to use as after the next Umbraco Forms upgrade it will be overridden again.
The fix is to remove the
track by fieldset.id
from this fileumb-forms-designer-new.html
After that, it starts to work - displaying the forms fields. I did check and this was changed after merging some work for this issue: #647
And here question, what is your recommended approach to it? Is there a recommended way that doesn't have to change Umbraco files? Is this issue related to existing forms only?
Cheers,
Adrian
The text was updated successfully, but these errors were encountered: