mirror of
https://github.com/owncloudarchive/contacts.git
synced 2024-12-12 23:09:15 +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 {
|
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);
|
parent::__construct($appName, $request, $app);
|
||||||
$this->cache = $cache;
|
$this->cache = $cache;
|
||||||
|
$this->tagMgr = $tags;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -246,8 +247,7 @@ class ImportController extends Controller {
|
|||||||
$favourites = $part->select('X-FAVOURITES');
|
$favourites = $part->select('X-FAVOURITES');
|
||||||
foreach ($favourites as $favourite) {
|
foreach ($favourites as $favourite) {
|
||||||
if ($favourite->getValue() == 'yes') {
|
if ($favourite->getValue() == 'yes') {
|
||||||
$tagMgr = $this->server->getTagManager()->load('contact');
|
$this->tagMgr->addToFavorites($id);
|
||||||
$tagMgr->addToFavorites($id);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -321,7 +321,6 @@ class ImportController extends Controller {
|
|||||||
return $response;
|
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') ));
|
$response->setParams(array('progress' => $this->cache->get($progresskey), 'total' => $this->cache->get($progresskey.'_total') ));
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
@ -104,7 +104,8 @@ class Dispatcher extends MainApp {
|
|||||||
$this->container->registerService('ImportController', function(IAppContainer $container) use($app, $appName) {
|
$this->container->registerService('ImportController', function(IAppContainer $container) use($app, $appName) {
|
||||||
$request = $container->query('Request');
|
$request = $container->query('Request');
|
||||||
$cache = $container->getServer()->getCache();
|
$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) {
|
$this->container->registerService('ExportController', function(IAppContainer $container) use($app, $appName) {
|
||||||
$request = $container->query('Request');
|
$request = $container->query('Request');
|
||||||
|
Loading…
Reference in New Issue
Block a user