Breaking changes
Kirby 6
Breaking
Core
General
- Removed support for PHP 8.2. Use PHP 8.3, 8.4 or 8.5 instead. #7372
- Changed the default YAML handler to Symfony YAML which sometimes enforces a stricter syntax than our previous Spyc handler. You can switch back to Spyc with the config option
'yaml.handler' => 'spyc'#7530 - New global helper functions
push(),endpush()andstack()can collide with functions of the same name in your code #7867 - Template data must not include variables named
$slotor$slots. #7599 videoKirbyTag: Removedstyleoption to protect against style injections. If you need to define a customstyleattribute, please extend as a custom KirbyTag. Thanks to Peter Levashov (@petersevera) for his responsible disclosure and suggestion.- Custom validators cannot overwrite default validators from the
Kirby\Toolkit\Vclass any longer. #7674 - Removed
Kirby\Cms\Apiclass. UseKirby\Api\Apiclass instead. #7532 - Removed
Kirby\Cms\System::php()#7816 Kirby\Cms\App::models()andKirby\Uuid\Uuid::index()generators are now keyed by idKirby\Cms\LazyCollection::getIterator()skips items that failed hydrationKirby\Cms\FieldsextendsKirby\Cms\CollectionandKirby\Cms\HasSiblingsrelies onKirby\Cms\Collection, notKirby\Toolkit\CollectionKirby\Cms\Fieldset::name()falls back to a labelized type- Added abstract
Kirby\Cms\ModelWithContent::apiUrl()method Kirby\Data\Txt::encodeValue()encodestrueandfalseas'true'and'false'instead of'1'and'0', and an empty array as empty string instead of[]Kirby\Http\VolatileHeaders::append()requires an array as third parameterKirby\Toolkit\Str::float()returnsnullinstead of'0'for non-numeric values (includingnulland''). UseKirby\Toolkit\Str::float($value) ?? '0'if you relied on the old behavior. #8534- Removed
command,keygenandparamfromKirby\Toolkit\Html::$voidList, as they are obsolete and no longer part of the WHATWG list of void elements.Kirby\Toolkit\Html::isVoid()returnsfalsefor them andKirby\Toolkit\Html::tag()no longer renders them self-closing. #8286 qr()helper only accepts a site, page or file object or a URL string as parameter.Kirby\Cms\Language::isLast()checks the language's position in the languages collection, likeisLast()for other models. Use the newKirby\Cms\Language::isLastLanguage()to check if it is the only remaining language. #8582
Cookies & HTTP
- Cookies are signed with HMAC-SHA256 instead of HMAC-SHA1. Cookies signed by earlier versions, including the session cookie, are no longer accepted: users need to log in again after the upgrade. #8561
Kirby\Http\Cookie::set()sets thesecureoption totrueon HTTPS requests by default. Pass'secure' => falseif a cookie set on an HTTPS page must also be readable on plain HTTP pages:Cookie::set('name', 'value', ['secure' => false])#8560- The
$prettyargument ofKirby\Http\Response::json()must be abool. Passfalseinstead ofnull. #8562
MIME types
Kirby\Filesystem\Mime::fromExtension() and Kirby\Filesystem\Mime::type() return the registered IANA type for these extensions now (e.g. RFC 6713 for gzip, RFC 9239 for JavaScript, RFC 7303 for XML). #8284
| Extension | Before | Now |
|---|---|---|
exe |
application/octet-stream |
application/vnd.microsoft.portable-executable |
gz, gzip |
application/x-gzip |
application/gzip |
js |
application/javascript |
text/javascript |
ppt |
application/powerpoint |
application/vnd.ms-powerpoint |
psd |
application/x-photoshop |
image/vnd.adobe.photoshop |
tgz |
application/x-tar |
application/gzip |
wbxml |
application/wbxml |
application/vnd.wap.wbxml |
xl, xls |
application/excel |
application/vnd.ms-excel |
xml |
text/xml |
application/xml |
xsl |
text/xml |
application/xslt+xml |
zip |
application/x-zip |
application/zip |
Kirby\Filesystem\Mime::toExtension() returns different results for MIME types whose secondary mapping was removed:
| MIME type | Before | Now |
|---|---|---|
application/x-gzip-compressed |
tgz |
false |
application/octet-stream |
csv |
exe |
Field methods
- Calling non-existing field methods throws a
Kirby\Exception\BadMethodCallException. #7082 - Removed
Kirby\Content\Field::$aliases,Kirby\Cms\Core::fieldMethods()andKirby\Cms\Core::fieldMethodsAliases(). #7082
UUIDs
Kirby\Uuid\Uuid::for()does not resolve any permalinks anymore. UseKirby\Uuid\Permalink::from()instead. #7545Kirby\Uuid\Uuid::for()cannot be called any longer with a string. UseKirby\Uuid\Uuid::from(string $uuid)orKirby\Uuid\Permalink::from(string $permalink)instead. #7544- Removed deprecated
Kirby\Uuid\Uuid::url(). UseKirby\Uuid\Uuid::toPermalink()instead.
Queries
- Removed the legacy query runner. If your config sets
query.runnertolegacy, remove that option. Queries always use the AST-basedKirby\Query\Runners\DefaultRunnernow. #7791 #8554 - Removed
Kirby\Query\Argument,Kirby\Query\Arguments,Kirby\Query\Expression,Kirby\Query\SegmentandKirby\Query\Segments. UseKirby\Query\Query::resolve()or a customKirby\Query\Runners\Runnerinstead. #8554 Kirby\Query\Visitors\Visitor: required methods are abstract now and get enforced when extending the class.Kirby\Query\Visitors\Visitor::coalescence(),Kirby\Query\Visitors\Visitor::logical()andKirby\Query\Visitors\Visitor::ternary()receive the right operand/branches asClosure. #8576
Sessions
- Merged
Kirby\Session\AutoSessionintoKirby\Session\Sessions#8248 Kirby\Session\Sessions::get()no longer accepts a$token. UseKirby\Session\Sessions::find()instead. #8248new Kirby\Session\Sessions()no longer accepts an$optionsargument. UseKirby\Session\Sessions::factory()instead. #8248Kirby\Session\Sessionno longer serializes objects
Exceptions
- Passing a single array argument to
Kirby\Exception\Exceptionis no longer supported. Use named arguments instead. The string shorthandnew Exception('Some message')is unchanged. #8459 - Removed
Kirby\Exception\Exception::isTranslated()#8459
Permissions
- Several i18n error keys and strings have changed #8364
Kirby\Cms\Permissions::for()allowsnullas default #8369- Removed
Kirby\Cms\ModelPermissions::canFromCache(). Use$model->guards()->isAvailable()instead. #8481
Forms
Custom fields
- Custom fields can no longer be defined as arrays. Create a class based on
Kirby\Form\Field(or one of theKirby\Form\Field\*classes) and register it by its class name. To extend a core field, extend its class (e.g.Kirby\Form\Field\TextField). #8395 #8396 - Removed
Kirby\Form\FieldClassand thelegacy-*fields.Kirby\Form\Fieldhas been fully rewritten as base class for all fields. It has a newKirby\Form\Field::id()method and implementsStringable. #8395 #8399 - Removed the
Kirby\Form\Mixin\Valuemixin in favor of the newKirby\Form\Field\ValueFieldbase class. Custom fields with a value must extendKirby\Form\Field\ValueField(orKirby\Form\Field\InputField), as the now finalKirby\Form\Field::hasValue()checks for it. The deprecatedKirby\Form\Mixin\Value::data()andKirby\Form\Mixin\Value::save()methods are replaced byKirby\Form\Field\ValueField::toStoredValue()andKirby\Form\Field::hasValue(). #8400 #8401 - Fields with subfields must implement the new
Kirby\Form\Interface\ProvidesNestedForminterface to be found by nested lookups likeKirby\Form\Fields::findByKeyRecursive('parent+child')#8401 - Field options are no longer constructor parameters. Declare each option as a property with the
#[Kirby\Reflection\Attributes\Prop]attribute instead. A custom constructor must accept all other options asmixed ...$argsand pass them on toparent::__construct(...$args), otherwiseKirby\Form\Field::resolve()throws an exception. #8492 #8616 #8620 Kirby\Form\Field::factory()has been removed. Create fields withnew, e.g. with the class fromKirby\Form\Field::resolve($type):new $class(...$props)#8620- Field props are stored as passed: all setters of field classes and mixins have been removed (set the properties directly), and defaults, translations (
after,before,empty,help,label,placeholder) and the lower-casing of the name are applied in the getters instead. This keeps the originally passed values accessible and reduces the work done on instantiation. - The model and siblings of a field are passed to the constructor as
modelandsiblingsarguments and can't be changed afterwards. There are nosetModel()andsetSiblings()methods. An initial value can be passed asvalueargument and is filled after all other props are set. #8620 #8621 files,pagesandusersare no longer registered field types. They still work in blueprints and are mapped tofilepicker,pagepickeranduserpicker. Code that looks up a field class inKirby\Form\Field::$typesmust use the new names. #8622- Fields define their API routes in
Kirby\Form\Field::api(), not in aroutes()method - Removed
Kirby\Cms\Picker,Kirby\Cms\PagePicker,Kirby\Cms\FilePickerandKirby\Cms\UserPicker. UseKirby\Panel\Controller\Dialog\ModelPickerDialogController,Kirby\Panel\Controller\Dialog\PagePickerDialogController,Kirby\Panel\Controller\Dialog\FilePickerDialogControllerandKirby\Panel\Controller\Dialog\UserPickerDialogControllerinstead. #8395
Form class
- Removed deprecated
Kirby\Form\Formmethods #8400 Kirby\Form\Form::for()andnew Kirby\Form\Form()require named arguments. A$propsarray is no longer accepted. #8400Kirby\Form\Fields::validate()andKirby\Form\Form::validate()throw the more specificKirby\Exception\FormValidationException. #7769
Field behavior
-
The
checkboxes,color,multiselect,radio,select,tagsandtogglesfields no longer remove invalid values on submit or fill, but use the option validator to warn about them. This is in line with other input fields and has massive performance benefits. It also means that you can deliberately store a non-existing option if you skip validation. -
The
apiandqueryoptions of these fields are no longer available. Queries and API calls to fetch options have to be declared directly in theoptionsproperty:fields: myRadio: type: radio options: type: query query: some.query myOtherRadio: type: radio options: type: api url: /some/options/api -
Kirby\Form\Field\NumberField::toNumber()andKirby\Form\Field\RangeField::toNumber()returnnullinstead of an empty string for empty values -
The text field no longer sets the
spellcheckattribute by default -
The
filepicker,pagepickeranduserpickerfields only exchange UUIDs/IDs with the backend and their picker dialog, instead of full item objects with display data
Blueprints
- Removed blueprint presets (
preset: page,preset: pages,preset: files). Define the layout directly with fields likepagelistandfilelistinstead. #8386 Kirby\Blueprint\Blueprint::factory()requires the$modelas first argument. Some blueprint props are translated lazily, so preferKirby\Blueprint\Blueprint::factory()overKirby\Blueprint\Blueprint::load().Kirby\Blueprint\Blueprint::tab()returns aKirby\Blueprint\Tabobject andKirby\Blueprint\Blueprint::tabs()returns aKirby\Blueprint\Tabscollection. The normalized tabs no longer contain their link, which is built by theKirby\Blueprint\Tabclass instead. #8449- The
$inSectionargument ofKirby\Blueprint\AcceptRules::fileTemplates(),Kirby\Blueprint\Blueprint::acceptedFileTemplates()andKirby\Cms\File::blueprints()has been renamed to$inField#8406 - Removed the
Kirby\Blueprint\Blueprint::$fileTemplatesproperty and the protected methodsKirby\Blueprint\Blueprint::acceptedFileTemplatesFromFields(),Kirby\Blueprint\Blueprint::acceptedFileTemplatesFromFieldsets()andKirby\Blueprint\Blueprint::acceptedFileTemplatesFromFieldUploads()#7829
Changed return types
| Before | Now | |
|---|---|---|
Kirby\Http\Request::domain() |
string | string|null |
Kirby\Image\Exif::parseTimestamp() |
string | string|null |
Kirby\Cms\Site::modified() |
int|string | int|string|false |
Kirby\Filesystem\Dir::modified() |
int|string | int|string|false |
Kirby\Filesystem\File::realpath() |
string | string|false |
Kirby\Toolkit\V::value() |
bool|array | true|array |
Kirby\Cms\LicenseStatus::info() |
string | HtmlString |
Kirby\Form\Mixin\Help::help() |
string|null | HtmlString|null |
Kirby\Form\Mixin\Text::text() |
string|null | HtmlString|null |
Kirby\Form\Field\ToggleField::text() |
array|string|null | array|HtmlString|null |
Kirby\Panel\Ui\Item::text() |
string | string|HtmlString |
Kirby\Panel\Ui\Item::info() |
string|null | string|HtmlString|null |
Kirby\Panel\Ui\Item\ModelItem::text() |
string | HtmlString |
Kirby\Panel\Ui\Item\ModelItem::info() |
string|null | HtmlString|null |
Kirby\Panel\Lab\Doc::kt() |
string | HtmlString |
Kirby\Toolkit\HasI18n::i18n() |
string|null | string|HtmlString|null |
HtmlString refers to Kirby\Toolkit\HtmlString #8344. Cast it with (string) if you need the raw string, and compare arrays that contain it with ==/assertEquals() instead of ===/assertSame(). The array returned by Kirby\Form\Field\ToggleField::text() contains Kirby\Toolkit\HtmlString entries, and Kirby\Toolkit\HasI18n::i18n() passes a Kirby\Toolkit\HtmlString $key through unchanged.
Changed exceptions
| Case | Before | Now |
|---|---|---|
| Actions that are impossible for everyone | Kirby\Exception\PermissionException |
Kirby\Exception\AbilityException (new) |
| Deleting an avatar that does not exist | Kirby\Exception\NotFoundException |
Kirby\Exception\AbilityException |
| Changing a file or page to an invalid template | Kirby\Exception\LogicException |
Kirby\Exception\InvalidArgumentException |
Kirby\Cms\App::resolve() when the home page is missing, which indicates a broken installation |
Kirby\Exception\NotFoundException |
Kirby\Exception\LogicException |
Methods that newly throw
| Before | Now | |
|---|---|---|
Kirby\Toolkit\Dom::query() |
returns false |
throws if query invalid |
Kirby\Cache\Value::toJson() |
throws for invalid JSON | |
Kirby\Data\Json::encode() |
throws for invalid JSON | |
Kirby\Filesystem\File::toJson() |
throws for invalid JSON | |
Kirby\Http\Uri::toJson() |
throws for invalid JSON | |
Kirby\Toolkit\Collection::toJson() |
throws for invalid JSON | |
Kirby\Toolkit\Obj::toJson() |
throws for invalid JSON | |
Kirby\Filesystem\File::sha1() |
returns false |
throws on missing file |
Kirby\Content\Version::contentFile() |
throws when called with a storage other than Kirby\Content\PlainTextStorage |
|
Kirby\Filesystem\Dir::realpath() |
throws when $dir itself is passed as $in |
Sections
Sections have been replaced by fields (see "Sections become fields" above). Blueprints with fields, files, info, pages and stats sections keep working, as they are converted to fields automatically. Everything else around sections has been removed. #8449
- Any other section type, including custom sections from plugins, is no longer supported in blueprints
- Removed the
sectionsplugin extension, along withKirby\Cms\App::extendSections(),Kirby\Cms\Core::sections(),Kirby\Cms\Core::sectionMixins(),Kirby\Cms\Loader::sections()andKirby\Cms\Loader::section() - Removed
Kirby\Blueprint\Section, theKirby\Cms\Sectionalias,Kirby\Blueprint\Blueprint::section(),Kirby\Blueprint\Blueprint::sections()andKirby\Api\Api::sectionApi() - Removed all
…/sections/(:any)and…/sections/(:any)/(:all?)API routes for the site, pages, users and their files - Removed all section dialog and drawer routes and their Panel controller classes
- The blueprints API endpoints (
/api/site/blueprints,/api/pages/(:any)/blueprintsand/api/users/(:any)/blueprints) accept afieldquery parameter instead ofsection. Thesectionargument ofpanel.api.pages.blueprints()andpanel.api.users.blueprints()has been renamed tofieldas well. - Removed components:
<k-sections>,<k-fields-section>,<k-files-section>,<k-info-section>,<k-models-section>,<k-pages-section>and<k-stats-section>, as well as thek-section-fieldadapter and thesectionplugin mixin. Use<k-model-form>instead of<k-sections>and<k-fields-section>. - The
endpointsobject of field components no longer contains asectionendpoint - The
section.loadedevent has been replaced byfield.loaded, emitted bypagelistandfilelistfields #8415 - Renamed i18n keys
error.section.files.*→error.field.filelist.*error.section.pages.*→error.field.pagelist.*error.page.move.noSections→error.page.move.noBlueprints
- Removed i18n keys:
error.section.notLoaded,error.section.type.invalid
Panel
General
- The Panel needs Chrome 124, Edge 124, Firefox 125, Safari 17.5 or newer, i.e. browsers released from roughly mid-2024 onwards. Kirby follows Baseline "widely available": we only rely on web platform features that have been in every major browser for at least 30 months. #8450
panel.faviconoption: Usehrefinstead ofurlattribute. Userelattribute instead of passing string as key.- Color field options
text => valuenotation has been removed. Please rewrite your options asvalue => text. #7534 media/plugins/index.cssandmedia/plugins/index.jsno longer exist. Each plugin's files are served atmedia/plugins/{vendor}/{name}.{hash}.cssandmedia/plugins/{vendor}/{name}.{hash}.jsinstead. #8603
Frontend
-
All plugins that have compiled their Vue Single File Components with Vue 2 have to recompile their SFC for Vue 3 to work with Kirby 6. Consider also the Vue 3 migration guide.
-
All plugin JS files get loaded as module. Plugin scripts no longer share one scope, so a plugin can't read another plugin's top-level variables. Put shared values on
windowexplicitly. #8603 -
The icon sprite is no longer part of the Panel document. Custom icons registered by plugins keep working, but markup that references the sprite by hand (
<use xlink:href="#icon-…">) needs the sprite's URL now:window.panel.urls.icons + "#icon-edit"#8445 -
The Panel no longer sets a
data-overlayattribute. Use:has(.k-overlay[open])instead. #8343 -
Renamed components
<k-dropdown-content>→<k-dropdown>. Thealignprop has been removed. Usealign-xinstead. #7535<k-fiber-dialog>→<k-state-dialog><k-fiber-drawer>→<k-state-drawer>
-
Removed deprecated components
<k-bubble>,<k-bubbles>and<k-bubbles-field-preview>. Use<k-tag>,<k-tags>and<k-tags-field-preview>instead. #7533<k-settings-view-button>and<k-status-view-button>
-
Changes in components
- Radio input does not support the
resetoption anymore. Use the toggles input instead. #7385 <k-panel-menu>requires its props to be passed explicitly instead of using$panel.menuitself. #7381- Removed deprecated
modelprop from model views. Use the top-level props instead. #7463 <k-collection>and<k-items>:@selectevents pass an array of selected IDs, not a single item object #7516<k-structure-drawer>:prev/nextneed a boolean as value, not an object anymore #7790<k-item>:textandinfoare escaped unless they are trusted HTML. Plugins that pass pre-escaped or raw HTML strings will see the markup as visible characters. Wrap the value with$h()(frontend) or in aKirby\Toolkit\HtmlString/$model->toSafeHtmlString()(backend). #8344<k-tags>/<k-picklist-input>: an optiontextis only rendered as HTML if it is trusted HTML. Plain strings are escaped, and the search highlighting escapes untrusted text before adding its<b>marker. #8344<k-box>: thehtmlslot binding has been removed.<slot v-bind="{ text, html }">is now<slot v-bind="{ text }">, wheretextis the resolved (possibly trusted) content. #8344<k-models-field-preview>: thehtmlprop no longer defaults totrue. Model items already carry trusted HTML, so the raw rendering is preserved without the flag. #8344<k-installation-view>: the DOM has been fully restructured #7876<k-progress>: the<progress>element is now wrapped in a<label>#8330- The
filepicker,pagepickeranduserpickerfields use their full name in CSS classes:.k-filepicker-field,.k-pagepicker-field,.k-userpicker-field image,galleryandvideoblock previews receive the file UUID instead of full file item data
- Radio input does not support the
-
View changes
-
Request changes: the term “Fiber” is gone for backend requests
- The
window.fiberglobal has been replaced withwindow.panelState - The
X-Fibernamespace in request headers has been replaced withX-Panel - Keys aren't prefixed with
$anymore in request responses. Use without prefix. This also affects Panel plugins reloading the Panel by defining only specific keys to be reloaded. #7365
- The
-
Helpers
- Removed
$helper.isVueComponent()#7518 - Removed
$helper.link.preview(). Use<k-pages-field-preview>or<k-files-field-preview>to render a model preview, or$helper.items("items/pages", id)/$helper.items("items/files", id)if you need the raw data. #7725 #8341 $helper.string.sanitizeHTML()is asynchronous now #8342- Removed
$library.dayjs.merge()
- Removed
-
Removed deprecated
panel.dialog.openComponent()method #7518 -
panel.notification.error()no longer resolves nested errors in the state. Always throw Exceptions instead to create first-level error responses. #7782 -
Removed deprecated v3 CSS properties #7825:
| Removed | Use instead |
|---|---|
--color-backdrop |
--overlay-color-back |
--color-background |
--panel-color-back |
--color-gray |
--color-gray-600 |
--color-red |
--color-red-600 |
--color-orange |
--color-orange-600 |
--color-yellow |
--color-yellow-600 |
--color-green |
--color-green-600 |
--color-aqua |
--color-aqua-600 |
--color-blue |
--color-blue-600 |
--color-purple |
--color-purple-600 |
--color-focus-light |
--color-focus |
--color-focus-outline |
--color-focus |
--color-negative |
--color-red-700 |
--color-negative-light |
--color-red-500 |
--color-negative-outline |
--color-red-900 |
--color-notice |
--color-orange-700 |
--color-notice-light |
--color-orange-500 |
--color-positive |
--color-green-700 |
--color-positive-light |
--color-green-500 |
--color-positive-outline |
--color-green-900 |
--color-text-light |
--color-text-dimmed |
--text-base |
--text-md |
--font-size-tiny |
--text-xs |
--font-size-small |
--text-sm |
--font-size-medium |
--text-md |
--font-size-large |
--text-xl |
--font-size-huge |
--text-2xl |
--font-size-monster |
--text-3xl |
--shadow-dropdown |
--shadow-lg |
--shadow-item |
--shadow-sm |
--box-shadow-dropdown |
--shadow-lg |
--box-shadow-item |
--shadow |
--box-shadow-focus |
--shadow-xl |
--shadow-outline |
outline: var(--outline) |
--shadow-inset |
inset 0 2px 4px 0 rgba(0, 0, 0, 0.06) |
--shadow-sticky |
rgba(0, 0, 0, 0.05) 0 2px 5px |
--spacing-px |
1px |
--spacing-2px |
2px |
--spacing-5 |
1.25rem |
--spacing-10 |
2.5rem |
--spacing-20 |
5rem |
Backend
Moved and replaced classes and methods:
| Before | Now |
|---|---|
Kirby\Panel\ChangesDialog |
Kirby\Panel\Controller\Dialog\ChangesDialogController |
Kirby\Panel\PageCreateDialog |
Kirby\Panel\Controller\Dialog\PageCreateDialogController |
Kirby\Panel\View |
Kirby\Panel\Response\ViewResponse (most of its functionality) |
Kirby\Panel\Document |
Kirby\Panel\Response\ViewDocumentResponse (most of its functionality) |
Kirby\Panel\Dialog |
Kirby\Panel\Response\DialogResponse |
Kirby\Panel\Drawer |
Kirby\Panel\Response\DrawerResponse |
Kirby\Panel\Dropdown |
Kirby\Panel\Response\DropdownResponse |
Kirby\Panel\Json |
Kirby\Panel\Response\JsonResponse |
Kirby\Panel\Request |
Kirby\Panel\Response\RequestResponse |
Kirby\Panel\Search |
Kirby\Panel\Response\SearchResponse |
Kirby\Panel\View::apply(), Kirby\Panel\View::applyGlobals(), Kirby\Panel\View::applyOnly(), Kirby\Panel\View::data(), Kirby\Panel\View::globals(), Kirby\Panel\View::searches() |
Kirby\Panel\State |
Kirby\Panel\Controller\Search |
Kirby\Panel\Controller\Search\FilesSearchController, Kirby\Panel\Controller\Search\ModelsSearchController, Kirby\Panel\Controller\Search\PagesSearchController or Kirby\Panel\Controller\Search\UsersSearchController |
Kirby\Panel\Controller\PageTree |
Kirby\Panel\Controller\Request\PageTreeRequestController or Kirby\Panel\Controller\Request\PageTreeParentsRequestController |
Kirby\Panel\Field::dialog() |
Kirby\Panel\Controller\Dialog\FieldDialogController |
Kirby\Panel\Field::drawer() |
Kirby\Panel\Controller\Drawer\FieldDrawerController |
Kirby\Panel\Ui\Buttons\* |
Kirby\Panel\Ui\Button\* |
Kirby\Panel\Ui\FilePreviews\* |
Kirby\Panel\Ui\FilePreview\* |
Kirby\Panel\Ui\Buttons\LanguagesDropdown |
Kirby\Panel\Ui\Button\LanguagesButton |
Kirby\Panel\Ui\Buttons\LanguagesDropdown::option(), Kirby\Panel\Ui\Buttons\LanguagesDropdown::options() |
Kirby\Panel\Controller\Dropdown\LanguagesDropdownController |
Kirby\Panel\Home::isPanelUrl() |
Kirby\Panel\Panel::isPanelUrl() |
Kirby\Panel\Home::panelPath() |
Kirby\Panel\Panel::path() |
Kirby\Panel\Panel::area() |
Kirby\Panel\Areas::area() |
Kirby\Panel\Panel::buttons() |
Kirby\Panel\Areas::buttons() |
Kirby\Panel\Panel::firewall(), Kirby\Panel\Panel::hasAccess() |
Kirby\Panel\Panel::access()->area() |
Kirby\Panel\Panel::isFiberRequest() |
Kirby\Panel\Panel::isStateRequest() |
Kirby\Panel\Panel::routesForViews() |
Kirby\Panel\Routes\ViewRoutes |
Kirby\Panel\Panel::routesForSearches() |
Kirby\Panel\Routes\SearchRoutes |
Kirby\Panel\Panel::routesForDialogs() |
Kirby\Panel\Routes\DialogRoutes |
Kirby\Panel\Panel::routesForDrawers() |
Kirby\Panel\Routes\DrawerRoutes |
Kirby\Panel\Panel::routesForDropdowns() |
Kirby\Panel\Routes\DropdownRoutes |
Kirby\Panel\Panel::routesForRequests() |
Kirby\Panel\Routes\RequestRoutes |
- Removed methods
Kirby\Panel\Model::isDisabledDropdownOption()#7425Kirby\Panel\Model::toPrevNextLink()and the deprecatedKirby\Panel\Model::content()(also onKirby\Panel\Site,Kirby\Panel\Page,Kirby\Panel\FileandKirby\Panel\User) #7480fileResponse()/toFiles(),pageResponse()/toPages()anduserResponse()/toUsers()of the formerfiles,pagesandusersfield definitions. UseKirby\Form\Field\ModelPickerField::toItem()andKirby\Form\Field\ModelPickerField::toFormValue()instead. #7528Kirby\Panel\Plugins::url(). UseKirby\Panel\Plugins::css()for the plugin stylesheet URLs andKirby\Panel\Plugins::js()for the plugin script URLs. #8603Kirby\Panel\Plugins::files(),Kirby\Panel\Plugins::modified(),Kirby\Panel\Plugins::read()and theKirby\Panel\Plugins::$filesproperty. The newKirby\Panel\Plugins::resolve()serves each plugin's stylesheet and script on its own. #8603
- Changed methods
Kirby\Panel\Controller\Dialog\PageCreateDialogControlleris initiated with a parent model (page/site) and the available blueprints #7466 #8449Kirby\Panel\PanelandKirby\Panel\Homeand their methods are non-static. Instead ofKirby\Panel\Panel::router($path), use$panel->router()?->call($path). #7394 #7407 #7409Kirby\Panel\Panel::areas()returns aKirby\Panel\Areascollection ofKirby\Panel\Areaobjects instead of an array. TheKirby\Panel\Menuclass has been rewritten to use them. #7391 #7406- The argument of the
Kirby\Panel\Ui\Button\ViewButtonsconstructor has changed #7462 Kirby\Panel\Ui\Button\ViewButtons::view()accepts aKirby\Panel\Controller\View\ModelViewControlleras$viewargument, instead of aKirby\Panel\Model#7480Kirby\Panel\Ui\Button\VersionsButton::__construct(): the$versionIdparameter has been renamed to$mode#7548Kirby\Panel\Assets::icons()returns the URL of the icon sprite instead of its markup #8445
- Registering field dialogs or drawers without a closure throws an exception #7512
Auth
- Custom auth challenges must be rewritten based on the redesigned
Kirby\Auth\Challengeclass (instead ofKirby\Cms\Auth\Challenge) #8044 Kirby\Auth\StatusreplacesKirby\Cms\Auth\Statuseverywhere, e.g. as return value of$auth->status().Kirby\Cms\Auth\Status::is()andKirby\Cms\Auth\Status::clone()have no equivalent in the new class.Kirby\Auth\Auth::validatePassword()andKirby\Auth\Auth::verifyChallenge()returnKirby\Cms\UserornullKirby\Cms\Find::user()throwsKirby\Exception\UserNotFoundException- Removed
Kirby\Cms\Auth::ipHash(). Use$visitor->ip(hash: true)instead. - Auth session format changed:
kirby.challenge.code→kirby.challenge.data. In-flight challenges across the Kirby upgrade won't verify. - Removed the translation strings
login.code.label.loginandlogin.code.label.password-reset - Removed the
loginextension type ofpanel.plugin()(panel.plugins.login). Register your custom login UI as a normalcomponentinstead and reference it in theKirby\Auth\Method::form()orKirby\Auth\Challenge::form()method of your custom auth method or challenge. #8045 - Removed
<k-login-form>,<k-login-code-form>and the deprecated aliases<k-login>and<k-login-code>#8045 - The Panel login routes are multi-step now:
login/method/...andlogin/challenge/... - The TOTP enable/disable dialogs (
Kirby\Panel\UserTotpEnableDialog,Kirby\Panel\UserTotpDisableDialogand<k-totp-dialog>) have been replaced byKirby\Panel\Controller\Drawer\UserTotpDrawerControllerand<k-user-totp-drawer>#7445
Deprecated
Deprecated classes, methods, components and options keep working for now, but will be removed in a future major version.
Core
General
| Deprecated | Use instead |
|---|---|
Spyc YAML handler ('yaml.handler' => 'spyc') |
Symfony YAML (default) |
Kirby\Cms\Blueprint |
Kirby\Blueprint\Blueprint |
Kirby\Cms\FileBlueprint |
Kirby\Blueprint\FileBlueprint |
Kirby\Cms\PageBlueprint |
Kirby\Blueprint\PageBlueprint |
Kirby\Cms\SiteBlueprint |
Kirby\Blueprint\SiteBlueprint |
Kirby\Cms\UserBlueprint |
Kirby\Blueprint\UserBlueprint |
files, pages and users field types |
filepicker, pagepicker and userpicker (aliases removed in the next major release) |
Kirby\Cms\PageRules, Kirby\Cms\FileRules, Kirby\Cms\UserRules, Kirby\Cms\SiteRules, Kirby\Cms\LanguageRules |
$model->guards() |
$model->permissions() and the permission classes behind it |
$model->guards() |
Kirby\Field\FieldOptions |
Kirby\Form\FieldOptions |
Auth
| Deprecated | Use instead |
|---|---|
Kirby\Cms\Auth |
Kirby\Auth\Auth |
Kirby\Cms\Auth\Status |
Kirby\Auth\Status |
Kirby\Auth\Auth::login2fa() |
Kirby\Auth\Auth::authenticate() |
Kirby\Auth\Auth::enabledChallenges() |
Kirby\Auth\Challenges::enabled() via $kirby->auth()->challenges()->enabled() |
Kirby\Auth\Auth::isBlocked() |
Kirby\Auth\Limits::isBlocked() via $kirby->auth()->limits()->isBlocked() |
Kirby\Auth\Auth::log() |
Kirby\Auth\Limits::log() via $kirby->auth()->limits()->log() |
Kirby\Auth\Auth::logfile() |
Kirby\Auth\Limits::file() via $kirby->auth()->limits()->file() |
Kirby\Auth\Auth::track() |
Kirby\Auth\Limits::track() via $kirby->auth()->limits()->track() |
Kirby\Cms\System::loginMethods() |
Kirby\Auth\Methods::enabled() via $kirby->auth()->methods()->enabled() |
Kirby\Cms\System::is2FA() |
Kirby\Auth\Methods::hasAnyRequiring2FA() via $kirby->auth()->methods()->hasAnyRequiring2FA() |
Kirby\Cms\System::is2FAWithTOTP() |
Kirby\Auth\Methods::hasAnyRequiring2FA() together with Kirby\Auth\Challenges::enabled() |
Kirby\Cms\User::changeTotp(), Kirby\Cms\UserRules::changeTotp() |
Kirby\Cms\User::changeSecret('totp', …) |
Sessions
| Deprecated | Use instead |
|---|---|
Kirby\Session\SessionData |
Kirby\Session\Data |
Kirby\Session\SessionStore |
Kirby\Session\Store |
Kirby\Session\FileSessionStore |
Kirby\Session\FileStore |
Kirby\Cms\App::sessionHandler() |
Kirby\Cms\App::sessions() |
Kirby\Session\Sessions::createManually() |
Kirby\Session\Sessions::create(['mode' => 'manual']) |
Kirby\Session\Sessions::getManually() |
Kirby\Session\Sessions::find() |
Kirby\Session\Sessions::currentDetected() |
Kirby\Session\Sessions::detect() |
Kirby\Session\Sessions::updateCache() |
Kirby\Session\Sessions::track() |
Kirby\Session\Sessions::cookieDomain() |
Kirby\Session\Sessions::cookie()->domain() |
Kirby\Session\Sessions::cookieName() |
Kirby\Session\Sessions::cookie()->name() |
Panel
Frontend
| Deprecated | Use instead |
|---|---|
<k-models-dialog>, <k-files-dialog>, <k-users-dialog> |
<k-model-picker-dialog> |
<k-pages-dialog> |
<k-page-picker-dialog> |
<k-text :html="foo" /> |
<k-text :text="$h(foo)" /> or <k-text :text="foo" /> to escape the value |
<k-box :html="true" :text="foo" /> |
<k-box :text="$h(foo)" /> |
<k-tag :html="true" :text="foo" /> |
<k-tag :text="$h(foo)" /> |
html prop of <k-tag-field-preview>, <k-tags-field-preview> and <k-models-field-preview> |
not needed: values and option texts already carry trusted HTML where appropriate |
$library.dayjs.interpret() |
$library.dayjs.parse() |
Backend
| Deprecated | Use instead |
|---|---|
Kirby\Panel\File::dropdown() |
Kirby\Panel\Controller\Dropdown\FileSettingsDropdownController |
Kirby\Panel\Page::dropdown() |
Kirby\Panel\Controller\Dropdown\PageSettingsDropdownController |
Kirby\Panel\User::dropdown() |
Kirby\Panel\Controller\Dropdown\UserSettingsDropdownController |
Kirby\Panel\Model::breadcrumb() |
Kirby\Panel\Controller\View\ModelViewController::breadcrumb() |
Kirby\Panel\Model::buttons() |
Kirby\Panel\Controller\View\ModelViewController::buttons() |
Kirby\Panel\Model::prevNext() |
Kirby\Panel\Controller\View\ModelViewController::prev() and Kirby\Panel\Controller\View\ModelViewController::next() |
Kirby\Panel\Model::props() |
Kirby\Panel\Controller\View\ModelViewController::props() |
Kirby\Panel\Model::versions() |
Kirby\Panel\Controller\View\ModelViewController::versions() |
Kirby\Panel\Model::view() |
Kirby\Panel\Controller\View\ModelViewController::load() |
Global pages/create dialog endpoint |
create dialog endpoint of a pagelist field |
Kirby 5
Breaking
Requirements
- Kirby 5 requires at least PHP 8.2
- Kirby 5 raises browser version requirements for the Panel:
- Safari 16+
- Mobile Safari 16+
- Android Browser 126+
- Chrome for Android 126+
- (other browsers remain unchanged)
Core
Config options
- Closures defined for the
content.saltoption will no longer receive a model when generating a salt for preview authentication tokens of drafts and versions as those tokens are now only based on the URI. The salt callback instead receivesnulland is expected to return a fixed model-independent salt in this case. When generating a salt for a file media token, the file object is still passed as model. #6836 - The
api.methodOverwriteoption has been renamed toapi.methodOverride - The
content.fileRedirectsoption is now set tofalseby default. This protects uploaded file originals from unauthorized downloads. If you rely on thehttps://example.com/some/page/file.pdforhttps://example.com/some-site-file.pdfroutes, you can set the option totrueor to a closure to control access dynamically per file.
Controllers
- Data/variables from your
sitecontroller will now be passed to all templates #6412
Hooks
- Model action
beforehooks: rules get applied before and after the hook runs
Collections
- PHP type hints have been added to many collection methods. If you are extending Core classes, you might need to add the same to your own classes and methods.
Models
Kirby\Cms\HasMethods::callMethod()is now a protected methodKirby\Cms\ModelWithContent::lock()will now always return aKirby\Content\Lockobject, even if the model is not currently locked. You can check for that case withModelWithContent::lock()->isLocked()Kirby\Cms\ModelWithContent::version()andKirby\Cms\ModelWithContent::versions()are no longer available as direct field accessor. You need to use$model->content()->version()/$model->content()->versions()instead if you are using a field with the nameversion/versions.Kirby\Cms\Page::modified(),Kirby\Cms\File::modifiedContent()andKirby\Cms\User::modified()now use the current language instead of the default language.- Old model instances (objects that already were e.g. updated and returned a new model instance) can no longer modify their content. Calling actions on these old model instances will throw an exception. Use the new model instances instead.
- All methods in
*Rulesclasses are now marked to returnvoidinstead of abool#6660
Content & Locking
- Removed
Kirby\Cms\ContentLockandKirby\Cms\ContentLocksas well asKirby\Cms\App::locks() $kirby->contentToken()only acceptsobjectornullfor the$modelparameter instead ofmixed. #6822- Renamed
tokenquery param for preview URLs to_token#6823
Pages
$page::translation()returns a single translation in single language mode. It now always returns aKirby\Content\Translationobject. This is also included in the$page::toArray()method.- Cache IDs in the pages cache now include a part for the version ID. Currently this is always
.latest, e.g.home.latest.html. #6827 - Removed internal
$page->isVerified()method in favor of internal$page->renderVersionFromRequest()#6829
Users
User::create()does no longer accept null as argument.- Users without a role in their credentials file will now receive the
defaultrole (if exists), not thevisitorrole anymore #6656 - Setting a
namefield inUser::update()does no longer have any effect. UseUser::changeName()instead.
Roles and Permissions
- If file sorting was previously disabled via the
files.updatepermission, the newfile.sortpermission has to be configured accordingly. #6589 Kirby\Cms\Role::admin()has been renamed toKirby\Cms\Role::defaultAdmin()#7187Kirby\Cms\Role::nobody()has been renamed toKirby\Cms\Role::defaultNobody()#7187- Classes extending
Kirby\Cms\ModelPermissionsneed to set their category with theconst CATEGORYorstatic function category()instead ofprotected string $categoryand use the staticuser()method instead of$userand$permissionsproperties #6880
Media & Thumbnail generation
Kirby\Image\Dimensions::forImage()now receives anKirby\Image\Imageobject #6591Kirby\Image\Exif::read()is now a static method that receives an absolute path to a file #6591- Thumb driver
autoOrientoption has been removed and now is always applied #6591
Plugins
Kirby\Plugin\Plugin::license()now returns theLicenseobject instead of a simple stringKirby\Plugin\Plugin::toArray()includes the full license info as child array instead of a string
Forms
Kirby\Form\Field::$formFieldshas been renamed toKirby\Form\Field::$siblings- The
$formFieldargument inKirby\Form\Field::factory()has been renamed to$siblings - You can no longer pass a value to
Kirby\Form\Field::isEmpty()UseKirby\Form\Field::isEmptyValue($value)instead. Kirby\Form\Form::fields()does no longer return null but an emptyKirby\Form\Fieldscollection if there are no fields.Kirby\Form\Field::validate()returns an array of errors instead of void.- Removed protected
Kirby\Form\Fields::$errors,Kirby\Form\Field::$errorsandKirby\Form\FieldClass::$errorsproperties #7131 - The language argument in the protected internal
Kirby\Form\Form::prepareForLanguage()method is no longer optional and must be a Language object. #7132 - The
Kirby\Form\Formclass does no longer swallow errors in field classes on construction. This could be considered a breaking change or an debugging enhancement. #7167 - When using the
Kirby\Form\Formclass, the disabled state of fields will no longer be overwritten on construction for secondary languages. UseKirby\Form\Form::toProps()instead, to get the correct disabled state for each field. When usingKirby\Form\Form::toProps(), permissions will also be honored when the model cannot be updated by the user role. #7166 Kirby\Form\Form::$valueshas been removed #7166Kirby\Form\Form::prepareFieldsForLanguage()has been removed #7166- The structure field
::formmethod does no longer have a$valuesparameter. Use$field->form()->fill()or$field->form()->submit()instead if you want to add values to the form. #7170
Filesystem
F::read()no longer supports requesting URLs with protocols such ashttp://andhttps://. Please use theRemoteclass for this purpose. #7099F::read()no longer silently returnsfalsewhen the file exists but is not readable. Instead it triggers a PHP "Permission denied" warning. #7099
Toolkit
- The
Str::ucfirst()method no longer lowercases all but the first letter of the text, it only capitalizes the first letter. #6860 Str::camel(),Str::camelToKebab(),Str::float(),Str::kebab(),Str::kebabToCamel(),Str::length(),Str::lower(),Str::safeTemplate(),Str::short(),Str::slug(),Str::snake(),Str::studly(),Str::substr(),Str::template(),Str::ucfirst(),Str::ucwords(),Str::unhtml(),Str::upper()andStr::widont()can no longer be called without a value argument (passing anullvalue still works) #6401- Passing a single space as value to
Xml::attr()won't render an empty value anymore but a single space. To render an empty value, please pass an empty string. #6803
Panel
Uploads
- Panel uploads can exceed PHP’s
upload_max_filesizelimit #6421. If you want to restrict the upload size, please use the file blueprintacceptmaxsizeoption
Fields
- All fields:
signatureis no longer available as field property when loading fields from the Panel backend #6712 - Textarea field: File drag texts in the Panel always use the file UUID, if UUIDs are not disabled #6948
- Date field: Calendar dropdown input will show Sunday now as first day of the week (depending on the user's language). If you want to enforce Monday as first day of the week, you can set the
date.weekdayoption to1. #6635 - Select field:
emptyprop was removed. Use combination ofrequired,placeholderanddefaultto replicate functionality #6459 - Checkbox and Toggle fields:
required: truenow enforces that these fields need to be checked/toggled (active state)
Custom Panel CSS
- CSS attribute selectors must be written fully qualified (e.g.
[data-hidden="true"]as only[data-hidden]can start matching also elements where that attribute isfalse) #6109
Vue Components
<k-form>and<k-fieldset>as well as many fields and inputs don't emit aninvalidevent anymore. Use native HTML invalid state of elements instead. #6099novalidateprop has been removed from all elements but<k-form>#6099- Removed
hasErrorsmethods of<k-fieldset>#6173 <k-file-preview>got fully refactored. If you were replacing or extending it, your code likely will break. Check out the new custom file preview feature if you want to provide previews for specific files. #6578<k-draggable>: themovecallback function is receiving an event with an altered data structure- While
<k-writer>is still included as alias for <k-writer-input>, some use cases where you accessed the<k-writer>component via the$refsof<k-writer-input>have to be adapted #6172 <k-item>: Removeddata-only-optionattributes<k-dialog>: Removeddata-has-footerattribute<k-toggles-input>: Removeddata-disabledattribute<k-writer-input>: Removeddata-toolbar-inlineattribute<k-bubble>: Removeddata-has-textattribute<k-header>: Removeddata-has-buttonsattribute<k-tag>: Removeddata-has-imageanddata-has-toggleattributes<k-tree>: Removeddata-has-subtreeattribute
Panel JS API
panel.view.isLockedno longer exists. Usepanel.content.isLocked()instead #6515- Vuex and the Vuex content module have been removed.
- The following dialogs no longer send dispatch events via the backend. Dispatch events relied on Vuex.
page.changeTitlepage.deletepage.moveuser.delete
- The
panel.api.users.changePassword()method now receives three arguments for the user ID, the new password to set and the current password of the acting user (new) #7186
API
- The
PATCH:account/passwordandPATCH:users/$user/passwordAPI routes require an additionalcurrentPasswordparameter with the password of the acting user unless in password reset mode of the current user #7186 - Removed API routes:
GET:/api/(:all)/lockPATCH:/api/(:all)/lockDELETE:/api/(:all)/lockPATCH:/api/(:all)/unlockDELETE:/api/(:all)/unlock
Translations
copy.successhas been renamed tocopy.success.multiple
Removed deprecated code
| Removed | Use instead |
|---|---|
<k-aspect-ratio> |
<k-frame> |
<k-autocomplete> |
- |
<k-bar>: left, right and center slots |
default slot |
<k-breadcrumb>: view prop |
Add as first entry to crumbs prop |
<k-button>: tooltip prop |
title prop |
<k-button-disabled> |
<k-button :disabled="true"> |
<k-button-link> |
<k-button link="..."> |
<k-button-native> |
<k-button> |
<k-dialog>: disabled, icon and theme props. |
submit-button prop |
<k-dropdown> |
<k-dropdown-content> as standalone |
<k-grid>: gutter prop |
style="gap: " or variant prop |
<k-header>: left and right slots |
buttons slot |
<k-header>: tabs prop |
standalone <k-tabs> |
<k-headline>: size prop |
tag prop |
<k-headline>: theme prop |
- |
<k-icon>: removed support for other viewBox than 0 0 24 24 |
Wrap icon in an <svg> element with corresponding viewBox attribute |
<k-inside> |
<k-panel-inside> |
<k-loader> |
<k-icon type="loader" /> |
<k-outside> |
<k-panel-outside> |
<k-plugin-view> |
- |
<k-progress>: set method |
value prop |
<k-text>: theme prop |
- |
<k-upload> |
$panel.upload module |
<k-view> |
- |
$store.drawer |
$panel.drawer |
$store.notification |
$panel.notification |
$store.dialog() |
$panel.dialog.open() |
$store.drag() |
$panel.drag.start(type, data) |
$store.fatal() |
$panel.notification.fatal() |
$store.isLoading() |
$panel.isLoading |
$store.navigate() |
- |
JS $events.$on, $events.$off, $events.$emit |
$events.on, $events.off, $events.emit |
window.panel.$api |
window.panel.api |
window.panel.$config |
window.panel.config |
window.panel.$direction |
window.panel.direction |
window.panel.$events |
window.panel.events |
window.panel.$language |
window.panel.language |
window.panel.$languages |
window.panel.languages |
window.panel.$license |
window.panel.license |
window.panel.$multilang |
window.panel.multilang |
window.panel.$search |
window.panel.search |
window.panel.$searches |
window.panel.searches |
window.panel.$translation |
window.panel.translation |
window.panel.$url |
window.panel.url |
window.panel.$urls |
window.panel.urls |
window.panel.$user |
window.panel.user |
window.panel.$view |
window.panel.view |
window.panel.$vue |
window.panel.app |
this.$config |
this.$panel.config |
this.$direction |
this.$panel.direction |
this.$language |
this.$panel.language |
this.$languages |
this.$panel.languages |
this.$license |
this.$panel.license |
this.$menu |
this.$panel.menu |
this.$multilang |
this.$panel.multilang |
this.$search |
this.$panel.search |
this.$searches |
this.$panel.searches |
this.$system |
this.$panel.system |
this.$translation |
this.$panel.translation |
this.$urls |
this.$panel.urls |
this.$user |
this.$panel.user |
this.$view |
this.$panel.view |
Array.wrap() |
this.$helper.array.wrap() |
Array.fromObject() |
this.$helper.array.fromObject() |
myArray.split() |
this.$helper.array.split(myArray, delimiter) |
myArray.sortBy() |
this.$helper.array.sortBy(myArray, sortBy) |
Kirby\Content\ContentTranslation |
Kirby\Content\Translation |
Kirby\Cms\Model |
- |
Kirby\Cms\ModelWithContent::readContent() |
$model->version()->read() |
Kirby\Cms\ModelWithContent::writeContent() |
$model->version()->write() |
Kirby\Cms\Properties trait |
PHP native named properties |
Kirby\Cms\File::contentFileDirectory() |
- |
Kirby\Cms\File::contentFileName() |
- |
Kirby\Cms\ModelWithContent::contentFile() |
$model->storage()->contentFile() |
Kirby\Cms\ModelWithContent::contentFiles() |
$model->storage()->contentFiles() |
Kirby\Cms\ModelWithContent::contentFileDirectory() |
- |
Kirby\Cms\ModelWithContent::contentFileName() |
- |
Kirby\Cms\ModelWithContent::contentFileExtension() |
- |
Kirby\Cms\Page::contentFileName() |
- |
Kirby\Cms\Site::contentFileName() |
- |
Kirby\Cms\User::contentFileName() |
- |
Kirby\Form\FieldClass::valueFromJson() |
Kirby\Data\Json::decode() |
Kirby\Form\FieldClass::valueFromYaml() |
Kirby\Data\Yaml::decode() |
Kirby\Form\FieldClass::valueToJson() |
Kirby\Data\Json::encode() |
Kirby\Form\FieldClass::valueToYaml() |
Kirby\Data\Yaml::encode() |
Deprecated
Core
Models
Kirby\Panel\Model::content()is deprecated. UseKirby\Panel\Model::versions()['changes']instead. #7153
Plugins
Kirby\Cms\Pluginis deprecated. UseKirby\Plugin\Plugininstead.Kirby\Cms\PluginAssetis deprecated. UseKirby\Plugin\Assetinstead.Kirby\Cms\PluginAssetsis deprecated. UseKirby\Plugin\Assetsinstead.
Forms
Kirby\Form\Field::formFields()is deprecated. Use::siblings()instead.Kirby\Form\Field::data()is deprecated. Use::toStoredValue()instead.Kirby\Form\Field::save()is deprecated. Use::isSaveable()instead.Kirby\Form\Field::value()is deprecated. Use::toFormValue()instead.Kirby\Form\FieldClass::data()is deprecated. Use::toStoredValue()instead.Kirby\Form\FieldClass::save()is deprecated. Use::isSaveable()instead.Kirby\Form\FieldClass::value()is deprecated. Use::toFormValue()instead.Kirby\Form\Form::content()is deprecated. Use::toStoredValues()instead. #7166Kirby\Form\Form::data()is deprecated. Use::toStoredValues()instead. #7166Kirby\Form\Form::strings()is deprecated. Use::toStoredValues()instead. #7166Kirby\Form\Form::values()is deprecated. Use::toFormValues()instead. #7166
Exceptions
- Exception classes: passing
$argarray will be removed in a future version. Use named arguments. #6618
Panel
Config options
panel.faviconoption throws deprecation warnings forurloption (usehrefinstead) and forrelkey (usereloption instead)
Fields
- Color field: the
text => valuenotation for options has been deprecated and will be removed in Kirby 6. Please rewrite your options asvalue => text. #6913
Custom Panel CSS
--color-backdropCSS property has been deprecated. Use--overlay-color-backinstead #6299
Vue components
<k-writer>will be removed in a future version. Use<k-writer-input>instead #6172<k-bubble>,<k-bubbles>and<k-bubbles-field-preview>. Use<k-tag>,<k-tags>and<k-tag-field-preview>instead. #6569
Panel JS API
TextareaInput.restoreSelectionCallback()has been deprecated. UseTextareaInput.restoreSelection()instead.
Kirby 4
Breaking
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.
Deprecated
Core
- Files in a plugin's
assetsdirectory are now always assumed to be public, independent of their file extension. If your plugin needs to store other files in the assets directory, please use the newassetsextension to explicitly define the public assets. - Passing a single space as value to
Xml::attr()(with the intention to generate an attribute with an empty value) has been deprecated in favor of passing an empty string. Kirby\Cms\Model: UseKirby\Cms\ModelWithContentinsteadKirby\Email\Email::clone()andKirby\Email\Body::clone()Page::isReadable(): UsePage::isAccessible()instead- The name
queryshould not be used for custom API endpoints anymore, it will be used for the Kirby QL (KQL) plugin/core implementation - Internal
$model->contentFile(),$model->contentFiles(),$model->contentFileDirectory(),$model->contentFileExtension()and$model->contentFileName()methods have been deprecated and will be removed in v5.
Panel
- Custom icons using a 16x16 viewbox have been deprecated. In an upcoming version, Kirby will only support custom icons with a 24x24 viewbox by default. If you want to continue using icons with a different viewport, please wrap them in an
<svg>element with the correspondingviewBoxattribute. - Icons
circle-outline,heart-outlineandstar-outline: Usecircle,heartandstarinstead this.$events: Usethis.$panel.eventsinsteadthis.$panel.events.$on: Usethis.$panel.events.oninsteadthis.$panel.events.$off: Usethis.$panel.events.offinsteadthis.$panel.events.$emit: Usethis.$panel.events.emitinsteadthis.$store.dispatch("isLoading"): Usethis.$panel.isLoadinginsteadthis.$translation: Usethis.$panel.translationinsteadthis.$store.dispatch("dialog"): Usethis.$panel.dialog.openandthis.$panel.dialog.closeinsteadthis.$store.dispatch("drag", drag): Usethis.$panel.drag = draginsteadk-dropdown: Usek-dropdown-contentas standalone insteadk-calendarwas renamed tok-calendar-input;k-calendaris still available but only as deprecated alias.
Migration Guides
Kirby 3.9
Breaking
$kirby->impersonate()doesn't bind the app instance to the$callbackclosure anymore. You can access the app instance withKirby\Cms\App::instance()or thekirby()helper. #4944- The
snippetcore component receives an additional parameterbool $slotsand needs to returnKirby\Template\Snippetorstringfor slot support. If you override thesnippetcomponent, please adapt the logic to the new core component. #4910 $kirby->snippet()and thesnippet()helper returnKirby\Template\Snippetorstringornull#4910Html::rel()now consistently returnsnullinstead of an empty string when norelattribute is needed #4948A::missing()no longer treats an existing array key with anullvalue as missing #4942
Removed deprecated code
- Deprecated method
Kirby\Cms\App::server()has been removed. UseKirby\Cms\App::environment()instead. #4944
Deprecated
- Manually passing
$slotor$slotsas data variables to snippets is deprecated. In a future Kirby version, those variables will be overridden with theSlotandSlotsobjects. #4963 - The
Toolkit\Queryclass has been deprecated and will be removed in a future version. UseQuery\Queryinstead. #4944 - Passing an empty string as value to
Xml::attr()/Html::attr()has been deprecated and will throw a warning. In a future version, passing an empty string won't omit the attribute anymore but render it with an empty value. To omit the attribute, please passnull. #4934 - The
.k-offscreenCSS class has been deprecated. Use.sr-onlyinstead. #4944
Migration Guides
Kirby 3.8
Breaking
Panel
- The multiselect field no longer displays the option value as info #4624
Core
- Kirby 3.8.0 requires a minimum of PHP 8.0.
uuidandpermalinkcannot be used as field name or custom method for any page, file, user or site anymore. Content fields can only be accessed via e.g.$model->content()->get('permalink').- The first-level URL path
@is now blocked. - Kirby's upload sanitizer no longer checks XML files for external links because they can be pretty common in many XML-based formats; if you want to keep the strict behavior, set
Kirby\Sane\Xml::$allowedDomains = [], set this property to a custom allowlist or write a custom Sane handler for your XML-based format #4553 - Kirby now automatically loads the
site/config/env.phpfile; if you already use this file path for a different purpose, please rename the file to a different name #4580 A::average()returnsnullwhen passed an empty array #4649- The default token fallback in
Str::safeTemplate()changed from an empty string tonull(which leaves invalid tokens in the output string). This behavior is consistent withStr::template(). $translation->exists()now returnstruefor translations without an actual content file but where an content array has been provided- The deprecated
masterbranch of the Kirby repository was deleted. If you install Kirby via Git, e.g. as a submodule, please use themainbranch instead. - Database queries: subsequent
->where()clauses don't support passing the mode (AND|OR) as last parameter anymore, but will interpret these as actual values to filter against. Use->andWhere()or->orWhere()instead. #4668 Helpers::handleErrors()'s 2nd parameter now only determines whether the error is suppressed, its 3rd parameter defines what is returned when an error is suppressed
Removed deprecated code #4478 #4515
Removed dump component. Disable dump() via KIRBY_HELPER_DUMP instead and create your own function.
PHP methods
| Removed | Use instead |
|---|---|
$file->dragText() |
$file->panel()->dragText() |
$file->panelIcon() |
$file->panel()->image() |
$file->panelImage() |
$file->panel()->image() |
$file->panelOptions() |
$file->panel()->options() |
$file->panelPath() |
$file->panel()->path() |
$file->panelUrl() |
$file->panel()->url() |
$file->pickerData() |
$file->panel()->pickerData() |
$files->findById() |
$files->find() |
$page->dragText() |
$page->panel()->dragText() |
$page->panelIcon() |
$page->panel()->image() |
$page->panelId() |
$page->panel()->id() |
$page->panelImage() |
$page->panel()->image() |
$page->panelOptions() |
$page->panel()->options() |
$page->panelPath() |
$page->panel()->path() |
$page->panelUrl() |
$page->panel()->url() |
$page->pickerData() |
$page->panel()->pickerData() |
$pages->findById() |
$pages->find() |
$pages->findByIdRecursive() |
$pages->find() |
$pages->findByUri() |
$pages->find() |
$site->panelIcon() |
$site->panel()->image() |
$site->panelImage() |
$site->panel()->image() |
$site->panelOptions() |
$site->panel()->options() |
$site->panelPath() |
$site->panel()->path() |
$site->panelUrl() |
$site->panel()->url() |
$site->pickerData() |
$site->panel()->pickerData() |
$user->panelIcon() |
$user->panel()->image() |
$user->panelImage() |
$user->panel()->image() |
$user->panelOptions() |
$user->panel()->options() |
$user->panelPath() |
$user->panel()->path() |
$user->panelUrl() |
$user->panel()->url() |
$user->pickerData() |
$user->panel()->pickerData() |
Kirby\Panel\Document::customCss() |
Kirby\Panel\Document::customAsset('panel.css') |
Kirby\Panel\Document::customJs() |
Kirby\Panel\Document::customAsset('panel.js') |
Kirby\Toolkit\Str::isUrl() |
Kirby\Toolkit\V::url() |
| Method | Change | Use instead |
|---|---|---|
markdown component |
Removed $inline parameter |
$options['inline'] |
$kirby->kirbytext() |
Removed $inline parameter |
$options['markdown']['inline'] |
$kirby->markdown() |
Passing a boolean as second parameter isn't supported anymore. | $options['inline'] |
Classes
| Removed | Use instead |
|---|---|
Kirby\Http\Server |
Kirby\Http\Environment |
Class Aliases
| Removed |
|---|
Server |
API
| Removed |
|---|
page.next |
page.prev |
Deprecated
$kirby->impersonate($user, $callback): The$callbackwill not be bound anymore to the$kirbyinstance in Kirby 3.9.0,$thisinside the callback will refer to the current context and not$kirbyinstead. Using$thisas$kirbyinside the callback will throw a deprecation warning in debug mode. #4498- Blueprints: The
headlineoption for sections will be removed in a future Kirby version. Uselabelinstead. #4515 $kirby->server()has been deprecated and will be removed in Kirby 3.9.0. Use$kirby->environment()instead. #4515Kirby\Form\Options,Kirby\Form\OptionsApi,Kirby\Form\OptionsQueryhave been deprecated and will be removed in Kirby 3.9. Use theirKirby\Optionequivalents instead.
Migration Guides
Kirby 3.7
Breaking
Composer installation
If you install Kirby using Composer, you may run into errors if your command line installation of PHP doesn’t have the extensions installed that Kirby requires. If you are sure that your web server fulfills the requirements, you can use Composer’s --ignore-platform-reqs or --ignore-platform-req=ext-* flags. #4216
Core
Http\Router::$beforeEachandHttp\Router::$afterEacharen't static anymore. Pass them in an array as second argument to the constructor instead. #4260- Custom auth type classes in the
Kirby\Http\Request\Auth\namespace now need to be registered in theKirby\Http\Request::$authTypesarray. We also recommend to move the classes to your own namespace to avoid interference with core classes. #4264 - Field names of virtual pages' content are now converted to lowercase. If your virtual page has two fields that only differ in capitalization, only the last defined one will be available.
- The
Server::hosts()method was removed. Please set the allowed URLs via theurloption. pagehelper now always only returns aKirby\Cms\Pageobject ornull, never a pages collection. Only allows passing a single id as parameter. #4335pageshelper now always only returns aKirby\Cms\Pagescollection ornull, never single page object. #4335- Creating a
Kirby\Cms\Fileobject requires theparentproperty now. #4335 Toolkit\Str::toBytes()strictly only accepts a string as parameter now. #4335- The
$pages->children(),$pages->drafts()and$pages->index()methods no longer set the$pages->parent()object as the collection items can have multiple different parents. This can change the behaviour when finding collection items in secondary languages and when merging collections. #4105 - The
dump()ande()helper function checks have been removed. If your plugins or dependencies have functions with these two names, you will get an error. You can override the conflicting functions by defining theKIRBY_HELPER_*contants. Check out how to do it. - The second argument of the
kirbytextinline()andkti()helpers has been renamed from$datato$options
Removed methods
The following deprecated methods/parts have been removed #4335
| Removed | Use instead |
|---|---|
| Cms\App::setLocale() | Toolkit\Locale::set() |
| Cms\Block::_key() | Cms\Block::type() |
| Cms\Block::_uid() | Cms\Block::id() |
| Toolkit\I18n::fallback() | Toolkit\I18n::fallbacks() |
| Toolkit\Str::template(): $fallback, $start and $end parameters | pass an array to the $options parameter |
Panel
k-block-type-tableandk-structure-fieldhave been largely refactored. If you (or a plugin) extends these, stuff might break.k-pages-sectionandk-files-sectionhave been modified extensively #4247Toolkit\Html::attr([], null)now consistently returnsnullinstead of an empty string. #4018- Removed
builderandeditorfield migration for blocks field.
API
The following deprecated methods/parts have been removed #4335
| Removed | Use instead |
|---|---|
| API fields page.panelIcon / file.panelIcon | page.panelImage / file.panelImage |
| GET (:all)/lock API endpoint | - |
| GET (:all)/unlock API endpoint | - |
| GET pages/(:any)/children/blueprints API endpoint | GET pages/(:any)/blueprints |
| GET site/children/blueprints API endpoint | GET site/blueprints |
| JS API method files.rename() | files.changeName() |
| JS API method pages.slug() | pages.changeSlug() |
| JS API method pages.status() | pages.changeStatus() |
| JS API method pages.template() | pages.changeTemplate() |
| JS API method pages.title() | pages.changeTitle() |
| JS API method site.title() | site.changeTitle() |
| JS API method system.info() | system.get() |
Deprecated
- The
dumpcomponent was deprecated and superseded by the new feature to replace helpers (KIRBY_HELPER_DUMPconstant). The component will be removed in Kirby 3.8.0. #4018 Http\Serverclass will be removed in 3.8.0- The constants in
Http\Server::are now deprecated and will be removed in 3.8.0. They are no longer needed. - The
$pages->findById()and$pages->findByUri()methods have been deprecated and will be removed in 3.8.0. If you want to directly get a page by ID, use$pages->get(). If you want the previous fuzzy behaviour that queries both by ID and URI, use$pages->find(). - The
$pages->findByIdRecursive()method has been deprecated and will be removed in v3.8.0. Please use$pages->find()instead. - The
$files->findById()method has been deprecated and will be removed in v3.8.0. Please use$files->find()instead. - The
$pages->findByKey(),$files->findByKey()and$users->findByKey()methods have been marked as internal. Please use thefind()methods instead. - The
$inlineparameter in$kirby->kirbytext()is deprecated. Use$options['markdown']['inline']instead. - The
$inlineparameter in$kirby->markdown()is deprecated. Use$options['inline']instead. - Blueprint presets
page,pagesandfilesare deprecated.
Deprecation warnings
The following deprecated methods/parts throw warnings in 3.7.0 and will be removed starting in 3.8.0 #4335
Methods
| Deprecated | Use instead | Removed in |
|---|---|---|
| $file->dragText() | $file->panel()->dragText() | 3.8 |
| $file->panelIcon() | $file->panel()->icon() | 3.8 |
| $file->panelImage() | $file->panel()->image() | 3.8 |
| $file->panelOptions() | $file->panel()->options() | 3.8 |
| $file->panelPath() | $file->panel()->path() | 3.8 |
| $file->panelUrl() | $file->panel()->url() | 3.8 |
| $file->pickerData() | $file->panel()->pickerData() | 3.8 |
| $files->findById() | $files->find() | 3.8 |
| $kirby->server() | $kirby->environment() | 3.9 |
| $page->dragText() | $page->panel()->dragText() | 3.8 |
| $page->panelIcon() | $page->panel()->icon() | 3.8 |
| $page->panelId() | $page->panel()->id() | 3.8 |
| $page->panelImage() | $page->panel()->image() | 3.8 |
| $page->panelOptions() | $page->panel()->options() | 3.8 |
| $page->panelPath() | $page->panel()->path() | 3.8 |
| $page->panelUrl() | $page->panel()->url() | 3.8 |
| $page->pickerData() | $page->panel()->pickerData() | 3.8 |
| $pages->findById() | $pages->find() | 3.8 |
| $pages->findByIdRecursive() | $pages->find() | 3.8 |
| $pages->findByUri() | $pages->find() | 3.8 |
| $site->panelIcon() | $site->panel()->icon() | 3.8 |
| $site->panelImage() | $site->panel()->image() | 3.8 |
| $site->panelOptions() | $site->panel()->options() | 3.8 |
| $site->panelPath() | $site->panel()->path() | 3.8 |
| $site->panelUrl() | $site->panel()->url() | 3.8 |
| $site->pickerData() | $site->panel()->pickerData() | 3.8 |
| $user->panelIcon() | $user->panel()->icon() | 3.8 |
| $user->panelImage() | $user->panel()->image() | 3.8 |
| $user->panelOptions() | $user->panel()->options() | 3.8 |
| $user->panelPath() | $user->panel()->path() | 3.8 |
| $user->panelUrl() | $user->panel()->url() | 3.8 |
| $user->pickerData() | $user->panel()->pickerData() | 3.8 |
| Panel\Document::customCss() | Panel\Document::customAsset('panel.css') | 3.8 |
| Panel\Document::customJs() | Panel\Document::customAsset('panel.js') | 3.8 |
API
| Deprecated | Use instead | Removed in |
|---|---|---|
| API field page.next | - | 3.8 |
| API field page.prev | - | 3.8 |
Kirby 3.6
Breaking
Breaking changes in minor releases? 3.6 is not a minor release. We follow the pattern {generation.major.minor.patch}
3.6.0.0 is the 6th major release for Kirby 3 and it's a really big and important step. We don't take breaking changes lightly but they sometimes have to happen in order to keep moving forward.
Panel
For all users
-
New minimum browser requirements (browsers with native ESM and dynamic
import()support):- Firefox 67+
- Chrome 63+
- Edge 79+
- Opera 50+
- macOS Safari 11.1+
- Safari iOS 11+
- Android Browser 92+
- Chrome for Android 92+
-
Several blueprint options that use the query syntax were updated to escape against raw HTML output that may lead to XSS attacks. HTML code directly in the blueprint option still works as normal. If queries need to return HTML, you can use the new
{< >}syntax. In this case you need to ensure manually that the returned HTML code is safe. With the{{ }}syntax, Kirby performs the escaping for you.
# works as normal
info: "This is <strong>{{ page.important }}</strong>"
# custom site method returns HTML, new `{< >}` syntax needed
info: "via {< site.myMethodWithHtml >}"
- Direct URLs for tabs have changed, e.g. now
/panel/site/?tab=yourTabName - Direct URLs for the users view have changed, e.g. now
/panel/users/?role=yourRole
Custom Panel views
- Using custom Panel views (incl. routing, breadcrumbs...) in plugins has changed fundamentally. You will have to use the new Panel areas extension now.
- Accordingly, the frontend extension
panel.plugin({ view: [...] })has been removed. Use Panel areas instead.
Kirby\Panel namespace related
- If you have modified the
->panel*()methods in custom models, you now need to return a custom Panel model (based onKirby\Panel\Model) at$page->panel()which then takes care of all Panel-related functions, e.g. if you had customized$page->panelImage()you need a customKirby\Panel\Pageto then customize$page->panel()->image(). - Use
$model->panel()->image()instead of$model->panel()->icon() $model->panel()->image()doesn't returncardsandlistkeys anymore. Instead,srcandsrcsetkeys at the top level that correspond to the new$layoutparameter.
Vue component changes
| Removed | Use instead |
|---|---|
k-app |
k-inside (authenticated) or k-outside (unauthenticated) |
k-cards |
k-items with layout: cards |
k-card |
k-item with layout: cards |
k-list |
k-items with layout: list |
k-list-item |
k-item with layout: list |
k-browser-view |
- |
k-custom-view |
- |
- Removed
iconprop fromk-cardandk-list-item. Pass data as part of theimageprop instead to newk-itemcomponent. - If the
coveroption is not defined for a section, it is disabled by default. - The
<k-box text="..." />property is now rendered as plain text by default instead of as HTML code. For the previous behavior use<k-box text="..." :html="true" />.
Helpers & libraries
vue-routerhas been completely removed, use Panel areas to define custom Panel routes- Changes in the Vuex store and store modules
contentmodule doesn't handle content locking information anymore. This in now provided directly to the model views.languagemodule has been removed, usethis.$languageandthis.$languagesinstead.systemmodule has been removed, usethis.$systeminstead.translationmodule has been removed, usethis.$translationinstead.usermodule has been removed, usethis.$userinstead.$store.dispatch('breadcrumb')and$store.dispatch('title')have been removed. Use Panel areas instead.
- The
previewThumbhelper has been removed.k-item-imagetakes care of processing the image data correctly insidek-item. - The following methods from
vuex-i18nare no longer available in the new custom implementation:$tc,$tlang,$i18n.localeExists,$i18n.keyExists. Translation strings cannot be added dynamically anymore, only through our official extension. - Removed outdated $api methods in Vue:
$api.pages.breadcrumb$api.files.breadcrumb$api.users.breadcrumb$api.site.breadcrumb$api.site.options$api.roles.options$api.translations.options
CSS Selectors
.k-panel[data-translation]is now.k-panel[data-language].k-panel[data-translation-default]is now.k-panel[data-language-default]- CSS class
.k-block-handlehas been replaced with.k-sort-handle
Core
- Kirby no longer supports PHP 7.3, which will reach its end-of-life date soon. We will add support for PHP 8.1 to Kirby as soon as possible after the official release of PHP 8.1.
- Multi-language setup: slugs in content files of the default language will be ignored. The folder names decide the slugs for the default language.
- Hidden blocks in the layout field will no longer be visible (as expected)
$files->add()and$users->add()now throw exceptions when something other than aFile/Userobject, aFiles/Usersobject or a file/user ID is passed to them. Empty values (null,falseandtrue) are silently ignored. #3248F::modified()does no longer calculate a maximum between mtime and ctime for file changes. This could in theory lead to different timestamps in some scenarios. Very unlikely though.Html::encode(): Single quotes now are also convertedKirby\Image\Image::__toString()returns the HTML<img>tag instead of the root string- File hooks: the
$uploadparameter is now aKirby\Filesystem\Fileobject, beforeKirby\Image\Image - The video embedding helpers and methods no longer throw exceptions if the provided URL is invalid, instead
nullis returned. Kirby\Toolkit\File::header()now returnsvoidinstead of an emptystringby defaultF::niceSize()doesn't check anymore whether file exists- The public static configuration attributes of the
Saneclasses have been renamed for consistency with the newToolkit\Domclass - The
Sane\Svg::$allowedNamespacesattribute now expects namespace reference names as the array keys instead of full attribute names (soxmlns:xlinkshould become justxlinkandxmlnsshould become an empty string) - The
Sane\Svg::$allowedTagsattribute (before$allowedElements) now is an associative array with the allowed attributes for this tag as the value - All API endpoints for content locking/unlocking don't display an exception anymore when content locking isn't supported.
- The crop keyword is now always present in filenames for cropped files. All center cropped files need to be regenerated.
Cms\Collection::has(): 1st parameter got renamed to$keyCms\Collection::indexOf(): 1st parameter got renamed to$needleCms\Collection::query(): 1st parameter got renamed to$arguments- Some argument and property types are now more specific and therefore stricter #3282, #3241
- In multi-lang setups, calling
$pages->find(),$pages->findById()or$pages->findByUri()on a non-children collection (e.g. grandchildren) with just a slug no longer works. This makes thePagesclass more consistent between single and multi language setups.
Deprecated code that has been removed with 3.6.0
| Removed | Use instead |
|---|---|
Kirby\Cms\Asset::alt() |
- |
Kirby\Cms\Page::sort() |
Kirby\Cms\Page::changeSort() |
Kirby\Cms\KirbyTags::$tagClass |
You cannot set the class for KirbyTag objects to be created via KirbyTags::parse() anymore. |
Deprecated
Removed methods
The following methods have been marked as deprecated since Kirby 3.0.0 and are now removed.
| Removed | Use instead |
|---|---|
$file->meta() |
$file->content() |
$file->rename() |
$file->changeName() |
$languages->findDefault() |
$languages->default() |
$page->hasInvisibleChildren() |
$page->hasUnlistedChildren() |
$page->hasNextVisible() |
$page->hasNextListed() |
$page->hasNextInvisible() |
$page->hasNextUnlisted() |
$page->hasPrevInvisible() |
$page->hasPrevUnlisted() |
$page->hasPrevVisible() |
$page->hasPrevListed() |
$page->hasVisibleChildren() |
$page->hasListedChildren() |
$page->nextVisible() |
$page->nextListed() |
$page->nextInvisible() |
$page->nextUnlisted() |
$page->prevVisible() |
$page->prevListed() |
$page->prevInvisible() |
$page->prevUnlisted() |
$page->isInvisible() |
$page->isUnlisted() |
$page->isVisible() |
$page->isListed() |
$pages->invisible() |
$pages->unlisted() |
$pages->visible() |
$pages->listed() |
Deprecated methods
Deprecated methods will be removed in a future version. Please update your code accordingly.
| Deprecated | Use instead |
|---|---|
$page->sort() |
$page->changeSort() |
Kirby 3.5
Breaking
Required PHP Version
With this release we drop support for PHP 7.2, which has reached end of life. But we also introduce support for the brand-new stable version of PHP 8.0, which has been released on December 1st.
Date field format option
3.5.0 is dropping the format option of the date field. This is a breaking change which we will reverse in 3.5.1.
accept option for file blueprints
If no custom accept restrictions are defined in the file blueprint, Kirby will now limit the accepted uploads to the types image, document, archive, audio and video by default. This protects your sites against unexpected uploads like code files that could be used to attack the server or the visitor's browsers.
You can customize the accepted file types in the file blueprint.
Deprecated
Removed methods
The following methods have been marked as deprecated since Kirby 3.0.0 and are now removed.
| Removed | Use instead |
|---|---|
$file->meta() |
$file->content() |
$file->rename() |
$file->changeName() |
$languages->findDefault() |
$languages->default() |
$page->hasInvisibleChildren() |
$page->hasUnlistedChildren() |
$page->hasNextVisible() |
$page->hasNextListed() |
$page->hasNextInvisible() |
$page->hasNextUnlisted() |
$page->hasPrevInvisible() |
$page->hasPrevUnlisted() |
$page->hasPrevVisible() |
$page->hasPrevListed() |
$page->hasVisibleChildren() |
$page->hasListedChildren() |
$page->nextVisible() |
$page->nextListed() |
$page->nextInvisible() |
$page->nextUnlisted() |
$page->prevVisible() |
$page->prevListed() |
$page->prevInvisible() |
$page->prevUnlisted() |
$page->isInvisible() |
$page->isUnlisted() |
$page->isVisible() |
$page->isListed() |
$pages->invisible() |
$pages->unlisted() |
$pages->visible() |
$pages->listed() |
Deprecated methods
Deprecated methods will be removed in a future version. Please update your code accordingly.
| Deprecated | Use instead |
|---|---|
$page->sort() |
$page->changeSort() |
Kirby 3.4
Breaking
To ensure proper nesting, Kirby relies on the plugin option default values defined in the plugin using the options extension. If your plugin uses a nested structure in the option defaults, the defaults need to be changed to use the dot notation.
Only options registered in that way can be set in all supported ways (dot notation, fully or partially nested) in the site config. You can read more about this in the reference.
Kirby 3.3
Breaking
- The pagination object is now immutable and all setters are disabled by default #1887
- The Vuex
formstore module in the panel has been refactored and is now calledcontent. If your panel plugin works with the form store module, please check out the refactored module. Conversion won't be difficult. We made lots of thinks a lot cleaner. But you need to rename the actions or getters that you use from the old module. - The
v-tabdirective is no longer available. Tabbable elements should use thetabmixin
Deprecated
Deprecated methods
- The deprecated
$kirby->root('translations')root is no longer available. Use$kirby->root('i18n:translations')instead
We've also added deprecation warnings to additional core methods. You will run into an exception if the debug mode is active. You can keep those methods for now in production (with disabled debug mode), but we recommend to convert them as soon as possible. Here are the deprecated methods and how to replace them:
File::meta(useFile::contentinstead)File::rename(useFile::changeNameinstead)Languages::findDefault(useLanguages::default()instead)Page::hasInvisibleChildren(usePage::hasUnlistedChildreninstead)Page::hasNextInvisible(usePage::hasNextUnlistedinstead)Page::hasNextVisible(usePage::hasNextListedinstead)Page::hasPrevInvisible(usePage::hasPrevUnlistedinstead)Page::hasPrevVisible(usePage::hasPrevListedinstead)Page::hasVisibleChildren(usePage::hasListedChildreninstead)Page::nextInvisible(usePage::nextUnlistedinstead)Page::nextVisible(usePage::nextListedinstead)Page::prevInvisible(usePage::prevUnlistedinstead)Page::prevVisible(usePage::prevListedinstead)Page::isInvisible(usePage::isUnlistedinstead)Page::isVisible(usePage::isListedinstead)Site::hasInvisibleChildren(useSite::hasUnlistedChildreninstead)Site::hasVisibleChildren(useSite::hasListedChildreninstead)
Kirby 3.2
Breaking
- Translations root deprecated and will be removed in 3.3. Use i18n:translations instead
- File::model() does no longer return the parent model. Use File::parent() instead