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

ICS Export: export by componentType #568

Merged
merged 6 commits into from
Nov 27, 2014

Conversation

evert
Copy link
Member

@evert evert commented Nov 24, 2014

No description provided.

@@ -200,7 +209,7 @@ function($item) use ($path) {
// Flattening the arrays
foreach($nodes as $node) {
if (isset($node[200][$calDataProp])) {
$blobs[] = $node[200][$calDataProp];
$blobs[$node['href']] = $node[200][$calDataProp];
Copy link
Member Author

Choose a reason for hiding this comment

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

Why this change?

Copy link
Contributor

Choose a reason for hiding this comment

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

To (at a later point) be able to add the object's uri to the output. That way, updates to the event could be sent without 'guessing' the uri (calendar.uri & object.uid) which might fail.

Copy link
Member Author

Choose a reason for hiding this comment

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

So is this actually used anywhere? Not within sabre/dav right?

Copy link
Contributor

Choose a reason for hiding this comment

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

Nope, at least not yet ;)

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, so if the behavior changes, this change should also be documented in mergeObjects.

@evert
Copy link
Member Author

evert commented Nov 24, 2014

Needs a unittest

$componentType = 'VEVENT';
}
if (isset($queryParams['componentType'])) {
if (!in_array($queryParams['componentType'], ['VEVENT', 'VTODO', 'VJOURNAL'])) {
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't it be validated in generateResponse directly instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

Well, the other validation also happens here.

Copy link
Member

Choose a reason for hiding this comment

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

since the method is only used once, it doesn't matter. is the generateResponse() method protected by design? or should it be better private?

Copy link
Member Author

Choose a reason for hiding this comment

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

We actually subclass this in fruux, so we can add additional caching. I think that that was also the original use-case for splitting it into a second method in the first place.

Copy link
Member

Choose a reason for hiding this comment

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

so your subclass may also benefit from moving the validation into generateRespone;)

Copy link
Member Author

Choose a reason for hiding this comment

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

True :P

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually.. no. It would make it more cumbersome as the validation would have to be repeated in our generateResponse.

Copy link
Member

Choose a reason for hiding this comment

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

ah right.. in case you only override generateResponse its fine as is.

@ahackschmitz
Copy link
Contributor

Added unit tests and also added a reference in mergeObjects.

@evert
Copy link
Member Author

evert commented Nov 27, 2014

Currently unittests are failing!

@ahackschmitz
Copy link
Contributor

damnit, didn't run the tests after the latest changes, will check immediately

@evert
Copy link
Member Author

evert commented Nov 27, 2014

@armin-hackmann Just out of curiosity.. did you not get an email from travis?

@ahackschmitz
Copy link
Contributor

nope, I didn't. Commit is reversed, tests run successfully again.

@evert
Copy link
Member Author

evert commented Nov 27, 2014

Do you have an account there or email settings? Could be useful :)

evert added a commit that referenced this pull request Nov 27, 2014
@evert evert merged commit e0037e4 into sabre-io:master Nov 27, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants