Skip to content

Commit 4bac7d5

Browse files
authored
Merge pull request #53586 from nextcloud/backport/53339/stable31
[stable31] fix: Pass over product name as capability
2 parents 4e45614 + 0a1c818 commit 4bac7d5

3 files changed

Lines changed: 13 additions & 0 deletions

File tree

apps/theming/lib/Capabilities.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public function __construct(
4141
* @return array{
4242
* theming: array{
4343
* name: string,
44+
* productName: string,
4445
* url: string,
4546
* slogan: string,
4647
* color: string,
@@ -94,6 +95,7 @@ public function getCapabilities() {
9495
return [
9596
'theming' => [
9697
'name' => $this->theming->getName(),
98+
'productName' => $this->theming->getProductName(),
9799
'url' => $this->theming->getBaseUrl(),
98100
'slogan' => $this->theming->getSlogan(),
99101
'color' => $color,

apps/theming/openapi.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
"type": "object",
8080
"required": [
8181
"name",
82+
"productName",
8283
"url",
8384
"slogan",
8485
"color",
@@ -98,6 +99,9 @@
9899
"name": {
99100
"type": "string"
100101
},
102+
"productName": {
103+
"type": "string"
104+
},
101105
"url": {
102106
"type": "string"
103107
},

apps/theming/tests/CapabilitiesTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ public function dataGetCapabilities() {
6262
return [
6363
['name', 'url', 'slogan', '#FFFFFF', '#000000', 'logo', 'background', '#fff', '#000', 'http://absolute/', true, [
6464
'name' => 'name',
65+
'productName' => 'name',
6566
'url' => 'url',
6667
'slogan' => 'slogan',
6768
'color' => '#FFFFFF',
@@ -79,6 +80,7 @@ public function dataGetCapabilities() {
7980
]],
8081
['name1', 'url2', 'slogan3', '#01e4a0', '#ffffff', 'logo5', 'background6', '#fff', '#000', 'http://localhost/', false, [
8182
'name' => 'name1',
83+
'productName' => 'name1',
8284
'url' => 'url2',
8385
'slogan' => 'slogan3',
8486
'color' => '#01e4a0',
@@ -96,6 +98,7 @@ public function dataGetCapabilities() {
9698
]],
9799
['name1', 'url2', 'slogan3', '#000000', '#ffffff', 'logo5', 'backgroundColor', '#000000', '#ffffff', 'http://localhost/', true, [
98100
'name' => 'name1',
101+
'productName' => 'name1',
99102
'url' => 'url2',
100103
'slogan' => 'slogan3',
101104
'color' => '#000000',
@@ -113,6 +116,7 @@ public function dataGetCapabilities() {
113116
]],
114117
['name1', 'url2', 'slogan3', '#000000', '#ffffff', 'logo5', 'backgroundColor', '#000000', '#ffffff', 'http://localhost/', false, [
115118
'name' => 'name1',
119+
'productName' => 'name1',
116120
'url' => 'url2',
117121
'slogan' => 'slogan3',
118122
'color' => '#000000',
@@ -151,6 +155,9 @@ public function testGetCapabilities($name, $url, $slogan, $color, $textColor, $l
151155
$this->theming->expects($this->once())
152156
->method('getName')
153157
->willReturn($name);
158+
$this->theming->expects($this->once())
159+
->method('getProductName')
160+
->willReturn($name);
154161
$this->theming->expects($this->once())
155162
->method('getBaseUrl')
156163
->willReturn($url);

0 commit comments

Comments
 (0)