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 andfocus
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'sallowHostRelativeUrls
option tofalse
. - 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 theLanguage
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 theid
method.Kirby\Uuid\Uuid::key()
can now also returnnull
if the new$generate
parameter isn't passed astrue
and no UUID has yet been generated for the model.Kirby\Cms\ModelWithContent
doesn't extendKirby\Cms\Model
anymore.- 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\StructureObject
andKirby\Cms\ContentTranslation
classes - 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\StructureObject
andKirby\Cms\ContentTranslation
classes - Removed
::site()
method fromKirby\Cms\Plugin
,Kirby\Cms\Role
andKirby\Cms\StructureObject
classes - Removed
::kirby()
method fromKirby\Cms\Role
andKirby\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
, 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\PlainTextContentStorageHandler
class instead and return an instance of your custom class from$model->storage()
. Please note that the interface ofPlainTextContentStorageHandler
is internal and may change in the future. - New
$isExternal
argument 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-sign
icon - The icons
circle
,heart
andstar
are now namedcircle-filled
,heart-filled
andstar-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 <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.isLoading
is no longer available. You can now usewindow.panel.isLoading
orthis.$panel.isLoading
in Vue components to access the current loading state.this.$store.state.dialog
is no longer available. Usethis.$panel.dialog
instead.- Removed
this.$store.state.drag
, usewindow.panel.drag
/this.$panel.drag
instead. <k-button>
,<k-link>
,<k-headline>
and<k-content-item>
only emit theclick
event. For other native events, use the.native
event listener modifier.- Native events (e.g.
click
,dbclick
) 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 vianextLabel
,prevLabel
orpageLabel
<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
- The
Kirby\Form\Options
,Kirby\Form\OptionsApi
andKirby\Form\OptionsQuery
classes have been removed. UseKirby\Option\Options
,Kirby\Option\OptionsApi
orKirby\Option\OptionsQuery
instead. - The
Kirby\Toolkit\Query
class has been removed. UseKirby\Query\Query
instead. - Passing the
$slot
or$slots
variables 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.