Closed Kocicak closed 8 months ago
The second commit fixes setting default values for nested multipliers.
Can you please @Kocicak add some tests? I am not aware of this problem and need to be sure it's working. :-)
Can you please @Kocicak add some tests? I am not aware of this problem and need to be sure it's working. :-)
Unfortunately not anytime soon. It is one year from this merge request.
I remember that debugging this was not easy. The main understanding is that Multiplier creates minimum copies only if form is not submitted (condition on line 260). But this is not entirely true for nested multipliers if top-level one has 0 minimum and nested one has 1 minimum copy. When creating first copy of top-level multiplier, it assumes form is submitted (because it is) and because of that condition on line 260, nested multiplier does not create minimum copies.
We are using forked multipler successfully for a year now and it is working fine, also with default values. That is all I can say about this, but I understand that test should be needed. When I get to it, I will write them, but it may take another year :)
No problem. Do it right takes time. :-) If you need my help, just let me know.
This BUG is still in package. And this fix helped. Problem is when nested multiplier have > 0 min copies and root has min = 0. On adding new root multiplier then nested is not created with min copies.
Firstly tested on v3.2.0 then tryied with some changes on 3.3.1 still working correctly.
Hi @Stancek, thank you for confirming that this pull request works.
If you would like to write tests so @f3l1x can merge this pull request to the original package, it would be really apprecieted. But I understand if not, we can always use our forks.
Hey @Kocicak and @Stancek. Can you please rebase this PR? I tried a lot but I still failing. After that I will merge it without tests.
Hi, I have rebased source branch (bugfix/...). It was indeed not easy, there were many changes and code refactoring, but I think I got it all. After some testing everything seems to be working (PHP 8.1 / Latte 3).
I don't know about unit tests, if they pass or not.
Thank you.
Hello, there is a problem with nested multipliers, if the top-one has minCopies=0 and the nested one has minCopies>0. Then it will not create any copies, because form has been submitted (condition on line 260). With this, there is also a bug - when removing copies, counter is not decreased.
With this two changes, nested multipliers with minimum copies does work.