github getkirby/kirby 6.0.0-rc.2

pre-releaseone hour ago

🐛 Bug fixes

  • Deleting, renaming or moving a page, file or user from its own view no longer causes a failed unlock request in the browser console. Unlocking a model that no longer exists now succeeds silently. #8845
  • Info, gap and line fields no longer render unknown props as HTML attributes #8844
  • The update status cell in the system view's plugins table no longer renders unknown props as HTML attributes #8844
  • Range field: required, min and max errors show as soon as the field loads #8825
  • URL field: an invalid URL is marked invalid as soon as the field loads, not only after editing it #8846
  • Color field: Ctrl+S converts the typed color to the field's format, like Cmd+S and Enter #8848
  • Writer field: a minlength/maxlength error goes away when the value changes from outside, e.g. after discarding changes #8849
  • Time field previews show a value that isn't a full ISO time (e.g. 09:05) as is instead of nothing #8851
  • Blocks field: pasting into a field that already has more blocks than max adds no blocks #8850
  • Blocks field: focusing the field without a block selects the first block #8853
  • Slug field: the path preview no longer ends in undefined when the slug is empty #8855
  • Language names in the languages view can be opened in a new tab #8831
  • Files, pages and users fields remove a deleted file, page or user from their value #8834
  • Deleting a file no longer stores unchanged values of files fields #8834
  • The change status dialog no longer shows an [unknown] option when the page's status isn't defined in its blueprint #8838
  • Date field: time: { times: false } hides the times dropdown #8822
  • Stats that open a dialog or drawer are buttons now instead of links with an empty href #8831

🧹 Housekeeping

  • Move to new CS fixer rule to alphabetically sort all methods and properties #8466
  • Updated translations
  • Updated JS dependencies
  • Updated PHP dependencies

Included in earlier pre-releases, but we forgot to mention

🎉 Features

  • Page blueprints: each status can define a custom icon (icon name or emoji) and theme. They're used for the status button, pages sections and the change status dialog. #8551

    status:
      draft:
        label: Idea
        icon: 💡
      unlisted:
        label: In review
        text: Waiting for an editor
        icon: preview
        theme: purple
      listed:
        label: Published
        icon: globe
        theme: positive
    image image(1)
  • New $field->toEnum(MyEnum::class) field method converts a field value into a case of the given backed enum #8556

enum Category: string
{
	case News  = 'news';
	case Event = 'event';

	public function hasDate(): bool
	{
		return $this === self::Event;
	}
}

$category = $page->category()->toEnum(Category::class);

if ($category?->hasDate() === true) {
	// …
}

✨ Enhancements

  • <k-choice-input> has a new theme prop to colour its icon
  • New inherit argument for Kirby\Cms\Responder::redirect(), Kirby\Cms\Response::redirect(), Kirby\Http\Response::redirect(), Kirby\Http\Response::go(), Kirby\Cms\Page::go() and the go() helper. It keeps the query and params of the current request; the target's own query and params win.

🐛 Bug fixes

  • An impersonation started inside a model hook (e.g. page.update:after) no longer carries over to the rest of the request #8549
  • Query runner: &&/AND now bind tighter than ||/OR, e.g. a || b && c is a || (b && c) #8574
  • Whitespace before <?php in config or plugin files now throws an error also when output buffering is enabled, instead of breaking images #8091
  • Kirby\Toolkit\Totp now throws Kirby\Exception\InvalidArgumentException for invalid Base32 secrets in force mode instead of quietly using a wrong key #8581
  • Status icons in pages sections now show the custom status label from the blueprint in their tooltip #7043
  • Kirby\Database\Query::fail() now only affects the query it is called on. #8677
  • Kirby\Database\Database::validateTable() and Kirby\Database\Database::validateColumn() now throw the original database error when they can't load the list of tables or columns. #8677
  • Str::pool() now return always an array of strings or one string with all characters, never an array of integers #8712
  • isset($slots->heading) now returns true for defined slots in Kirby\Template\Slots
  • Kirby\Toolkit\Html::video() embeds video files whose URL mentions YouTube or Vimeo (e.g. /videos/youtube-intro.mp4) instead of returning null
  • Kirby\Toolkit\Html::gist() encodes the file name in the script URL, so names with spaces, & or # load the right file.
  • Kirby\Database\Sql::selected() no longer applies a qualified column's table (e.g. test.id) to the unqualified columns after it.
  • Kirby\Http\Uri::setFragment() and Kirby\Http\Uri::inherit() no longer drop a fragment of 0.
  • Kirby\Filesystem\F::range() returns an empty string instead of throwing an error when there is nothing to read.
  • Pasted HTML with several code blocks keeps the language of each block (Kirby\Parsley\Schema\Blocks::pre())
  • Kirby\Parsley\Element::query() and Kirby\Parsley\Element::find() return null for an invalid XPath query instead of throwing a TypeError, and Kirby\Parsley\Element::filter() returns []
  • Blocks and layout field validation errors now name the type of the invalid block, not of an earlier block of a different type.
  • Kirby\Filesystem\F::type() detects short filenames like a.js and bare extensions of any length like mdown #8728
  • Kirby\Cms\Items::factory() (blocks, layouts, structure) keeps the parent and field params for empty items. So the parent() of an empty blocks field is now the page, not the site.
  • $collection->group() groups by '0', 0 and empty strings instead of throwing an exception.
  • Fixed registered blocks methods.
  • Kirby\Cms\PageRules::changeStatusToListed() no longer throws a TypeError when called without a position.
  • Kirby\Text\KirbyTags::parse() returns the text unchanged instead of throwing a TypeError when the regex fails.
  • Languages whose locale array defines neither LC_ALL nor LC_CTYPE no longer throw an error and use the slug rules of their language code.
  • Kirby\Option\Options accepts options with a null value.
  • Kirby\Toolkit\Str::accepted() treats q=0 as the lowest quality instead of 1 #8714
  • Kirby\Toolkit\Str::slug() no longer leaves a trailing separator when the slug is cut at $maxlength #8714
  • Kirby\Toolkit\A::random() keeps integer keys when $shuffle is true #8714
  • An upload fails with an error when its sanitized file cannot be written. #8718
  • Reading a file with F::read() right after it was replaced no longer fails on certain filesystems #8719
  • Redirects to the language URL, from /home, from page UUID permalinks and from page.html now keep the query and params of the request #7603
  • Kirby\Http\Uri::toString(): params on a relative root URL no longer produce a protocol-relative //page:2 URL
  • Kirby\Http\Uri::inherit() keeps the Uri's own query, params and fragment; the parent only adds missing ones

♻️ Refactored

  • Pass an array to http_build_query() to avoid future deprecation issues in PHP 8.6 #8558
  • Simplify MemoryStorage cache id #8559

Since rc.1

🐛 Bugs/regressions fixed

  • Writer field no longer crashes when a plugin node or mark doesn't define a schema #8842
  • The Entries field no longer ignores the default value of its entry field #8824
  • Files, pages and users picker dialogs respect max: 1 again and only allow selecting a single item #8823
  • "Change URL", "Rename" and the other title/name dialogs focus and select the current value again #8840
  • Pages created without a dialog now store the same UUID that is used in their title, slug and default values #8832
  • Structure fields no longer break the Panel view for content that isn't a list of rows #8868
  • Time field: times: false hides the times dropdown again #8822

Don't miss a new kirby release

NewReleases is sending notifications on new releases.