- Issue created by @rwanth
- Merge request !5Change conditional in hook_menu_local_tasks_alter to use null-safe operator β (Open) created by rwanth
Entity Copy Reference creates a fatal error when used simultaneously with the Moderation Sidebar module. The issue is:
Error: Call to a member function access() on null in entity_copy_reference_menu_local_tasks_alter() (line 47 of /mnt/www/html/cmogshop/docroot/modules/contrib/entity_copy_reference/entity_copy_reference.module).
Essentially, the other module is triggering our menu_local_tasks_alter hook, but since it's happening through Ajax, \Drupal::routeMatch()->getParameter('node')
is returning NULL.
Install both Entity Copy Reference and Moderation Sidebar, and configure both modules for use on the same content type. When attempting to use the sidebar, you should get an "oops, something went wrong" ajax message on the page, and the above error in the logs.
Add a null-safe operator to our conditional on line 47 of entity_copy_reference.module:
if ($node?->access('update') && $entityCopyReference->isCopyEnabled($node)) {
Active
1.0
Code