contributte / forms-multiplier

:repeat: Form multiplier & replicator for Nette Framework
https://contributte.org/packages/contributte/forms-multiplier.html
MIT License
26 stars 20 forks source link

Incompatibility with Nette Forms 3.2.3 #105

Closed Marian-Kechlibar closed 2 months ago

Marian-Kechlibar commented 2 months ago

So, yesterday David Grudl released a fix of Nette Forms 3.2.3 and changed the signature of the method setValues again, now it is:

public function setValues(array|object $values, bool $erase = false, bool $onlyDisabled = false): static

As a result, Forms Multiplier 4.0.1 fails again with Nette Forms 3.2.3.

Perhaps some coordination with David would be in place? He marked the method as internal, thus probably intending to work on it without breaking someone other's code.

jtojnar commented 2 months ago

Thank you for reporting this.

It appears to be this change: https://github.com/nette/forms/commit/e227d87d2ef42f5f9368256dd8719807a16bb49e

The method is only marked internal to discourage its use by users not familiar with its semantics. And David does not shy away from breaking BC in completely public API either, anyway. (I do not blame him, keeping BC is annoying.)

Unfortunately, since Nette does not follow semver the only option to avoid breakage is hardcoding the supported version in composer.json, which can also forbid compatible versions:

-    "nette/forms": "^3.1.12"
+    "nette/forms": "3.1.12"

I have just subscribed to nette/forms releases to be aware of such breakage earlier.

Marian-Kechlibar commented 2 months ago

You can actually live with nette/forms 3.2.2, it is only the very latest release that causes this particular problem.

jtojnar commented 2 months ago

This was fixed in 4.0.2.