Skip to content

Kirby 6 support - #277

Open
afbora wants to merge 7 commits into
mzur:masterfrom
afbora:v6
Open

afbora wants to merge 7 commits into
mzur:masterfrom
afbora:v6

Conversation

@afbora

@afbora afbora commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Kirby 6 support

Closes #276

This makes Uniform work with Kirby 6 (tested with 6.0.0-beta.2). As discussed in the comments, it drops support for Kirby 3 to 5, so the code needs no version checks. Uniform v5 stays the version for Kirby 3 to 5.

Changes

Email templates (uniform-default, uniform-table)

Kirby 6 renders templates through Snippet::load() (getkirby/kirby#7599), which adds $slot, $slots and the global template data to the template scope. The bundled email templates loop over the whole $data array and failed with Object of class Kirby\Template\Slots could not be converted to string. They now loop over $_data, which Uniform already passes to email templates. The email output is the same as before.

Missing email preset

Kirby 6 no longer accepts an array as the only argument of its exceptions (getkirby/kirby#8459), so a missing preset threw a TypeError instead of the NotFoundException. The exception is now created with named arguments.

SessionStoreAction

Kirby 6 no longer unserializes objects from the session (getkirby/kirby#8169). The stored Uniform\Form came back as __PHP_Incomplete_Class in the next request, so the documented kirby()->session()->get('user-form')->data('email') failed. The action now stores the form data as an array ($form->data(), HTML-escaped as before):

<?php if ($data = kirby()->session()->get('user-form')): ?>
    Thank you <?php echo $data['email']; ?> for subscribing.
<?php endif; ?>

Kirby 6 only

  • composer.json requires PHP 8.3 or newer, sets extra.kirby.compatible to ^6.0 and uses getkirby/cms: ^6.0@beta for the tests.
  • The Str::template fallback for Kirby 3.5 is removed.
  • The CI workflow runs with Kirby 6 on PHP 8.3, 8.4 and 8.5. This also fixes the current CI failure, because Composer no longer installs Kirby 3 and 5.0.0-rc.1 due to security advisories.

Docs

  • New upgrade guide from v5 to v6: the session store change, $_data in custom email templates and the reserved slot/slots field names.
  • The email action docs mention that form fields named slot or slots can't be used with email templates.
  • The session store docs show the array usage.
  • The README badge and text say Kirby 6.

Testing

I ran the steps of the CI workflow locally (composer validate --strict, fresh composer install, composer require -w getkirby/cms:^6.0@beta, PHPUnit) with Kirby 6.0.0-beta.2 on PHP 8.3, 8.4 and 8.5. All 85 tests pass. Before this PR, 3 of them failed on Kirby 6.

I also tested a page with several forms on Kirby 6.0.0-beta.2: rendering, validation errors, old input, CSRF and honeypot guards, calc guard, the email action (default body, subject template, receive copy, both bundled templates, missing preset), the log action (plain and uniform/log-json), the webhook action against a local route, the upload action (random prefix, MIME and required rules) and the session store action in the next request. Emails were captured locally and not sent. The login action is covered by the unit tests only.

Notes

  • I didn't change the plugin version.

Please give it a final review and test it with your own setup before merging. Happy to adjust anything.

@mzur

mzur commented Nov 2, 2026

Copy link
Copy Markdown
Owner

I'd be fine with releasing a new major version of this extension and dropping support for Kirby <6 (along with older PHP versions). Then we don't need different code branches for different Kirby versions. What do you think?

@afbora

afbora commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

@mzur Sounds good. Kirby 6 has many breaking changes, so supporting all versions at once would only add more version checks. Matching the major versions keeps it simple: Uniform v5 for Kirby 3 to 5, v6 for Kirby 6 and v7 for Kirby 7.

If that works for you too, I'll:

  • Remove the version checks
  • Require PHP 8.3+
  • Set extra.kirby.compatible to ^6.0
  • Run CI with Kirby 6 only (this also fixes the current failure)
  • Add a short v5 to v6 upgrade guide to the docs
  • Add a compatibility table to the README

If you want to keep fixing bugs for Kirby 3 to 5, you could create a v5 branch from the current master first.

@mzur

mzur commented Nov 2, 2026

Copy link
Copy Markdown
Owner

Please go ahead but skip the compatibility table in the readme. Instead, post it here and I will put it into the release notes.

@afbora

afbora commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

@mzur Ready to review

Here is the compatibility table for the release notes:

Uniform Kirby
v6 6
v5 3, 4 (since v5.5.0), 5 (since v5.6.2)
v4 3
v3 and older 2

Uniform v6 requires PHP 8.3 or newer.

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.

Kirby 6 support

2 participants