Skip to content

fix(form): recognize Horde\{App}\...\FooVariable in BaseVariable::getTypeName()#45

Merged
TDannhauer merged 1 commit into
FRAMEWORK_6_0from
fix/vendor-namespaced-gettypename
Jul 3, 2026
Merged

fix(form): recognize Horde\{App}\...\FooVariable in BaseVariable::getTypeName()#45
TDannhauer merged 1 commit into
FRAMEWORK_6_0from
fix/vendor-namespaced-gettypename

Conversation

@ralflang

@ralflang ralflang commented Jul 2, 2026

Copy link
Copy Markdown
Member

Summary

BaseVariable::getTypeName() derives a variable's legacy type handle from its class namespace. Horde_Core_Ui_VarRenderer::render() uses that handle to dispatch to _renderVarInput_{typename} methods on app-provided renderers.

Before this change the derivation covered two shapes:

  • Horde\Form\V3\TextVariabletext (vendor)
  • Ingo\Form\V3\FoldersVariableingo_form_type_folders (legacy pre-PSR-4 app)

A vendor-namespaced app variable — Horde\Ingo\Form\V3\FoldersVariable, the shape that horde/form 3.1's FQCN support encourages apps to migrate to — collapsed to just folders, so the legacy renderer method _renderVarInput_ingo_form_type_folders was never dispatched and users saw "Unknown variable type" warnings on the affected screens.

getTypeName() now recognizes all three shapes:

Class Returns
Horde\Form\V3\TextVariable text
Ingo\Form\V3\FoldersVariable ingo_form_type_folders
Horde\Ingo\Form\V3\FoldersVariable ingo_form_type_folders

Detection is parts[0] === 'Horde' && parts[1] !== 'Form' → vendor-namespaced app, prefix with strtolower(parts[1]) . '_form_type_'.

Existing testGetTypeName() covers the vendor path unchanged. Two new cases in V3BaseVariableTest exercise the vendor-namespaced and legacy app paths using stub Variable classes declared in test/v3/fixtures/GetTypeNameFixtures.php (PSR-4 in test/ is mapped to Horde\Form\Test\, so the fixture file uses bracketed namespace blocks and is loaded from the existing bootstrap).

Surfaced by horde/ingo#34, which moves ingo's custom Variable classes from Ingo\Form\V3 to Horde\Ingo\Form\V3. Ingo has a local getTypeName() override in place to unblock that PR; once this ships those overrides become optional.

…TypeName()

Restores {app}_form_type_{name} mapping for vendor-namespaced app variables
so legacy Horde_Core_Ui_VarRenderer dispatch still finds the app's
_renderVarInput_* methods. Surfaced by horde/ingo#34.
@ralflang ralflang requested a review from TDannhauer July 2, 2026 19:07
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

🔍 CI Results

Overall: ❌ 6/12 lanes failed

TL;DR: ❌ Quality issues: PHPStan: 5 unique errors in 6 lanes.

Summary by PHP Version

PHP dev stable
8.0
8.1
8.2
8.3
8.4
8.5

Quality Metrics

  • PHPUnit: 434 tests (797 assertions) passed in 6 lanes ✅
  • PHPStan: 5 unique errors in 6 lanes ⚠️
  • PHP-CS-Fixer: 138 files checked, no issues ✅
❌ Failed Lanes

php8.3-dev

  • PHPStan: 7 errors found

php8.3-stable

  • PHPStan: 7 errors found

php8.4-dev

  • PHPStan: 7 errors found

php8.4-stable

  • PHPStan: 7 errors found

php8.5-dev

  • PHPStan: 7 errors found

php8.5-stable

  • PHPStan: 7 errors found

CI powered by horde-componentsView full results

@TDannhauer TDannhauer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make sense

@TDannhauer TDannhauer merged commit d860ed1 into FRAMEWORK_6_0 Jul 3, 2026
1 check failed
ralflang added a commit that referenced this pull request Jul 4, 2026
Release version 3.1.1

Merge pull request #45 from horde/fix/vendor-namespaced-gettypename
fix(form): recognize Horde\{App}\...\FooVariable in BaseVariable::getTypeName()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants