X Tutup
Skip to content

Commit 9614d64

Browse files
committed
extend share_external name column length to 255
1 parent b9e4f61 commit 9614d64

File tree

4 files changed

+51
-8
lines changed

4 files changed

+51
-8
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
/**
3+
* @author Semih Serhat Karakaya <karakayasemi@itu.edu.tr>
4+
*
5+
* @copyright Copyright (c) 2020, ownCloud GmbH
6+
* @license AGPL-3.0
7+
*
8+
* This code is free software: you can redistribute it and/or modify
9+
* it under the terms of the GNU Affero General Public License, version 3,
10+
* as published by the Free Software Foundation.
11+
*
12+
* This program is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU Affero General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU Affero General Public License, version 3,
18+
* along with this program. If not, see <http://www.gnu.org/licenses/>
19+
*
20+
*/
21+
namespace OCA\Files_Sharing\Migrations;
22+
23+
use Doctrine\DBAL\Schema\Schema;
24+
use OCP\Migration\ISchemaMigration;
25+
26+
/**
27+
* Extend name column length to 255
28+
*/
29+
class Version20200823121322 implements ISchemaMigration {
30+
public function changeSchema(Schema $schema, array $options) {
31+
$prefix = $options['tablePrefix'];
32+
if ($schema->hasTable("${prefix}share_external")) {
33+
$table = $schema->getTable("{$prefix}share_external");
34+
$nameColumn = $table->getColumn('name');
35+
if ($nameColumn && $nameColumn->getLength() !== 255) {
36+
$nameColumn->setOptions(['length' => 255]);
37+
}
38+
}
39+
}
40+
}

apps/files_sharing/appinfo/info.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Turning the feature off removes shared files and folders on the server for all s
1010
<licence>AGPL</licence>
1111
<author>Michael Gapczynski, Bjoern Schiessle</author>
1212
<default_enable/>
13-
<version>0.13.0</version>
13+
<version>0.13.1</version>
1414
<types>
1515
<filesystem/>
1616
</types>

changelog/unreleased/37835

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Bugfix: Allow federated share name up to 255 character
2+
3+
Receiving a federated share of a file with name greater than 63 characters was not possible.
4+
This problem has been resolved by extending related column length of database to 255.
5+
6+
https://github.com/owncloud/core/issues/36730
7+
https://github.com/owncloud/core/pull/37835

tests/acceptance/features/webUISharingExternal1/federationSharing.feature

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -192,17 +192,13 @@ Feature: Federation Sharing - sharing with users on other cloud storages
192192
And as "Brian" file "/simple-folder (2)/lorem.txt" should exist
193193
When the user opens folder "simple-folder (2)" using the webUI
194194
Then it should not be possible to delete file "lorem.txt" using the webUI
195-
196-
@issue-36730
195+
197196
Scenario: test sharing long file names with federation share
198197
When user "Alice" moves file "/lorem.txt" to "/averylongfilenamefortestingthatfileswithlongfilenamescannotbeshared.txt" using the WebDAV API
199198
And the user has reloaded the current page of the webUI
200199
And the user shares file "averylongfilenamefortestingthatfileswithlongfilenamescannotbeshared.txt" with remote user "Alice" with displayname "%username%@%remote_server_without_scheme%" using the webUI
201-
# And user "Alice" from server "REMOTE" accepts the last pending share using the sharing API
202-
And using server "REMOTE"
203-
Then user "Alice" should not have any received shares
204-
# Then as "Alice" file "/averylongfilenamefortestingthatfileswithlongfilenamescannotbeshared.txt" should exist
205-
Then as "Alice" file "/averylongfilenamefortestingthatfileswithlongfilenamescannotbeshared.txt" should not exist
200+
And user "Alice" from server "REMOTE" accepts the last pending share using the sharing API
201+
Then as "Alice" file "/averylongfilenamefortestingthatfileswithlongfilenamescannotbeshared.txt" should exist
206202

207203
Scenario: sharee should be able to access the files/folders inside other folder
208204
Given user "Alice" has created folder "simple-folder/simple-empty-folder"

0 commit comments

Comments
 (0)
X Tutup