Skip to content

Add all properties while creating a subscription - #25231

Closed
tcitworld wants to merge 3 commits into
owncloud:masterfrom
tcitworld:add-all-properties-create-subscription
Closed

tcitworld wants to merge 3 commits into
owncloud:masterfrom
tcitworld:add-all-properties-create-subscription

Conversation

@tcitworld

Copy link
Copy Markdown
Contributor

Should fix issue #24469

This is my first PR, please don't eat me. :-)

@mention-bot

Copy link
Copy Markdown

By analyzing the blame information on this pull request, we identified @DeepDiver1975, @nickvergessen and @LukasReschke to be potential reviewers

@ghost

ghost commented Jun 22, 2016

Copy link
Copy Markdown

@tcitworld

Thanks a lot for your contribution!
Contributions to the core repo require a signed contributors agreement http://owncloud.org/about/contributor-agreement/

Alternatively you can add a comment here where you state that this contribution is MIT licensed.

Some more details about out pull request workflow can be found here: http://owncloud.org/code-reviews-on-github/

@tcitworld

Copy link
Copy Markdown
Contributor Author

And for now, MIT licensed.

@DeepDiver1975

Copy link
Copy Markdown
Contributor

This is my first PR, please don't eat me. :-)

No worries - THX

May I ask you to add unit tests? Ping me or @georgehrke on irc in case you need a helping hand.

And for now, MIT licensed.

THX

@DeepDiver1975 DeepDiver1975 added this to the 9.1-current milestone Jun 22, 2016
@ghost

ghost commented Jun 23, 2016

Copy link
Copy Markdown

@tcitworld

Thanks a lot for your contribution!
Contributions to the core repo require a signed contributors agreement http://owncloud.org/about/contributor-agreement/

Alternatively you can add a comment here where you state that this contribution is MIT licensed.

Some more details about out pull request workflow can be found here: http://owncloud.org/code-reviews-on-github/

1 similar comment
@ghost

ghost commented Jun 23, 2016

Copy link
Copy Markdown

@tcitworld

Thanks a lot for your contribution!
Contributions to the core repo require a signed contributors agreement http://owncloud.org/about/contributor-agreement/

Alternatively you can add a comment here where you state that this contribution is MIT licensed.

Some more details about out pull request workflow can be found here: http://owncloud.org/code-reviews-on-github/

@tcitworld

Copy link
Copy Markdown
Contributor Author

Tests added.

@DeepDiver1975

Copy link
Copy Markdown
Contributor

Tests added.

THX @tcitworld - let's see what Jenkins says about it .... #25280

@ghost

ghost commented Jun 28, 2016

Copy link
Copy Markdown

@tcitworld

Thanks a lot for your contribution!
Contributions to the core repo require a signed contributors agreement http://owncloud.org/about/contributor-agreement/

Alternatively you can add a comment here where you state that this contribution is MIT licensed.

Some more details about out pull request workflow can be found here: http://owncloud.org/code-reviews-on-github/

@DeepDiver1975

Copy link
Copy Markdown
Contributor

@tcitworld please consider signing the CLA - this will grant you full access to the git repo and you can work on branches within the repo. CI will work then much easier - for all of us 😉

@tcitworld

Copy link
Copy Markdown
Contributor Author

Done.

@DeepDiver1975

Copy link
Copy Markdown
Contributor

Jenkins is green on #25280

@DeepDiver1975

Copy link
Copy Markdown
Contributor

👍

@DeepDiver1975

Copy link
Copy Markdown
Contributor

@georgehrke mind testing? THX

Comment thread apps/dav/lib/CalDAV/CalDavBackend.php Outdated
$values[$dbName] = $properties[$xmlName];
$fieldNames[] = $dbName;
} else {
if ($dbName == 'calendarorder') {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I enforce default values to null (and 0 when database needs it). This part can be removed though.

@georgehrke

Copy link
Copy Markdown
Contributor

code looks good otherwise to me. Will test asap

@georgehrke

georgehrke commented Jun 29, 2016 •

Copy link
Copy Markdown
Contributor
<A:mkcol xmlns:A="DAV:">
    <A:set>
        <A:prop>
            <B:subscribed-strip-attachments xmlns:B="http://calendarserver.org/ns/" />
            <B:subscribed-strip-todos xmlns:B="http://calendarserver.org/ns/" />
            <A:resourcetype>
                <A:collection />
                <B:subscribed xmlns:B="http://calendarserver.org/ns/" />
            </A:resourcetype>
            <E:calendar-color xmlns:E="http://apple.com/ns/ical/">#1C4587FF</E:calendar-color>
            <A:displayname>Jewish holidays</A:displayname>
            <C:calendar-description xmlns:C="urn:ietf:params:xml:ns:caldav">Foo</C:calendar-description>
            <E:calendar-order xmlns:E="http://apple.com/ns/ical/">19</E:calendar-order>
            <B:source xmlns:B="http://calendarserver.org/ns/">
                <A:href>webcal://www.webcal.fi/cal.php?id=49&amp;format=ics&amp;wrn=1&amp;wp=1&amp;wf=26&amp;color=%231C4587&amp;cntr=us&amp;lang=en&amp;rid=wc</A:href>
            </B:source>
            <E:refreshrate xmlns:E="http://apple.com/ns/ical/">P1W</E:refreshrate>
            <B:subscribed-strip-alarms xmlns:B="http://calendarserver.org/ns/" />
        </A:prop>
    </A:set>
</A:mkcol>
  • the database fields striptodos, stripalarms and stripattachments remain null.

@georgehrke

Copy link
Copy Markdown
Contributor

@tcitworld I used https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo?hl=en-US to send a MKCOL request using the mentioned payload and checked the db afterwords. Nothing fancy with Calendar.app.

@tcitworld

Copy link
Copy Markdown
Contributor Author

The $properties array shows up like this for your request :

Array
(
    [{http://calendarserver.org/ns/}subscribed-strip-attachments] => 
    [{http://calendarserver.org/ns/}subscribed-strip-todos] => 
    [{http://apple.com/ns/ical/}calendar-color] => #1C4587FF
    [{DAV:}displayname] => Jewish holidays
    [{urn:ietf:params:xml:ns:caldav}calendar-description] => Foo
    [{http://apple.com/ns/ical/}calendar-order] => 19
    [{http://calendarserver.org/ns/}source] => Sabre\DAV\Xml\Property\Href Object
        (
            [hrefs:protected] => Array
                (
                    [0] => webcal://www.webcal.fi/cal.php?id=49&format=ics&wrn=1&wp=1&wf=26&color=%231C4587&cntr=us&lang=en&rid=wc
                )

            [autoPrefix:protected] => 
        )

    [{http://apple.com/ns/ical/}refreshrate] => P1W
    [{http://calendarserver.org/ns/}subscribed-strip-alarms] => 
)

You'll notice that the subscribed-strip-attachments and subscribed-strip-todos keys exist even if they're not send through the request. It could be a SabreDAV issue, right ?

@DeepDiver1975

Copy link
Copy Markdown
Contributor

It could be a SabreDAV issue, right ?

I don't think so. These elements are part of the xml which is sent with the mkcol.
Sabre deserialized the xml to the properties array you are receiving

@georgehrke

Copy link
Copy Markdown
Contributor

The problem here is isset. You need to check with array_key_exists for those strip properties

@tcitworld

tcitworld commented Jun 30, 2016 •

Copy link
Copy Markdown
Contributor Author

The problem here is isset. You need to check with array_key_exists for those strip properties

That's what I was doing and I figured the keys always exist (see above). Sorry if I'm missing something.

Sorry for wasting your time. 😳

@tcitworld
tcitworld force-pushed the add-all-properties-create-subscription branch from 9fc27d1 to ab562ad Compare June 30, 2016 14:56
@tcitworld

Copy link
Copy Markdown
Contributor Author

Fixed.

@DeepDiver1975

Copy link
Copy Markdown
Contributor

Since you are a contributor and have push access: please creat a branch in here and recreate the pr.thx

@tcitworld
tcitworld deleted the add-all-properties-create-subscription branch June 30, 2016 16:15
@lock

lock Bot commented Aug 5, 2019

Copy link
Copy Markdown

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock Bot locked as resolved and limited conversation to collaborators Aug 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants