Releases: getkirby/kirby
3.4.4
Features
- New
user.login:failed
hook - New
status=
query parameter for/site/children
and/pages/$pageId/children
API endpoints. You can now filter pages by the following status options (all
,listed
,unlisted
,published
,drafts
) #2846 - Content representations: Allow custom MIME #2803
- New
this.$helper.string.hasEmoji(string)
for the Panel and Panel plugins
Enhancements
- Usernames are now sanitised and all HTML tags are stripped.
- The
dump()
ande()
helper functions are no longer defined if they already exist. This increases compatibility with Laravel and other frameworks. - Improved RTL supports for text, textarea, tags and structure fields #1510
- Improved doc block comments
- Increased test coverage
- Improved variable names in components #2839
- Updated Github templates to integrate our new feedback platform
- Kirby now recognises new image formats: avif, j2k, jp2. Those will not be resized yet though.
- API requests now strip double-slashes in request paths properly #2740
- async/await in User View
Bug fixes
- Fixed info text for users dialog #2832
- Fixed file preview info for non-images #2842
- Fixed
mediaRoot()
for File models #2838 - Fixed issue in the FileView when searching for and navigating to other files #2849
- Fixed payload routing for dialogs #2845
- Fixed upload error for user avatars, when the file type does not match the previous avatar #2834
- Fixed bug in Pagination range #2812
Stats
- 50 commits
- 26 closed issues and PRs
- Contributors: @afbora, @bastianallgeier, @damiendart, @distantnative, @lukasbestle, @mattlenz, @S1SYPHOS
3.4.3
Features
New slugs.maxlength
option
You can now restrict the length of slugs with the new slugs.maxlength
option #1821
// site/config/config.php
return [
'slugs' => [
'maxlength' => 100
]
];
Required fields and when
conditions
Required fields with when
conditions now can be left empty, if the when condition does not apply.
fields:
category:
type: radio
options:
- Photography
- Editorial
photographer:
when:
category: Photography
# the photographer field will now only be required when the category is "Photography"
required: true
Custom drag text for files and pages
You can now define custom text when files or pages get dragged into textareas. #2735
// site/config/config.php
return [
'panel' => [
'kirbytext' => [
'fileDragText' => function ($file, $url) {
return '(file: ' . $url . ' alt: ' . $page->alt() . ')';
},
'pageDragText' => function ($page) {
return '(link: ' . $page->url() . ' text: ' . $page->title() . ')';
}
]
]
];
Array support for Collection::not()
When filtering collections, you can now pass an array of IDs or objects to Collection::not()
$menu = $site->children()->not(['home', 'error'])
// or
$a = page('some-page-a');
$b = page('some-page-b');
$menu = $site->children()->not([$a, $b]);
More …
V::alpha($string, $unicode = false)
andV::alphanum($string, $unicode = false)
can now support unicode characters. This can be activated with the second argument.
getkirby/ideas#234- You can now use
Asset
objects in panel previews #2746
Enhancements
- Commas are now automatically removed from sortBy options in blueprints for enhanced usability. getkirby/ideas#195
# now both versions work
sortBy: date desc title desc
sortBy: date desc, title desc
- We've increased test coverage for our PHP code from 84% to 90% 🎉
- We've massively improved our doc block comments and type hints throughout our code base
- The file dropdown is now better visually structured with horizontal lines – consistent with the look and feel of the page dropdown. #2787
$tableWhitelist
in the Database class is now renamed to$tables
and a validity check for correct table names is fixed. #2788- The
beforeSend
option for emails can now be predefined in the config #2769
Bug fixes
- Fixed off-center emoji position in the panel
- Fixed overflowing text in breadcrumb #2755
- Fixed broken
this.$api.users.list()
method (this broke pagination and the role filter in the users view) #2801 - Parsedown Extra no longer trims new line characters in some PHP environments
- Fixed progress bar styling in Firefox #2784
- You can now add pages in pages sections within user blueprints without errors #2771
- Converting the
$site
object to string now returns the URL instead of throwing an error #2802
Stats
- 101 commits
- 32 closed issues and PRs
3.4.2
This release is a quick patch for an annoying regression in 3.4.1 and a useful bug fix.
Fixed template switching regression (#2758)
We broke template switching in 3.4.1 and we are really sorry for it. This patch release will fix this regression. If your projects rely on template switching for pages, you should upgrade!
Fixed endless loop for users without access to the site view (#2760)
When you create user roles that don't have access to the site view with
# /site/blueprints/users/my-role.yml
permissions:
access:
site: false
... those users will be stuck in an endless loop after login, because they are not allowed to visit the site view, which is the default view. This release will fix this and redirect such users to their own account.
Summer break
We wanted to get this release out there before our summer holiday break. We will be back on September 1st with new features, new fixes and new energy. See you soon!
3.4.1
New Features
New Gap field
The new gap field is a simple layout field to help you organise your fields more visually and create gaps in the field grid.
fields:
category:
type: text
width: 1/2
gap:
type: gap
width: 1/4
featured:
type: toggle
width: 1/4
text:
- "no"
- "yes"
With conditional fields
fields:
hasHeadline:
type: radio
options:
- yes
- no
headline:
type: text
width: 1/2
when:
hasHeadline: yes
gap:
type: gap
width: 1/2
when:
hasHeadline: no
text:
type: textarea
Async api library
All API methods in the Panel now support async await as an alternative to promise callbacks. This helps to break out of callback hell.
const page = await this.$api.pages.get("photography");
console.log(page.title);
New beforeSend
option for $kirby->email()
You can now access the phpMailer instance for more fine-grained control in the new beforeSend
option:
$kirby->email([
'from' => '[email protected]',
'to' => '[email protected]',
'subject' => 'Thank you for your contact request',
'body' => 'We will never reply',
'transport' => [
'type' => 'smtp',
'host' => 'mail.getkirby.com',
'port' => 465,
'security' => true,
'auth' => true,
'username' => '[email protected]',
'password' => 'randomString',
],
// new feature
'beforeSend' =>function ($mailer) {
$mailer->SMTPOptions = [
'ssl' => [
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
]
];
return $mailer;
}
]);
You can also use this new option in email presets in your config file.
New Dark Mode SVG favicon
For Dark Mode users, the favicon of the panel will now automatically switch color and adjust to the dark browser bar.
More new features …
- New
Form::content()
method - New
Vue.$helper.string.camelToKebab(string)
helper - New
Vue.$helper.isComponent(componentName)
helper - Async store actions
Enhancements
- Added unit tests for LanguageRoutes #2609
- Added missing hooks unit tests
- We brought
Kirby\Http\Request\Query
in line withKirby\Http\Query
#2692
Fixes
We introduced an unintentional breaking change in 3.4.0 that broke plugin options in some third-party plugins. 3.4.1 reverts this breaking change. All plugins that already shipped a fix for this breaking change unfortunately have to roll back that fix as well. We are sorry for the hassle! (You can read more about the issue here: #2697)
More fixes …
- Fixed
words
option forCollection::search()
#2698 - Fixed error page in multilang setup #2609
- Fixed issues with Umlauts in user email addresses #2600
- Pass
$originalPage
inpage.duplicate:after
hook to fix breaking change - Structure fields no longer save unsaveable fields #2702
- Fixed warning in Account view after logout #2713
- Fixed warning in Settings view after logout
- Set fixed types in fields to avoid issues in extended fields #2643
translate: false
in a child of a structure field no longer savesnull
on secondary language #1602- Fixed certificate issue in
Remote::post()
requests #2745 - Fixed unexpected behaviour in
Html::tag()
method #2743
3.4.0 - Furcifer
New Features
Search for files in the Panel 🎉
Our global search in the Panel now also searches for files.
Extensible search
The Panel search is now also a core component and can be overwritten with your own search logic (#2368):
Kirby::plugin('distantnative/fuzzy-search', [
'components' => [
'search' => function (Kirby $kirby, Collection $collection, string $query = null, $params = []) {
// ...
return $collection;
}
]
]);
Big hook improvements & wildcard hooks 🔥
- Hook arguments are now named and magically provided as requested (like in controllers). So it's now possible to just request the arguments the hook needs and in any order. Arguments that are not available will be set to
null
. - Support for wildcard hooks (e.g.
page.*:before
orpage.create:*
or*.create:*
– all variations are supported!) that will be triggered for all event actions of the given type. - New
$event
object provided as argument for all hooks that contains all information about the triggered event. The$event
argument can be used instead of or in addition to the individual hook arguments.
return [
'hooks' => [
'page.*:before' => function ($page, $event) {
var_dump($page); // $page
var_dump($event->name()); // 'page.create:before'
var_dump($event->type()); // 'page'
var_dump($event->action()); // 'create'
var_dump($event->state()); // 'before'
var_dump($event->page()); // $page
var_dump($event->input()); // $input
}
]
];
Breaking-changes:
- The method signature of
$app->apply()
and$app->trigger()
has changed. Instead of a list of arguments, they now receive an associative array with named arguments.$app->apply()
now also requires a third argument that tells the method which argument should be modified by the hooks. As both methods are marked for internal use and also not very useful in sites, the only use-case for them so far was hooks defined in plugins. Plugin authors who depend on any of the two changed methods need to update their plugins to support the new signature. - As the hook arguments are now detected by name and not by order, any hooks that don't use the variable naming as documented in the reference will receive
null
for those arguments instead.
Hook migration checker plugin
@lukasbestle has developed a migration checker plugin to help check for broken hooks in your installations. You can find the plugin attached to this release (as an "Asset") or download it from GitHub Gist. Please place the PHP file in site/plugins/migration/index.php
and visit any frontend page of your Kirby site to check if you need to migrate some of your hooks. Make sure to delete the plugin again after the migration.
New Structure Field features
Duplicate option
Duplicating is enabled by default. To disable, use the following syntax:
fields:
addresses:
type: structure
duplicate: false
fields:
...
...
Prepend new entries
With the new prepend
option for structure fields, you can now add new entries to the top of the list instead of the bottom (getkirby/ideas#203)
fields:
addresses:
type: structure
prepend: true
fields:
...
...
New confirmation dialog to revert unsaved changes
To prevent that unsaved changes can be accidentally deleted with the click of a button, we introduced a new confirmation dialog:
Support for parentheses in KirbyTags (finally!)
You can finally write parentheses in KirbyTags. For example:
(image: my-image.jpg caption: A nice picture (by Ansel Adams))
A huge Thank-you to @afbora for his StackOverflow hunt in order to find a proper solution.
New collection filters for dates
There are now date-specific collection filters that can be used like this:
$collection->filterBy('date', 'date >=', 'today');
The advantage of these filters is that all date formats that can be parsed by PHP are supported (both in the fields and in the test string).
The added filters are:
date ==
date !=
date >
date >=
date <
date <=
date between
(ordate ..
)
This feature is built on top of our enhanced V::date()
validator. You can now also do the following validations with it:
V::date($dateA, '==', $dateB);
V::date($dateA, '!=', $dateB);
V::date($dateA, '>', $dateB);
V::date($dateA, '>=', $dateB);
V::date($dateA, '<', $dateB);
V::date($dateA, '<=', $dateB);
$kirby->impersonate(): Support for action function
It is now possible to pass an action function to $kirby->impersonate()
, which will run with the permissions of the impersonated user. The impersonated user is reset after the function has returned:
$result = $kirby->impersonate('kirby', function ($user) {
// $this is the $kirby object
$email = $user->email(); // '[email protected]'
return 'this will be returned to $result above';
});
New files.read
permission
It is now possible to hide files of a specific template from users with a specific role (or to hide files in general) (getkirby/ideas#554)
New search
settings for the multiselect field
You can now fine-tune the search experience in multiselect fields. This is especially useful if you are providing long lists of options and the result list gets unusable.
fields:
categories:
label: Categories
type: multiselect
search:
# The search starts after entering at least 2 characters
min: 2
# The result list has a limit of 5 entries but can be expanded
display: 5
options:
panel: Panel
templating: Templating
seo: SEO
security: Security
performance: Performance
analytics: Analytics
assets: Assets
text: Text
forms: Forms
utilities: Utilities
integrations: Integrations
social: Social
New callback method for fields
It's sometimes useful to modify a field directly in a controller or template. This can now be done with the new callback field method.
echo $page->title()->callback(function ($field) {
$field->value = 'Title: ' . $field->value;
return $field;
});
New global collectionMethods
extension
Kirby::plugin('your-name/collectionMethods', [
'collectionMethods' => [
'toCSV' => function () {
// write some code to convert the entire
// collection to CSV
}
]
]);
The new toCSV
method in this plugin example will now be available for all collections in Kirby (pages, files, users, etc.)
(getkirby/ideas#352)
New servers
option
To overwrite Kirby's server check you can now set the servers
option in your config. This can be used to run the Panel, even though the server setup might not officially be supported by us. It's at your own risk though.
return [
'servers' => ['apache', 'nginx', 'symfony']
];
New way to access native component handlers
When creating your own core components – to manipulate URLs, create thumbnails, parse markdown or more – you can now easily access the native behaviour of Kirby's components with the new $kirby->nativeComponent($componentName)
method.
Kirby::plugin('your-name/url-handler', [
'components' => [
'url' => function (Kirby $kirby, string $path = null, $options = null) {
if (Str::startsWith($path, '@forum')) {
return 'https://forum.mydomain.com/' . str_replace('@forum/', '', $path);
}
return $kirby->nativeComponent('url')($kirby, $path, $options);
}
]
]);
There's more…
- New
image: icon
andimage: false
options for items in pages or files sections. - Added support for embedding YouTube playlists in the
youtube
andvideo
KirbyTags as well as inHtml::youtube()
andHtml::video()
(getkirby/ideas#532) - Added support for YouTube options (customizable player) in the
youtube
andvideo
KirbyTags as well as inHtml::video()
andHtml::youtube()
(getkirby/ideas#437) - Form fields now support a simple string as validation rule.
- Permissions: You can now set your own actions in user blueprints and use them in your plugins to check for custom permissions.
- New
Kirby\Data\Xml
class and support for XML inData::encode($data, 'xml')
andData::decode($xml, 'xml')
- Added
..
as an alias for thebetween
collection filter - New
$page->go()
method, which automatically triggers a redirect to the page. - New global
$kirby->contentToken()
method (getkirby/ideas#554) - More complex tokens for page drafts and media URLs with the new
content.salt
option (#2612, getkirby/ideas#554) - New
F::loadOnce()
method (#2394) F::load()
: Support fo...
3.3.6
While we are busy working on 3.4, this release is a security patch for a minor issue related to .dev domains and reverse proxies.
About our registration block
In order to protect new installations on public servers that don't have an admin account for the Panel yet, we block account registration there by default. This is a security feature, which we implemented years ago in Kirby 2. It helps to avoid that you forget registering your first admin account on a public server.
In this case – without our security block – someone else might theoretically be able to find your site, find out it's running on Kirby, find the Panel and then register the account first. It's an unlikely situation, but it's still a certain risk.
To be able to register the first Panel account on a public server, you have to enforce the installer via a config setting. This helps to push all users to the best practice of registering your first Panel account on your local machine and upload it together with the rest of the site.
The issue
As noted by Jukka Rautanen, this installation block still assumed that .dev domains are local domains, which is no longer true. In the meantime, those domains became publicly available. This means that our installation block is no longer working as expected if you use a .dev domain for your Kirby site. We've also used the chance to improve the local installation check if your site is behind a reverse proxy.
Am I affected?
You are only affected if:
- you use a .dev domain or your site is behind a reverse proxy &
- you have not yet registered your first Panel account on the public server &
- someone finds your site and tries to login at
yourdomain.dev/panel
before you register your first account.
You are not affected if you have already created one or multiple Panel accounts (no matter if on a .dev domain or behind a reverse proxy).
3.3.5
New Features
$page->isPublished()
You can use the new $page->isPublished()
method as the opposite of $page->isDraft()
, which will include $page->isListed()
and $page->isUnlisted()
states. getkirby/ideas#375
New translation selectors
The panel DOM has new CSS multi-lang selectors, which you can use to customize the panel based on the currently selected translation.
.k-panel[data-translation=en] {}
.k-panel[data-translation-default] {}
.k-panel:not([data-translation-default]) {}
.k-panel:not([data-translation-default]) .k-field:not([data-translate]) {}
Custom collection for siblings methods
You can now pass a collection to all sibling methods to get more useful results #2321
$prevPage = $page->prev(
$page
->index()
->listed()
->filterBy('template', 'text-note')
->sortBy('date', 'desc')
);
This works for all siblings methods for pages, files and users:
- indexOf
- isFirst
- isLast
- isNth
- hasNext
- hasNextListed ($page)
- hasNextUnlisted ($page)
- hasPrev
- hasPrevListed ($page)
- hasPrevUnlisted ($page)
- next
- nextAll
- nextListed ($page)
- nextUnlisted ($page)
- prev
- prevAll
- prevListed ($page)
- prevUnlisted ($page)
Dir::exists($path)
We've added a new Dir::exists($path)
method to the toolkit to keep it consistent with the F class and its F::exists($path)
method
Enhancements
- The textarea field uses CMD + K instead of CMD + L for the link shortcut for better compatibility #1898
- Improved button labels in picker fields
- Improved page redirection on for detected languages #2484
- The
uploads
option is now checked before accepting dropped files in textareas #2482 - Added support for late binding in
FileActions
to enable subclasses of File - Kirby string queries now support numeric parts in the query #2462
- We've improved our PHPUnit test speed by a huge margin
- Updated Czech translation
Fixes
- Fixed translation and language issue with routing in multi-lang setups #2428
- Fixed overflowing cards in narrow columns #1666
- Fixed z-index issue in sticky columns with dialogs #2477
- Fixed passing data to
kirbytag()
helper #2474 - Cached user data for the authenticated user is now refreshed correctly on
$user->update()
#2486 - Empty locales in the language dialog are now reliably caught #2455
- Fixed overflow for long filenames in dialogs and view titles #2449
- Fixed upload progress bar #2463
- Fixed dialog width on mobile #2415
- Fixed site title on language switch #2396
- The locale array in language files is now always added in a human-readable way #2426
- Fixed controller data for content representations if PHP template is not present #2471
Stats
- 41 commits
- 38 closed tickets & PRs
- Days since last release: 28
- Contributors: @afbora, @bastianallgeier, @distantnative, @lukasbestle, @weese
3.3.4
New features
- New
sticky
option for columns in blueprints getkirby/ideas#284
columns:
- width: 1/3
sticky: true
sections: ...
- New Korean Slug Rules (a huge thank you to: Min Guhong)
- New
$fileCache->root()
method getkirby/ideas#390 - New themeless mode for info sections and info fields
fields:
info:
type: info
text: Some info text
theme: none
Enhancements
- Fixed excerpt method with support for unicode chars #2420
- Cache blueprint extends #2364
- Disabled fields have a lower opacity now
- The icon option in the tags field does now also set the icon in the dropdown #2438
Fixes
- Structure field: Fixed preview for the value
0
#2423 - Search: fixed upper- and lowercase characters for languages with diacritics #2408
- Tags field: fixed smaller issues around backspace delete and arrow navigation #2403
- Fixed disabled status icon position on card layouts in the Panel #2412
- Clear lock if user not found for locked page #2333
- Fix language path for pattern #2345
- Fix decimals float on number field #2372
- The language name is now correctly validated when updating a language #2436
- The missing page title error message in the page creation dialog is now correctly translated #2441
Stats
- 35 commits
- 29 closed tickets & PRs
- Days since last release: 22
- Contributors: @afbora, @bastianallgeier, @distantnative, @lukasbestle
3.3.3
Enhancements
- The
files
blueprint preset has a newimage
option #2272 - We've updated all our JS dependencies for the panel
- We've added Japanese slug rules #2334
- You can now replace files with the same extension but different mime types #1783
- We've normalized
greyscale
,grayscale
andbw
as thumb options. You can now also use$image->greyscale()
,$image->grayscale()
or$image->bw()
to achieve the same. Keep the typos coming :) #2384 - We've switched from Zend Framework to Laminas for the Escaper class #2390
- Our translators updated Danish (da), Swedish (sv_SV) and Korean (ko)
Fixes
- The timezone bug in date fields is fixed #2349
- We've added fallbacks for the grab cursor on drag handles #2354
- Links with anchors are now handled correctly on multi language sites #2280
- The correct path is used when you drag files into textareas #2366
- Kirby uses a more reliable way to load roles #2383
- The search in the filepicker for textareas is fixed #2388
3.3.2
New Features
- PHP 7.4 support
- Support for address names when sending email getkirby/ideas#42
Enhancements
- Updated translations
- Sticky headers for structure tables #2328
- Remote class: Enhancements to headers #2322
- Support associative arrays for the headers option (
'Accept' => 'application/json'
should become'Accept: application/json'
automatically) - Add support for the
CURLOPT_USERPWD
option with a newbasicAuth
option
- Support associative arrays for the headers option (
- Mime class: add missing
text/csv
mime type #2316 F
class: Option to disable base64 encoding indataUri()
method #2276- Clicking on the language in the Settings view now opens the edit dialog #2264
- The
k-link
component now allows passing a callback function asto
prop.ListItem
andCards
support passing callback function aslink
prop