forms-multiplier icon indicating copy to clipboard operation
forms-multiplier copied to clipboard

Compatibility with nette/component-model:3.1.0 (and PHP 8.4)

Open survik1 opened this issue 5 months ago • 12 comments

Hello, wanted to create a PR to fix compatibility for this new fancy BC break change from our favourite ecosystem, yet I've seen that you already fixed it but have not yet released it. Could you please say when do you plan to release new version with the fix included?

Without the fix, we are unable to migrate to PHP 8.4.

Thank you

survik1 avatar Jun 03 '25 08:06 survik1

Hi, does https://github.com/contributte/forms-multiplier/releases/tag/v4.0.1 not work? It should be compatible according to release notes, though I no longer remember the details.

Unfortunately, I do not have time for further development of forms-multiplier any more. I might still be able to review minor patches (and backports) and make releases for v4 branch but other projects have priority.

jtojnar avatar Jun 07 '25 22:06 jtojnar

This is frankly what makes me afraid of using any contributte/ packages in my projects, however beautiful they are.

At the age of almost 47, I have seen a lot of young programmers becoming middle aged programmers and abandoning their side projects, which then leaves everyone who relied on them stuck. In the worst case, the entire project must be ported to Laravel etc.,where this threat does not occur.

Maybe David Grudl could incorporate Forms Multiplier into Nette proper?

Marian-Kechlibar avatar Aug 06 '25 09:08 Marian-Kechlibar

@jtojnar Hi sorry, we postponed upgrade to 8.4 due to larger amount of incompatibilities. I will try to look at it.

@Marian-Kechlibar Hello Marian, it has been long time. I don't agree completely, the authors shouldn't be forced to work on the libraries completely on their own. The greater issue is when original author offers no cooperation, leaving even PRs completely untouched. And as this is quite common pattern within Contributte, it sadly forces us to decrease the dependency to this project whenever possible. But that does not seem to be true in the case of this particular library.

survik1 avatar Aug 06 '25 09:08 survik1

Hi @Marian-Kechlibar. Totally get it, but I don't know how to solve this situation.

@survik1 What is common pattern? Can you show me these untouched PR? There is over 200 repositories, I am doing my best.

f3l1x avatar Aug 06 '25 09:08 f3l1x

Hello @survik1 and @f3l1x , thanks for your response. I never mentioned anything about people being forced to continue against their will. I was more interested in constructive solutions. For example, if more financial contributions from users would alleviate the situation.

I can only provide some 10-15 eur per month (it wouldn't be the first project for me to support regularly and there is a certain ceiling that I cannot cross), but maybe if ten users got together and provided the same amount, it would be enough to pay for at least a few hours of necessary maintenance monthly?

Of course, not everything is about money and I don't want to make it sound so.

Marian-Kechlibar avatar Aug 06 '25 09:08 Marian-Kechlibar

@f3l1x Sure, this one https://github.com/contributte/datagrid/pull/1103

survik1 avatar Aug 06 '25 09:08 survik1

Sorry, just missed that one. Do you have more? I don't want to make conclusions on 1 missed PR.

f3l1x avatar Aug 06 '25 09:08 f3l1x

I can only provide some 10-15 eur per month (it wouldn't be the first project for me to support regularly and there is a certain ceiling that I cannot cross), but maybe if ten users got together and provided the same amount, it would be enough to pay for at least a few hours of necessary maintenance monthly?

Of course, not everything is about money and I don't want to make it sound so.

The thing is that I am not using contributte/forms-multiplier in my projects. Original author/founder https://github.com/MartkCz of this packages under name (webchemistry/forms-multiplier) has also no time for maintenance. Thus, what do you really want?

I see these options:

  1. I fix it.
  2. Other people from community fix it.
  3. You fix it.
  4. You stop using contributte/forms-multiplier and find another way how to resolve it in Nette. Just like I did using Alpine.js.
  5. ??

f3l1x avatar Aug 06 '25 10:08 f3l1x

Programming is a very specialized discipline - some things are easy to fix for an outsider, but anything deeper requires diving into the project first and learning the entire context or risking breaking things.

In general, it is much more efficient for the insiders to fix problems, as they carry the entire "institutional memory" of the project in their heads already, and the outsiders to support them by testing, providing sponsorship, easier PRs etc.

"The thing is that I am not using contributte/forms-multiplier in my projects."

This is BTW what I encountered in my projects as well. Unless I use them daily, I lose both touch and interest. Not catastrophically so, but I am definitely a lot more invested in "welfare" of code that I need to use as well.

Without being snarky, is Alpine.js better than forms-multiplier, in your experience? I never tried that. What are the advantages?

Marian-Kechlibar avatar Aug 06 '25 10:08 Marian-Kechlibar

@f3l1x That's the tough one as this was the only one I personally rage closed. And we simply moved from other libraries where we were blocked by stale state of existing PRs. But given the fact that even Datagrid has most of the PRs resolved, perhaps things changed since 2024?

survik1 avatar Aug 06 '25 10:08 survik1

I see Alpine.js great for doing in on client side and just grab data from $form->getValues() or $form->getHttpData(). Form Multiplier is a hack to nette/forms and I found easy way to not hack nette/forms internals and just use what works. :-)

f3l1x avatar Aug 06 '25 10:08 f3l1x

Form Multiplier is a hack to nette/forms and I found easy way to not hack nette/forms internals and just use what works. :-)

I don't agree.

While Nette already offers the multiplier component that also works with forms, the result is very different. With the multiplier component in a one to many relationship, at least the left side must already exist in the database. This conflics with some constraints that you may have on your entities, for example an entity/model Invoice that must have > 0 Invoice\Line. With the multiplier component you must start with an Invoice with 0 Invoice\Line in the database, breaking your constraints. The solution is JavaScript with low-level fields, but for me JavaScript is a big NO, since I only want to use phpunit/tester for testing my forms.

Form multiplier is amazing, it works simpler and even better than Symfony Form Collections (that require JavaScript, they may work without it but it's a bit complicated, Form multiplier works without JavaScript). In the accounting world there are very complex forms where the Form multiplier just provide a better usability compared to what actually offers Nette.

Of course if you have a solution to create entity/model relationships dynamically with just one form and with just Nette (and no JavaScript), I'm super ready to hear that alternative :-)

Regarding the state of Form multiplier, I think it's pretty stable and doesn't need huge maintenance (except for newer Nette versions). There are some non-vital bugs that should be taken in account.

In the past I provided some fixes, the code is not super simple (it took me some hours to understand how it works behind the scene) and I already forgot it. I guess the problem with finding a maintainer for it is due to the complexity of its code. Maybe documenting it may help future maintainers

diegosardina avatar Aug 06 '25 20:08 diegosardina