User tests: Successful: Unsuccessful:
Pull Request for Issue #27307 .
This fixes a name duplication, that may happen in specific cases.
Apply patch, run npm install
Add subform field somewhere
<field name="test_fields" type="subform" label="test_fields" multiple="true" min="1" max="5">
<form>
<field name="test_field" type="text" label="TESTFIELD1"/>
</form>
</field>
Do steps described by @cinemarene in #27307:
Go to the form.
Now there is one row with key 0.
Add one row with "+" button.
Now there are two rows with 0 and 1.
Remove first row with key 0 over button "-".
Now there are one row with key 1.
Add one row with "+" button.
Now there are two rows with key 1 and 1.
You do not have duplicated field names
You have duplicated field names
none
Status | New | ⇒ | Pending |
Category | ⇒ | JavaScript Repository NPM Change |
Labels |
Added:
NPM Resource Changed
?
|
it pass this time :)
Is like winning in lotto with the drone ;-)
will test later.
I have tested this item
Tested with subform in "Users Options" > "Email Domain Options".
@cinemarene @ReLater Please test.
@alikon Do you think you can test this PR? No need to add field code somewhere, you can use subform in "Users" -> "Manage" -> "Options" -> "Email Domain Options". You can add and remove rows with domain rules as described in the testing instructions and check the IDs of the fields with browser tools.
in theory it should be just enough to run node build.js --compile-js
for update the script of the custom element, instead of full npm install
yeah, that true :)
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-01-01 08:59:35 |
Closed_By | ⇒ | HLeithner | |
Labels |
Added:
?
|
Thanks
As far as I know, the fix from #22757 was necessary to fix that data is not being saved correctly when having nested subforms - see #22441 @dawe78 reports:
Its not the id only, the issue affects name too - so saving fails.
@Fedik wrote in #27334 (the J!3 version of this PR):
In general, random row numbers does not lead to any functional issue.
So I have to disagree, see also #22690 !
#22757 was to fix those 2 bugs. I see now that it introduced a new bug, but just reverting the changes from #22757 will not help us very much, as those two older bugs now will be reintroduced. I still have to test this PR whether that is really the case, but we should really discuss whether we have a better solution to this than just reverting
@Fedik it is not about random numbers. Please read #22690 thoroughly. The issue is about having nested subforms (a subform inside of a subform) and then adding a new row in the inner-most subform. This row will have the wrong name of its parent row and hence the backend cannot know to which outer subform row this inner childrow belongs.
okay, I see, children loosing parent :)
Well, but that not a fix #22757 anyway, it need to debug more, to find how to prepare a name, especially for children (need to avoid of losing a parent group somehow).
j4 and j3 has different handling of children:
j3 have one subform instance common for all nested forms
j4 have one subfrom instance per nested
That bug for j3, need to test how it work in j4.
@Fedik Could you click the "Update branch" button at the bottom of your PR? I'd like to see if appveyor and drone will pass this time. Thanks in advance.