Skip to content

Commit eb47158

Browse files
Merge pull request #6695 from getkirby/release/4.4.1
4.4.1
2 parents d14bc47 + 4ff0da0 commit eb47158

File tree

12 files changed

+55
-98
lines changed

12 files changed

+55
-98
lines changed

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "The Kirby core",
44
"license": "proprietary",
55
"type": "kirby-cms",
6-
"version": "4.4.0",
6+
"version": "4.4.1",
77
"keywords": [
88
"kirby",
99
"cms",

composer.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/areas/site/requests.php

+10-3
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,19 @@
7070
'action' => function () {
7171
$kirby = App::instance();
7272
$request = $kirby->request();
73+
$root = $request->get('root');
7374
$page = $kirby->page($request->get('page'));
75+
$parents = $page?->parents()->flip()->values(
76+
fn ($parent) => $parent->uuid()?->toString() ?? $parent->id()
77+
) ?? [];
78+
79+
// if root is included, add the site as top-level parent
80+
if ($root === 'true') {
81+
array_unshift($parents, $kirby->site()->uuid()?->toString() ?? '/');
82+
}
7483

7584
return [
76-
'data' => $page->parents()->flip()->values(
77-
fn ($parent) => $parent->uuid()?->toString() ?? $parent->id()
78-
)
85+
'data' => $parents
7986
];
8087
}
8188
]

i18n/translations/ko.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,12 @@
126126
"error.form.notSaved": "항목을 저장할 수 없습니다.",
127127

128128
"error.language.code": "올바른 언어 코드를 입력하세요.",
129-
"error.language.create.permission": "You are not allowed to create a language",
130-
"error.language.delete.permission": "You are not allowed to delete the language",
129+
"error.language.create.permission": "언어를 등록할 권한이 없습니다.",
130+
"error.language.delete.permission": "언어를 삭제할 권한이 없습니다.",
131131
"error.language.duplicate": "이미 등록한 언어입니다.",
132132
"error.language.name": "올바른 언어명을 입력하세요.",
133133
"error.language.notFound": "언어를 찾을 수 없습니다.",
134-
"error.language.update.permission": "You are not allowed to update the language",
134+
"error.language.update.permission": "언어를 변경할 권한이 없습니다.",
135135

136136
"error.layout.validation.block": "레이아웃({layoutIndex})의 특정 블록 유형({fieldset})을 사용하는 블록({blockIndex})의 특정 필드({field})에 오류가 있습니다.",
137137
"error.layout.validation.settings": "레이아웃({index}) 옵션을 확인하세요.",
@@ -620,8 +620,8 @@
620620
"stats.empty": "관련 기록이 없습니다.",
621621
"status": "상태",
622622

623-
"system.info.copy": "Copy info",
624-
"system.info.copied": "System info copied",
623+
"system.info.copy": "정보 복사",
624+
"system.info.copied": "시스템 정보가 복사되었습니다.",
625625
"system.issues.content": "<code>/content</code> 폴더의 권한을 확인하세요.",
626626
"system.issues.eol.kirby": "설치된 Kirby 버전이 만료되었습니다. 더 이상 보안 업데이트를 받을 수 없습니다.",
627627
"system.issues.eol.plugin": "설치된 플러그인({plugin}의 지원이 종료되었습니다. 더 이상 보안 업데이트를 받을 수 없습니다.",

panel/dist/js/index.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

panel/src/components/Misc/OfflineWarning.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div v-if="$panel.isOffline" class="k-offline-warning">
2+
<div v-if="!$panel.system.isLocal && $panel.isOffline" class="k-offline-warning">
33
<p><k-icon type="bolt" /> {{ $t("error.offline") }}</p>
44
</div>
55
</template>

panel/src/components/Navigation/PageTree.vue

+15-7
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ export default {
6161
});
6262
},
6363
async open(item) {
64+
if (!item) {
65+
return;
66+
}
67+
6468
if (item.hasChildren === false) {
6569
return false;
6670
}
@@ -79,30 +83,34 @@ export default {
7983
// get array of parent uuids/ids
8084
const response = await this.$panel.get("site/tree/parents", {
8185
query: {
82-
page
86+
page,
87+
root: this.root
8388
}
8489
});
8590
const parents = response.data;
8691
87-
// if root is included, add the site as top-level parent
88-
if (this.root) {
89-
parents.unshift("site://");
90-
}
91-
9292
let tree = this;
9393
9494
// go through all parents, try to find the matching item,
9595
// open it and pass forward the pointer to that tree component
9696
for (let index = 0; index < parents.length; index++) {
9797
const value = parents[index];
9898
const item = tree.findItem(value);
99+
100+
if (!item) {
101+
return;
102+
}
103+
99104
await this.open(item);
100105
tree = tree.$refs[value][0];
101106
}
102107
103108
// find current page in deepest tree and trigger select listeners
104109
const item = tree.findItem(page);
105-
this.$emit("select", item);
110+
111+
if (item) {
112+
this.$emit("select", item);
113+
}
106114
}
107115
}
108116
};

src/Cms/LanguageRoutes.php

+1-19
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace Kirby\Cms;
44

55
use Kirby\Filesystem\F;
6-
use Kirby\Toolkit\Str;
76

87
class LanguageRoutes
98
{
@@ -30,26 +29,9 @@ public static function create(App $kirby): array
3029
'pattern' => $language->pattern(),
3130
'method' => 'ALL',
3231
'env' => 'site',
33-
'action' => function ($path = null) use ($kirby, $language) {
32+
'action' => function ($path = null) use ($language) {
3433
$result = $language->router()->call($path);
3534

36-
// redirect secondary-language pages that have
37-
// been accessed with non-translated slugs in their path
38-
// to their fully translated URL
39-
if ($path !== null && $result instanceof Page) {
40-
if (Str::endsWith($result->url(), $path) === false) {
41-
$url = $result->url();
42-
$query = $kirby->request()->query()->toString();
43-
44-
// preserve query across redirect
45-
if (empty($query) === false) {
46-
$url .= '?' . $query;
47-
}
48-
49-
return $kirby->response()->redirect($url);
50-
}
51-
}
52-
5335
// explicitly test for null as $result can
5436
// contain falsy values that should still be returned
5537
if ($result !== null) {

src/Filesystem/Filename.php

+5-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace Kirby\Filesystem;
44

5-
use Kirby\Cms\App;
65
use Kirby\Cms\Language;
76
use Kirby\Toolkit\Str;
87

@@ -49,7 +48,8 @@ class Filename
4948
public function __construct(
5049
protected string $filename,
5150
protected string $template,
52-
protected array $attributes = []
51+
protected array $attributes = [],
52+
protected string|null $language = null
5353
) {
5454
$this->name = $this->sanitizeName($filename);
5555
$this->extension = $this->sanitizeExtension(
@@ -234,13 +234,12 @@ protected function sanitizeName(string $name): string
234234
{
235235
// temporarily store language rules
236236
$rules = Str::$language;
237-
$kirby = App::instance(null, true);
238237

239-
// if current user, add rules for their language to `Str` class
240-
if ($user = $kirby?->user()) {
238+
// add rules for a particular language to `Str` class
239+
if ($this->language !== null) {
241240
Str::$language = [
242241
...Str::$language,
243-
...Language::loadRules($user->language())];
242+
...Language::loadRules($this->language)];
244243
}
245244

246245
// sanitize name

tests/Cms/Languages/LanguageRoutesTest.php

-38
Original file line numberDiff line numberDiff line change
@@ -122,42 +122,4 @@ public function testNotNextWhenFalsyReturn()
122122
$this->assertSame(1, $d);
123123
$this->assertSame(2, $e);
124124
}
125-
126-
public function testRedirectWhenNonTranslatedSlugs()
127-
{
128-
$app = $this->app->clone([
129-
'site' => [
130-
'children' => [
131-
[
132-
'slug' => 'page1',
133-
'translations' => [
134-
[
135-
'code' => 'en',
136-
],
137-
[
138-
'code' => 'de',
139-
'slug' => 'seite1',
140-
]
141-
]
142-
]
143-
]
144-
],
145-
'request' => [
146-
'query' => [
147-
'foo' => 'bar',
148-
]
149-
]
150-
]);
151-
152-
$result = $app->call('page1');
153-
$this->assertSame($app->page('page1'), $result);
154-
155-
$result = $app->call('de/page1');
156-
$this->assertInstanceOf(Responder::class, $result);
157-
$this->assertSame(302, $result->code());
158-
$this->assertSame('/de/seite1?foo=bar', $result->header('Location'));
159-
160-
$result = $app->call('de/seite1');
161-
$this->assertSame($app->page('page1'), $result);
162-
}
163125
}

tests/Filesystem/FilenameTest.php

+9-10
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace Kirby\Filesystem;
44

5-
use Kirby\Cms\App;
65
use Kirby\TestCase as TestCase;
76

87
/**
@@ -291,6 +290,7 @@ public function testGrayscale($prop, $value, $expected)
291290

292291
/**
293292
* @covers ::name
293+
* @covers ::sanitizeName
294294
*/
295295
public function testName()
296296
{
@@ -300,6 +300,7 @@ public function testName()
300300

301301
/**
302302
* @covers ::name
303+
* @covers ::sanitizeName
303304
*/
304305
public function testNameSanitization()
305306
{
@@ -309,18 +310,16 @@ public function testNameSanitization()
309310

310311
/**
311312
* @covers ::name
313+
* @covers ::sanitizeName
312314
*/
313-
public function testNameSanitizationUserLanguageRules()
315+
public function testNameSanitizationWithLanguageRules()
314316
{
315-
$app = new App([
316-
'users' => [
317-
['email' => '[email protected]', 'language' => 'ko']
318-
]
319-
]);
320-
321-
$app->impersonate('[email protected]');
317+
$name = new Filename(
318+
filename: '/var/www/안녕하세요.pdf',
319+
template: '{{ name }}.{{ extension }}',
320+
language: 'ko'
321+
);
322322

323-
$name = new Filename('/var/www/안녕하세요.pdf', '{{ name }}.{{ extension }}');
324323
$this->assertSame('annyeonghaseyo', $name->name());
325324
}
326325

vendor/composer/installed.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php return array(
22
'root' => array(
33
'name' => 'getkirby/cms',
4-
'pretty_version' => '4.4.0',
5-
'version' => '4.4.0.0',
6-
'reference' => NULL,
4+
'pretty_version' => '4.4.1',
5+
'version' => '4.4.1.0',
6+
'reference' => null,
77
'type' => 'kirby-cms',
88
'install_path' => __DIR__ . '/../../',
99
'aliases' => array(),
@@ -47,9 +47,9 @@
4747
'dev_requirement' => false,
4848
),
4949
'getkirby/cms' => array(
50-
'pretty_version' => '4.4.0',
51-
'version' => '4.4.0.0',
52-
'reference' => NULL,
50+
'pretty_version' => '4.4.1',
51+
'version' => '4.4.1.0',
52+
'reference' => null,
5353
'type' => 'kirby-cms',
5454
'install_path' => __DIR__ . '/../../',
5555
'aliases' => array(),

0 commit comments

Comments
 (0)