Pre-release notes: https://getkirby.com/releases/5
Changelog since 5.0.0-beta.3
🎉 Features
- New
::toEntries()
field method #6993 for the new Entries field.
<ul>
<?php foreach ($page->myEntries()->toEntries() as $entry): ?>
<li><?= $entry->upper() ?></li>
<?php endforeach ?>
</ul>
✨ Enhancements
- New
ExceptionField
class #7002 - Multiple storage reads are avoided with a new VersionCache class. #6989
- New icons: #7055
accessibility
ai
cloud
info-card
kirby
rocket
rss
shield
shut-down
terminal
wallet
- New
$model->versions()
method returning a versions collection (currently changes and latest) #7059 - New
Language::is()
method to compare Language objects - Pick up new model objects when a model is updated within a hook, even if the new model object is not returned by the hook
✨ Enhancements from previous betas
- New wildcard option for
Version::delete('*')
- New
PlainTextStorage::isSameStorageLocation()
implementation, which compares text file locations for more accurate results. ModelWithContent::changeStorage()
has a new second, boolean$copy
argument, which is false by default. Storage is thus moved by default, but can be copied on demand.ModelWithContent::save()
andModelWithContent::convertTo()
use that new$copy
flag to create a fully in-memory copy for the old instance.
🐛 Bug fixes
- Fix writer update issue #6959
- Fixed password reset dialog in dark mode #7003
- Fix tree branch color in move dialog #6952
k-item
: fix non-selectable state #7024- Hide label and counter for fields in the entries field #7039
User::delete()
will now properly callfile.delete
hooks for deleted user files.
🐛 Fixed regressions and issues from previous betas
- Page blueprint: changeTemplate doesn’t produce multiple content files anymore #7008
- Fix generating redundant image data in content files #6992
- Virtual content is no longer ignored when actual content file exists #7010
- Cancel running requests when discarding or publishing content #6869
- Fixed nested
::update
calls in hooks #6869 - Versions will be properly deleted for all storage handlers when Model delete actions are executed
- Enforce
pages.preview
permission again
🚨 Breaking changes
- Removed
Kirby\Form\Form::exceptionField()
#7002 - When working with old model instances in hooks, the models can no longer overwrite their content. This will now throw an exception if you try. Use the new model instances instead.
$page::translation()
returns a single translation in single language mode. This is also included in the$page::toArray()
method$page::translation()
returns a newKirby\Content\Translation
object instead of the oldKirby\Content\ContentTranslation
object.- The
Kirby\Content\ContentTranslation
class has been removed and repalced withKirby\Content\Translation
$page::translations()
returns a newKirby\Content\Translations
collection instead of a genericKirby\Content\Collection
It will always include at least one language - even in single language mode.Kirby\Content\Content::update()
is actively deprecated and must no longer be used. It will throw an exception to find usage early on.- The
ModelWithContent::$content
andModelWithContent::$translations
cache props have been removed. User::create()
does no longer accept null as argument.- Setting a name field in
User::update
does no longer have any effect. UseUser::changeName()
instead. HasMethods::hasMethod()
andHasMethods::callMethod()
are now protected methods #7058ModelWithContent::versions()
is no longer available as direct field accessor. You need to use$model->content()->versions()
instead if you are using a field with the nameversions
. #7059- The internal
$originalEvent
parameters forApp::apply()
andApp::trigger()
have been removed as they are no longer used in the core.
☠️ Deprecated
ModelWithContent::readContent
: Use$model->version()->read()
instead #7013ModelWithContent::writeContent
Use$model->version()->write()
instead #7013
♻️ Refactored
- Model improvements #7020 #7021 #7023 #7029
- Make sure that the template in the
Page::factory()
method is always lowercase - Make sure that the model name in
Page::model()
is always lowercase - Make sure that the template name is always lowercase in the Page::setTemplate method
- Call
::setBlueprint
in Model constructors before setting content - Use
Page::updateParentCollections
in the::commit
method and remove redundant calls. - Add
::updateParentCollection
methods to FileActions and UserActions and use them in their commit methods - Replace
User::
withstatic::
in user actions. - Add a unit test for creating a user with a password
- Move pagesMethods tests into
Pages/PagesMethodsTest.php
- Use PHPUnit attributes for Model Blueprint tests
- Improve the cache id in the MemoryStorage class
- Undeprecate useful methods in the Translation class
- Replace Page:: with static:: in PageActions
- Simplify Page::createNum
- Improve indentation in the Site class
- Remove ::hardcopy from ::commit in model actions
- New
HasModels
trait App::setSite()
is now public and can be used to overwrite the current site instance- New
Page::normalizeProps()
- New
File::noramlizeProps()
- New
User::normalizeProps()
- New
ModelWithContent::changeStorage()
method. - New virtual page tests
- Unit tests for Models have been reorganized and cleaned up
- New
Kirby\Cms\ModelCommit
class - New
Kirby\Cms\ModelState
class - Uses the new
ModelCommit
class in all action classes
- Make sure that the template in the
- New
Kirby\Cms\Collection::update($object)
method - New
Kirby\Cms\Events
class that handles low-level hook execution
♻️ Refactored from previous betas
- The MemoryStorage class uses the object id for guaranteed uniqueness
- A couple methods in
Kirby\Content\Translation
have been undeprecated because they turn out to be useful::code()
::content()
::exists()
- Moved the folder clean up logic into the
Kirby\Content\PlainTextStorage
handler - Refactor
User::delete()
,Page::delete()
andFile::delete()
to delete the Versions properly
🧹 Housekeeping
- Clean up
@see
tag consistency in the core code