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

enabling extension casuses issues in Cases dashboard #7

Open
chumkui opened this issue Jan 25, 2022 · 4 comments
Open

enabling extension casuses issues in Cases dashboard #7

chumkui opened this issue Jan 25, 2022 · 4 comments

Comments

@chumkui
Copy link

chumkui commented Jan 25, 2022

Hi - I have been trying out this extension as it takes care of a particular use case for us. We are using the latest Drupal 7 and Civ v5.44.

Once enabled, if you view the Cases Dashboard and try to access any of the Ongoing cases (or any of the others), it causes a HTTP 500 - looking at the logs:

Fatal error: require_once(): Failed opening required '.php' (include_path='/var/www/html/sites/all/modules/civicrm/ext/net.ourpowerbase.exportpermission/[all our other extension paths are also listed]/var/ in /var/www/html/sites/all/modules/civicrm/CRM/Core/Controller.php on line 452

On installing the extension and checking the logs I get a large number of these notices:

Referrer | https://.../civicrm/admin/extensions?action=enable&id=net.ourpowerbase.exportpermission&key=net.ourpowerbase.exportpermission

Notice: Trying to access array offset on value of type null in CRM_Core_DAO->getReferenceCounts() (line 2565 of /var/www/html/sites/all/modules/civicrm/CRM/Core/DAO.php).

Other searches e.g. Contacts, seem fine. If you need more information, let me know!

@jmcclelland
Copy link
Contributor

Sorry you are having trouble with the extension. Unfortunately I'm not able to replicate it. When you disable this extension, do the log entries stop appearing?

It seems that CiviCRM is having a hard time finding an extension to include because it can't translate between the class name and the path to the extension itself. I'm not sure why that would be hapenning.

@chumkui
Copy link
Author

chumkui commented Feb 1, 2022

Thanks - I'm not sure either what the problem and I'm not sure of course if anyone else has issues. Seems to be Cases specific for me, so maybe environmental for the Case types we have created. I've disabled for the moment but will try and find time to have a look in a bit more detail on a local dev environment.

@gibsonoliver
Copy link

We have just the same issue. Installed the extension (CiviCRM 5.49 and Drupal 9). Non admin users get an error when accessing the CiviCRM Find Cases screen. Its a vanilla system just installed.

Error like
Notice: Trying to access array offset on value of type null in CRM_Case_Task::getTask() (line 141 of /var/www/html/drupal9/vendor/civicrm/civicrm-core/CRM/Case/Task.php)
#0 /var/www/html/drupal9/web/core/includes/bootstrap.inc(346): _drupal_error_handler_real()
#1 /var/www/html/drupal9/vendor/civicrm/civicrm-core/CRM/Case/Task.php(141): _drupal_error_handler()
#2 /var/www/html/drupal9/vendor/civicrm/civicrm-core/CRM/Case/StateMachine/Search.php(78): CRM_Case_Task::getTask()
#3 /var/www/html/drupal9/vendor/civicrm/civicrm-core/CRM/Case/StateMachine/Search.php(38): CRM_Case_StateMachine_Search->taskName()
#4 /var/www/html/drupal9/vendor/civicrm/civicrm-core/CRM/Case/Controller/Search.php(44): CRM_Case_StateMachine_Search->__construct()
#5 /var/www/html/drupal9/vendor/civicrm/civicrm-core/CRM/Core/Invoke.php(314): CRM_Case_Controller_Search->__construct()
#6 /var/www/html/drupal9/vendor/civicrm/civicrm-core/CRM/Core/Invoke.php(69): CRM_Core_Invoke::runItem()
#7 /var/www/html/drupal9/vendor/civicrm/civicrm-core/CRM/Core/Invoke.php(36): CRM_Core_Invoke::_invoke()
#8 /var/www/html/drupal9/web/modules/contrib/civicrm/src/Civicrm.php(88): CRM_Core_Invoke::invoke()
#9 /var/www/html/drupal9/web/modules/contrib/civicrm/src/Controller/CivicrmController.php(80): Drupal\civicrm\Civicrm->invoke()
#10 [internal function]: Drupal\civicrm\Controller\CivicrmController->main()
#11 /var/www/html/drupal9/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array()
#12 /var/www/html/drupal9/web/core/lib/Drupal/Core/Render/Renderer.php(564): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber{closure}()
#13 /var/www/html/drupal9/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext()
#14 /var/www/html/drupal9/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()
#15 /var/www/html/drupal9/vendor/symfony/http-kernel/HttpKernel.php(158): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber{closure}()
#16 /var/www/html/drupal9/vendor/symfony/http-kernel/HttpKernel.php(80): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#17 /var/www/html/drupal9/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle()
#18 /var/www/html/drupal9/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#19 /var/www/html/drupal9/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#20 /var/www/html/drupal9/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()
#21 /var/www/html/drupal9/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle()
#22 /var/www/html/drupal9/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#23 /var/www/html/drupal9/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#24 /var/www/html/drupal9/web/core/lib/Drupal/Core/DrupalKernel.php(708): Stack\StackedHttpKernel->handle()
#25 /var/www/html/drupal9/web/index.php(19): Drupal\Core\DrupalKernel->handle()
#26 {main}

@jmcclelland
Copy link
Contributor

I think I see the problem and I'm not sure the right fix.

The cases code in Civi core has a CRM_Case_Task::getTask() function. If the $value argument is empty, it returns the print task by default. But, the exportpermissions extension eliminates that task if you don't have the special print permission. The core code reasonably expects that task to available and has no knowledge of this extension.

I just added a comment to an issue making an argument that this extension should be brought into core - maybe that's a place to discuss? https://lab.civicrm.org/dev/core/-/issues/2720

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants