mirror of
https://github.com/owncloudarchive/contacts.git
synced 2024-12-11 22:24:32 +01:00
Merge pull request #584 from owncloud/backport-fix-TagMgr-access
fix TagMgr access remove unwanted error_log
This commit is contained in:
commit
d367cee448
@ -25,9 +25,10 @@ use OCA\Contacts\App,
|
||||
*/
|
||||
class ImportController extends Controller {
|
||||
|
||||
public function __construct($appName, IRequest $request, App $app, ICache $cache) {
|
||||
public function __construct($appName, IRequest $request, App $app, ICache $cache, ITags $tags) {
|
||||
parent::__construct($appName, $request, $app);
|
||||
$this->cache = $cache;
|
||||
$this->tagMgr = $tags;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -246,8 +247,7 @@ class ImportController extends Controller {
|
||||
$favourites = $part->select('X-FAVOURITES');
|
||||
foreach ($favourites as $favourite) {
|
||||
if ($favourite->getValue() == 'yes') {
|
||||
$tagMgr = $this->server->getTagManager()->load('contact');
|
||||
$tagMgr->addToFavorites($id);
|
||||
$this->tagMgr->addToFavorites($id);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -321,7 +321,6 @@ class ImportController extends Controller {
|
||||
return $response;
|
||||
}
|
||||
|
||||
error_log("progresskey: ".$this->cache->get($progresskey)." total: ".$this->cache->get($progresskey.'_total') );
|
||||
$response->setParams(array('progress' => $this->cache->get($progresskey), 'total' => $this->cache->get($progresskey.'_total') ));
|
||||
return $response;
|
||||
}
|
||||
|
@ -104,7 +104,8 @@ class Dispatcher extends MainApp {
|
||||
$this->container->registerService('ImportController', function(IAppContainer $container) use($app, $appName) {
|
||||
$request = $container->query('Request');
|
||||
$cache = $container->getServer()->getCache();
|
||||
return new ImportController($appName, $request, $app, $cache);
|
||||
$tags = $container->getServer()->getTagManager()->load('contact');
|
||||
return new ImportController($appName, $request, $app, $cache, $tags);
|
||||
});
|
||||
$this->container->registerService('ExportController', function(IAppContainer $container) use($app, $appName) {
|
||||
$request = $container->query('Request');
|
||||
|
Loading…
Reference in New Issue
Block a user