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

Incompatibility with Nette Forms 3.2.3

Open Marian-Kechlibar opened this issue 1 year ago • 2 comments

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.

Marian-Kechlibar avatar May 06 '24 13:05 Marian-Kechlibar

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.

jtojnar avatar May 06 '24 16:05 jtojnar

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

Marian-Kechlibar avatar May 06 '24 16:05 Marian-Kechlibar

This was fixed in 4.0.2.

jtojnar avatar May 14 '24 01:05 jtojnar