Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add all properties while creating a subscription #25231

Conversation

tcitworld
Copy link
Member

Should fix issue #24469

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

@mention-bot
Copy link

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

@ghost
Copy link

ghost commented Jun 22, 2016

@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
Member Author

And for now, MIT licensed.

@DeepDiver1975
Copy link
Member

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
Copy link

ghost commented Jun 23, 2016

@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
Copy link

ghost commented Jun 23, 2016

@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
Member Author

Tests added.

@DeepDiver1975
Copy link
Member

Tests added.

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

@ghost
Copy link

ghost commented Jun 28, 2016

@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
Member

@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
Member Author

Done.

@DeepDiver1975
Copy link
Member

Jenkins is green on #25280

@DeepDiver1975
Copy link
Member

👍

@DeepDiver1975
Copy link
Member

@georgehrke mind testing? THX

@@ -1083,18 +1083,25 @@ function createSubscription($principalUri, $uri, array $properties) {
if (isset($properties[$xmlName])) {

$values[$dbName] = $properties[$xmlName];
$fieldNames[] = $dbName;
} else {
if ($dbName == 'calendarorder') {
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member 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
Contributor

code looks good otherwise to me. Will test asap

@georgehrke
Copy link
Contributor

georgehrke commented Jun 29, 2016

<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
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
Member 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
Member

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
Contributor

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

@tcitworld
Copy link
Member Author

tcitworld commented Jun 30, 2016

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
Member Author

Fixed.

@DeepDiver1975
Copy link
Member

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
Copy link

lock bot commented Aug 5, 2019

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.

None yet

4 participants