Skip to content

Commit

Permalink
Merge pull request #6485 from getkirby/release/4.3.0
Browse files Browse the repository at this point in the history
4.3.0
  • Loading branch information
bastianallgeier authored Jun 13, 2024
2 parents c1e6ff7 + 77ee5d7 commit f9f00b1
Show file tree
Hide file tree
Showing 197 changed files with 3,187 additions and 1,748 deletions.
28 changes: 21 additions & 7 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,45 @@
## This PR …
## Description
<!--
A clear and concise description of the PR.
Use this section for review hints, explanations or discussion points/todos.
Make sure to point your PR to the relevant develop branches, e.g.
`develop-patch`, `develop-minor` or `v5/develop`
How to contribute: https://contribute.getkirby.com
-->

### Summary of changes



### Reasoning



### Additional context



## Changelog
<!--
Add relevant release notes: Features, Enhancements, Fixes, Deprecated.
Reference issues from the `kirby` repo or ideas from `feedback.getkirby.com`.
Always mention whether your PR introduces breaking changes.
How to contribute: https://contribute.getkirby.com
-->

### Fixes



### Breaking changes



## Docs
<!--
Add any notes that help to document the feature/changes. Doesn't need
to be your best writing, just a few words and/or code snipptets.
to be your best writing, just a few words and/or code snippets.
-->


Expand All @@ -32,13 +48,11 @@ to be your best writing, just a few words and/or code snipptets.
<!--
If you can help to check off the following tasks, that'd be great.
If not, don't worry - we will take care of it.
More details: https://contribute.getkirby.com
-->

- [ ] In-code documentation (wherever needed)
- [ ] Unit tests for fixed bug/feature
- [ ] Tests and checks all pass
- [ ] Tests and CI checks all pass

### For review team
<!--
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "The Kirby core",
"license": "proprietary",
"type": "kirby-cms",
"version": "4.2.0",
"version": "4.3.0",
"keywords": [
"kirby",
"cms",
Expand Down Expand Up @@ -37,7 +37,7 @@
"ext-mbstring": "*",
"ext-openssl": "*",
"christian-riesen/base32": "1.6.0",
"claviska/simpleimage": "4.1.0",
"claviska/simpleimage": "4.2.0",
"composer/semver": "3.4.0",
"filp/whoops": "2.15.4",
"getkirby/composer-installer": "^1.2.1",
Expand All @@ -46,7 +46,7 @@
"phpmailer/phpmailer": "6.9.1",
"symfony/polyfill-intl-idn": "1.29.0",
"symfony/polyfill-mbstring": "1.29.0",
"symfony/yaml": "6.4.3"
"symfony/yaml": "6.4.8"
},
"replace": {
"symfony/polyfill-php72": "*"
Expand Down
40 changes: 20 additions & 20 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion config/areas/site/searches.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
'text' => Escape::html($page->title()->value()),
'link' => $page->panel()->url(true),
'info' => Escape::html($page->id()),
'uuid' => $page->uuid()->toString(),
'uuid' => $page->uuid()?->toString(),
]),
'pagination' => $pages->pagination()->toArray()
];
Expand Down
1 change: 1 addition & 0 deletions config/areas/system/views.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
'props' => [
'environment' => $environment,
'exceptions' => $kirby->option('debug') === true ? $exceptions : [],
'info' => $system->info(),
'plugins' => $plugins,
'security' => $security,
'urls' => [
Expand Down
2 changes: 1 addition & 1 deletion config/presets/page.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
}

if (empty($sidebar) === true) {
$props['fields'] = $props['fields'] ?? [];
$props['fields'] ??= [];

unset(
$props['files'],
Expand Down
2 changes: 1 addition & 1 deletion config/presets/pages.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

// inject the global templates definition
if (empty($templates) === false) {
$props['templates'] = $props['templates'] ?? $templates;
$props['templates'] ??= $templates;
}

return array_replace_recursive($defaults, $props);
Expand Down
66 changes: 49 additions & 17 deletions config/sections/pages.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,39 @@
return false;
}

if (in_array($this->status, ['draft', 'all']) === false) {
if ($this->isFull() === true) {
return false;
}

if ($this->isFull() === true) {
// form here on, we need to check with which status
// the pages are created and if the section can show
// these newly created pages

// if the section shows pages no matter what status they have,
// we can always show the add button
if ($this->status === 'all') {
return true;
}

// collect all statuses of the blueprints
// that are allowed to be created
$statuses = [];

foreach ($this->blueprintNames() as $blueprint) {
try {
$props = Blueprint::load('pages/' . $blueprint);
$statuses[] = $props['create']['status'] ?? 'draft';
} catch (Throwable) {
$statuses[] = 'draft'; // @codeCoverageIgnore
}
}

$statuses = array_unique($statuses);

// if there are multiple statuses or if the section is showing
// a different status than new pages would be created with,
// we cannot show the add button
if (count($statuses) > 1 || $this->status !== $statuses[0]) {
return false;
}

Expand All @@ -249,37 +277,41 @@
'methods' => [
'blueprints' => function () {
$blueprints = [];
$templates = empty($this->create) === false ? A::wrap($this->create) : $this->templates;

if (empty($templates) === true) {
$templates = $this->kirby()->blueprints();
}

// excludes ignored templates
if ($templatesIgnore = $this->templatesIgnore) {
$templates = array_diff($templates, $templatesIgnore);
}

// convert every template to a usable option array
// for the template select box
foreach ($templates as $template) {
foreach ($this->blueprintNames() as $blueprint) {
try {
$props = Blueprint::load('pages/' . $template);
$props = Blueprint::load('pages/' . $blueprint);

$blueprints[] = [
'name' => basename($props['name']),
'title' => $props['title'],
];
} catch (Throwable) {
$blueprints[] = [
'name' => basename($template),
'title' => ucfirst($template),
'name' => basename($blueprint),
'title' => ucfirst($blueprint),
];
}
}

return $blueprints;
}
},
'blueprintNames' => function () {
$blueprints = empty($this->create) === false ? A::wrap($this->create) : $this->templates;

if (empty($blueprints) === true) {
$blueprints = $this->kirby()->blueprints();
}

// excludes ignored templates
if ($templatesIgnore = $this->templatesIgnore) {
$blueprints = array_diff($blueprints, $templatesIgnore);
}

return $blueprints;
},
],
'toArray' => function () {
return [
Expand Down
12 changes: 8 additions & 4 deletions config/tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@
'caption',
'controls',
'class',
'disablepictureinpicture',
'height',
'loop',
'muted',
Expand Down Expand Up @@ -294,12 +295,15 @@

// don't use attributes that iframe doesn't support
if ($isProviderVideo === false) {
// converts tag attributes to supported formats (listed below) to output correct html
// booleans: autoplay, controls, loop, muted
// strings : poster, preload
// for ex : `autoplay` will not work if `false` is a `string` instead of a `boolean`
// convert tag attributes to supported formats (bool, string)
// to output correct html attributes
//
// for ex:
// `autoplay` will not work if `false` is a string
// instead of a boolean
$attrs['autoplay'] = $autoplay = Str::toType($tag->autoplay, 'bool');
$attrs['controls'] = Str::toType($tag->controls ?? true, 'bool');
$attrs['disablepictureinpicture'] = Str::toType($tag->disablepictureinpicture ?? false, 'bool');
$attrs['loop'] = Str::toType($tag->loop, 'bool');
$attrs['muted'] = Str::toType($tag->muted ?? $autoplay, 'bool');
$attrs['playsinline'] = Str::toType($tag->playsinline ?? $autoplay, 'bool');
Expand Down
Loading

0 comments on commit f9f00b1

Please sign in to comment.