Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
f77c6dbb
Commit
f77c6dbb
authored
9 years ago
by
Thomas Müller
Browse files
Options
Downloads
Plain Diff
Merge pull request #20431 from owncloud/carddav-enforce-displayname
When creating addressbooks, make sure the displayname is set
parents
cc432131
06d1685e
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
apps/dav/lib/carddav/carddavbackend.php
+7
-1
7 additions, 1 deletion
apps/dav/lib/carddav/carddavbackend.php
apps/dav/tests/unit/carddav/carddavbackendtest.php
+1
-0
1 addition, 0 deletions
apps/dav/tests/unit/carddav/carddavbackendtest.php
with
8 additions
and
1 deletion
apps/dav/lib/carddav/carddavbackend.php
+
7
−
1
View file @
f77c6dbb
...
...
@@ -134,7 +134,7 @@ class CardDavBackend implements BackendInterface, SyncSupport {
* @param string $principalUri
* @param string $url Just the 'basename' of the url.
* @param array $properties
* @
return void
* @
throws BadRequest
*/
function
createAddressBook
(
$principalUri
,
$url
,
array
$properties
)
{
$values
=
[
...
...
@@ -160,6 +160,12 @@ class CardDavBackend implements BackendInterface, SyncSupport {
}
// Fallback to make sure the displayname is set. Some clients may refuse
// to work with addressbooks not having a displayname.
if
(
is_null
(
$values
[
'displayname'
]))
{
$values
[
'displayname'
]
=
$url
;
}
$query
=
$this
->
db
->
getQueryBuilder
();
$query
->
insert
(
'addressbooks'
)
->
values
([
...
...
This diff is collapsed.
Click to expand it.
apps/dav/tests/unit/carddav/carddavbackendtest.php
+
1
−
0
View file @
f77c6dbb
...
...
@@ -60,6 +60,7 @@ class CardDavBackendTest extends TestCase {
$books
=
$this
->
backend
->
getAddressBooksForUser
(
self
::
UNIT_TEST_USER
);
$this
->
assertEquals
(
1
,
count
(
$books
));
$this
->
assertEquals
(
'Example'
,
$books
[
0
][
'{DAV:}displayname'
]);
// update it's display name
$patch
=
new
PropPatch
([
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment