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

Calendar ressource and room manager should not take implementations but class names #10212

Closed
nickvergessen opened this issue Jul 12, 2018 · 1 comment · Fixed by #10839
Closed
Assignees
Labels
1. to develop Accepted and waiting to be taken care of feature: dav technical debt
Milestone

Comments

@nickvergessen
Copy link
Member

Currently all the objects have to be instantiated already, although they might not be used at all in the end.
See

/**
* @param string $filter Class must implement OCA\Activity\IFilter
* @return void
*/
public function registerFilter($filter) {
$this->filterClasses[$filter] = false;
}
/**
* @return IFilter[]
* @throws \InvalidArgumentException
*/
public function getFilters() {
if (!$this->loadedLegacyFilters) {
$legacyFilters = $this->getNavigation();
foreach ($legacyFilters['top'] as $filter => $data) {
$this->filters[$filter] = new LegacyFilter(
$this, $filter, $data['name'], true
);
}
foreach ($legacyFilters['apps'] as $filter => $data) {
$this->filters[$filter] = new LegacyFilter(
$this, $filter, $data['name'], false
);
}
$this->loadedLegacyFilters = true;
}
foreach ($this->filterClasses as $class => $false) {
/** @var IFilter $filter */
$filter = \OC::$server->query($class);
if (!$filter instanceof IFilter) {
throw new \InvalidArgumentException('Invalid activity filter registered');
}
$this->filters[$filter->getIdentifier()] = $filter;
unset($this->filterClasses[$class]);
}
return $this->filters;
}
for an example

@nickvergessen nickvergessen added 1. to develop Accepted and waiting to be taken care of feature: dav technical debt labels Jul 12, 2018
@nickvergessen nickvergessen added this to the Nextcloud 14 milestone Jul 12, 2018
@nextcloud-bot
Copy link
Member

GitMate.io thinks possibly related issues are #6842 (Feature: Possibility to change name of default calendar), #1463 (shared calendar's color and name not editable by sharee (on a per-sharee basis) ), #9005 (c), and #4885 (Nextcloud 12: cannot share calendar with a group with "&" in its name).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. to develop Accepted and waiting to be taken care of feature: dav technical debt
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants