🚀 A new era: Kirby 4 Get to know
Skip to content

Breaking changes

Core

  • Kirby 4 requires at least PHP 8.1 and supports up to PHP 8.3.
  • When impersonating the almighty kirby user, any permission check will succeed even if permission has been disabled for regular admins.
  • The twitter icon, KirbyTag and helper have been removed. Use the legacy plugin if you still rely on these: legacy-twitter.zip
  • We have added more native PHP type hints throughout the system. When extending core classes, this might require you to update your method to include those type hints as well.
  • Users field doesn't automatically use the current user as default, add default: true to keep this functionality.
  • When thumb generation fails, the image API now throws an error and no longer loads the original image.
  • Files: manipulate is now a core method and focus a reserved field by the core. These names are no longer available for custom file methods. Previous content fields with these names can only be accessed via e.g. $file->content()->get('manipulate').
  • I18n::translate(): If $fallback is an array and neither the array $key nor the array $fallback have a matching entry for the locale, the first element of the $key array will now be returned (not anymore the one from $fallback). If $fallback is a string, it will be considered with priority over both of these.
  • If overwriting the hidden field, it must return 'hidden' => true now.
  • Removed deprecated DS constant. Use / instead.
  • When sanitizing DOM objects (e.g. in the writer field, but not during the sanitization/validation of uploaded files), host-relative URLs that point outside the site root are now allowed as the use of the HTML <base> element is assumed for sites in a subfolder. To revert to the old, strict behavior, set Sane's allowHostRelativeUrls option to false.
  • Renamed parameter of ::group() method of all collection classes to $caseInsensitive
  • Errors are no longer hidden when a Response is converted to a string.
  • The $translations->start() and $translations->stop() methods were no longer in use and have been removed. Content files are automatically converted by the Language class.
  • $languages->codes() now returns ['default'] for single language installations.
  • Kirby\Panel\Assets::custom() now returns an array.
  • Kirby\Uuid\Uuid is now an abstract class, child classes need to implement the id method.
  • Kirby\Uuid\Uuid::key() can now also return null if the new $generate parameter isn't passed as true and no UUID has yet been generated for the model.
  • Kirby\Cms\ModelWithContent doesn't extend Kirby\Cms\Model anymore.
  • Removed the ::clone() method from Kirby\Cms\Auth\Status, Kirby\Http\Uri, Kirby\Cms\FileVersion, Kirby\Filesystem\Asset, Kirby\Filesystem\File, Kirby\Image\Image, Kirby\Cms\Plugin, Kirby\Cms\Role, Kirby\Cms\StructureObject and Kirby\Cms\ContentTranslation classes
  • Removed the ::hardcopy() method from Kirby\Api\Api, Kirby\Cms\Api,Kirby\Email\Email, Kirby\Email\Body, Kirby\Cms\Auth\Status, Kirby\Toolkit\Pagination, Kirby\Http\Uri, Kirby\Cms\FileVersion, Kirby\Filesystem\Asset, Kirby\Filesystem\File, Kirby\Image\Image, Kirby\Cms\Role, Kirby\Cms\StructureObject and Kirby\Cms\ContentTranslation classes
  • Removed ::site() method from Kirby\Cms\Plugin, Kirby\Cms\Role and Kirby\Cms\StructureObject classes
  • Removed ::kirby() method from Kirby\Cms\Role and Kirby\Cms\StructureObject classes
  • Unauthenticated API and Panel calls now return a correct 401 HTTP code instead of 403.
  • Registering a default block model now needs to be done with the key default, not Kirby\Cms\Block.
  • new Kirby\Cms\Structure()/new Kirby\Cms\StructureObject() don't work anymore as before. Use Kirby\Cms\Structure::factory()/Kirby\Cms\StructureObject::factory() instead.
  • Kirby\Cms\Items::factory() and all inheriting classes throw an exception now if malformed data is passed.
  • Extending the internal $model->contentFile(), $model->contentFiles(), $model->contentFileDirectory(), $model->contentFileExtension(), $model->contentFileName(), $model->readContent() and $model->writeContent() methods in a page model will no longer have an effect as these methods are no longer called by the core. Please extend the new Kirby\Content\PlainTextContentStorageHandler class instead and return an instance of your custom class from $model->storage(). Please note that the interface of PlainTextContentStorageHandler is internal and may change in the future.
  • New $isExternal argument for the Kirby\Sane\Handler::sanitize() and Kirby\Sane\Handler::validate() methods that custom Sane handlers need to implement; it allows to differentiate between strings from external files that may be accessed directly and strings that will end up directly on the page.

Panel

  • Blocks: Removed keyboard shortcut to move block focus up/down
  • Removed road-sign icon
  • The icons circle, heart and star are now named circle-filled, heart-filled and star-filled.
  • Removed this.$config.search from Panel
  • Area search plugins receive two additional arguments for their query callback: $limit and $page to be used to paginate the results. They should then return an array with entries results and pagination. #5191
  • Defining the footer slot in <k-dialog> will no longer wrap the slot content in the <footer> element. This can now be more flexibly handled by using <k-dialog-footer> inside the slot.
  • The form drawer no longer automatically closes on submit. This is introducing the same behaviour as in dialogs. Auto-closing might often not be the intended result of submitting the form and it's easier to close it manually in a submit handler than to re-open it again.
  • this.$store.state.isLoading is no longer available. You can now use window.panel.isLoading or this.$panel.isLoading in Vue components to access the current loading state.
  • this.$store.state.dialog is no longer available. Use this.$panel.dialog instead.
  • Removed this.$store.state.drag, use window.panel.drag/this.$panel.drag instead.
  • k-button , k-linkk-headline and k-content-item only emit the click event. For other native events, use the .native event listener modifier.
  • Native events (e.g. clickdbclick) need the .native modifier now when used on k-block and k-block-title
  • Need to use .native modifier for all previous event listeners on k-box and k-image
  • k-pagination doesn't support setting custom labels/titles via nextLabel, prevLabel or pageLabel
  • k-range was removed and replaced by k-alpha-range and k-hue-range.
  • k-choice has been removed. Use k-choice-input instead.
  • The unused theme prop has been removed from k-choice-input.

Removed deprecated code