1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2024-12-03 15:24:09 +01:00

Merge pull request #584 from owncloud/backport-fix-TagMgr-access

fix TagMgr access remove unwanted error_log
This commit is contained in:
Bernhard Reiter 2014-08-19 14:19:32 +02:00
commit d367cee448
2 changed files with 5 additions and 5 deletions

View File

@ -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;
}

View File

@ -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');