contributte / contributte/forms-wizard

Incompatible with nette/component-model v4 — Wizard throws DeprecatedException on render

Open Beginner friendly
#42 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
14
Forks
14
PR merge metrics
No merged PRs in 30d

Description

Hi,

forms-wizard 4.1.0 is incompatible with nette/component-model v4.0. In v4 the getComponents() filter/recursive arguments were removed — passing them no longer just warns, it throws Nette\DeprecatedException:

Container::getComponents() parameters removed. The method now takes no arguments and returns a plain array of immediate children (previously iterable). The old recursive flag and filter-type argument are gone — passing them throws a DeprecatedException. For recursive traversal use getComponentTree() instead.

Wizard::applyCallbacksToButtons() still calls the old signature, so any wizard throws at render time:

// src/Wizard.php:368
foreach ($form->getComponents(false, SubmitButton::class) as $control) {
https://github.com/contributte/forms-wizard/blob/37fc489f774972a899b7d154879456c27be4fe04/src/Wizard.php#L368

Composer installs v4 silently, because the only constraint is conflict: "nette/component-model": "<3.0.3" (no upper bound).

Suggested fix — call getComponents() with no arguments and filter with instanceof (works on both v3 and v4):

foreach ($form->getComponents() as $control) {
    if (!$control instanceof SubmitButton) {
        continue;
    }
    // …
}

Environment: forms-wizard 4.1.0, nette/component-model 4.0.1, PHP 8.3.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/Wizard.php around applyCallbacksToButtons() and the getComponents() call at line 368. Reproduce the render failure with PHP 8.3 and nette/component-model 4.0.1, then verify that wizard rendering works with both supported component-model versions and that SubmitButton controls still receive their callbacks.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
85/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.