Breaking changes
Core
- Kirby 4 requires at least PHP 8.1 and supports up to PHP 8.3.
- When impersonating the almighty
kirbyuser, any permission check will succeed even if permission has been disabled for regular admins. - The
twittericon, 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: trueto keep this functionality. - When thumb generation fails, the image API now throws an error and no longer loads the original image.
- Files:
manipulateis now a core method andfocusa 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$fallbackis an array and neither the array$keynor the array$fallbackhave a matching entry for the locale, the first element of the$keyarray will now be returned (not anymore the one from$fallback). If$fallbackis a string, it will be considered with priority over both of these.- If overwriting the
hiddenfield, it must return'hidden' => truenow. - Removed deprecated
DSconstant. 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'sallowHostRelativeUrlsoption tofalse. - Renamed parameter of
::group()method of all collection classes to$caseInsensitive - Errors are no longer hidden when a
Responseis 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 theLanguageclass. $languages->codes()now returns['default']for single language installations.Kirby\Panel\Assets::custom()now returns an array.Kirby\Uuid\Uuidis now an abstract class, child classes need to implement theidmethod.Kirby\Uuid\Uuid::key()can now also returnnullif the new$generateparameter isn't passed astrueand no UUID has yet been generated for the model.Kirby\Cms\ModelWithContentdoesn't extendKirby\Cms\Modelanymore.- Removed the
::clone()method fromKirby\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\StructureObjectandKirby\Cms\ContentTranslationclasses - Removed the
::hardcopy()method fromKirby\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\StructureObjectandKirby\Cms\ContentTranslationclasses - Removed
::site()method fromKirby\Cms\Plugin,Kirby\Cms\RoleandKirby\Cms\StructureObjectclasses - Removed
::kirby()method fromKirby\Cms\RoleandKirby\Cms\StructureObjectclasses - 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, notKirby\Cms\Block. new Kirby\Cms\Structure()/new Kirby\Cms\StructureObject()don't work anymore as before. UseKirby\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 newKirby\Content\PlainTextContentStorageHandlerclass instead and return an instance of your custom class from$model->storage(). Please note that the interface ofPlainTextContentStorageHandleris internal and may change in the future. - New
$isExternalargument for theKirby\Sane\Handler::sanitize()andKirby\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-signicon - The icons
circle,heartandstarare now namedcircle-filled,heart-filledandstar-filled. - Removed
this.$config.searchfrom Panel - Area
searchplugins receive two additional arguments for their query callback:$limitand$pageto be used to paginate the results. They should then return an array with entries results and pagination. #5191 <k-header>doesn't include tabs anymore by default. Use<k-tabs>separately.- 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.isLoadingis no longer available. You can now usewindow.panel.isLoadingorthis.$panel.isLoadingin Vue components to access the current loading state.this.$store.state.dialogis no longer available. Usethis.$panel.dialoginstead.- Removed
this.$store.state.drag, usewindow.panel.drag/this.$panel.draginstead. <k-button>,<k-link>,<k-headline>and<k-content-item>only emit theclickevent. For other native events, use the.nativeevent listener modifier.- Native events (e.g.
click,dbclick) need the.nativemodifier now when used on<k-block>and<k-block-title> - Need to use
.nativemodifier for all previous event listeners on<k-boxand<k-image> <k-pagination>doesn't support setting custom labels/titles vianextLabel,prevLabelorpageLabel<k-rangewas 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
- The
Kirby\Form\Options,Kirby\Form\OptionsApiandKirby\Form\OptionsQueryclasses have been removed. UseKirby\Option\Options,Kirby\Option\OptionsApiorKirby\Option\OptionsQueryinstead. - The
Kirby\Toolkit\Queryclass has been removed. UseKirby\Query\Queryinstead. - Passing the
$slotor$slotsvariables to snippets was deprecated and support has now finally been removed. - Passing an empty string as value to
Xml::attr()(deprecated in Kirby 3.9) no longer omits the attribute but generates an attribute with an empty value.