Skip to content
Snippets Groups Projects
Commit c0d73dcf authored by jaapjansma's avatar jaapjansma
Browse files

#3 data processor returns a big error upon installation

parent e630a100
No related branches found
Tags 1.72
No related merge requests found
......@@ -24,6 +24,12 @@ class UIOutputHelper {
*/
public static function alterMenu(&$items) {
$factory = dataprocessor_get_factory();
// Check whether the factory exists. Usually just after
// installation the factory does not exists but then no
// outputs exists either. So we can safely return this function.
if (!$factory) {
return;
}
$sql = "
SELECT o.permission, p.id, p.title, o.configuration, o.type, o.id as output_id
......
......@@ -10,7 +10,11 @@ use \Symfony\Component\DependencyInjection\Definition;
* @return \Civi\DataProcessor\Factory
*/
function dataprocessor_get_factory() {
return \Civi::service('data_processor_factory');
$container = \Civi::container();
if ($container->has('data_processor_factory')) {
return \Civi::service('data_processor_factory');
}
return null;
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment