Hi, I appreciated this method to let users contact each other without having to give access to a role access to user personal contact forms. I don't think there's another way to do this in D10. However, this error prevents me from moving forward. It is resolved by uninstalling. I don't see another dev version I can try.
"drupal/gcontact": "^1.1"
"drupal/gcontact": {
"d10": "https://www.drupal.org/files/issues/2022-06-15/gcontact.1.1.rector.patch",
"Minor coding standard fix": "https://www.drupal.org/files/issues/2877194-2.patch"
}
To replicate on a fresh d10 install - install group, contact, and gcontact, the following error message results.
Please help me get this working.
Error message:
The website encountered an unexpected error. Please try again later.
Error: Call to undefined method Drupal\group\Entity\GroupType::getContentPlugin() in gcontact_entity_extra_field_info() (line 37 of modules/contrib/gcontact/gcontact.module).
call_user_func_array(Object, Array) (Line: 409)
Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}(Object, 'gcontact') (Line: 388)
Drupal\Core\Extension\ModuleHandler->invokeAllWith('entity_extra_field_info', Object) (Line: 416)
Drupal\Core\Extension\ModuleHandler->invokeAll('entity_extra_field_info') (Line: 661)
Drupal\Core\Entity\EntityFieldManager->getExtraFields('block_content', 'basic') (Line: 99)
Drupal\layout_builder\Plugin\Derivative\ExtraFieldBlockDeriver->getDerivativeDefinitions(Array) (Line: 101)
Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDerivatives(Array) (Line: 87)
Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDefinitions() (Line: 291)
Drupal\Core\Plugin\DefaultPluginManager->findDefinitions() (Line: 181)
Drupal\Core\Plugin\DefaultPluginManager->getDefinitions() (Line: 22)
Drupal\Core\Plugin\DefaultPluginManager->getDefinition('local_actions_block') (Line: 16)
Drupal\Core\Plugin\Factory\ContainerFactory->createInstance('local_actions_block', Array) (Line: 76)
Drupal\Component\Plugin\PluginManagerBase->createInstance('local_actions_block', Array) (Line: 62)
Drupal\Core\Plugin\DefaultSingleLazyPluginCollection->initializePlugin('local_actions_block') (Line: 57)
Drupal\block\BlockPluginCollection->initializePlugin('local_actions_block') (Line: 80)
Drupal\Component\Plugin\LazyPluginCollection->get('local_actions_block') (Line: 45)
Drupal\block\BlockPluginCollection->get('local_actions_block') (Line: 83)
Drupal\Core\Plugin\DefaultSingleLazyPluginCollection->setConfiguration(Array) (Line: 99)
Drupal\Core\Plugin\DefaultSingleLazyPluginCollection->addInstanceId('local_actions_block', Array) (Line: 55)
Drupal\Core\Plugin\DefaultSingleLazyPluginCollection->__construct(Object, 'local_actions_block', Array) (Line: 34)
Drupal\block\BlockPluginCollection->__construct(Object, 'local_actions_block', Array, 'claro_local_actions') (Line: 156)
Drupal\block\Entity\Block->getPluginCollection() (Line: 145)
Drupal\block\Entity\Block->getPlugin() (Line: 118)
Drupal\block\BlockAccessControlHandler->checkAccess(Object, 'view', Object) (Line: 105)
Drupal\Core\Entity\EntityAccessControlHandler->access(Object, 'view', Object, 1) (Line: 314)
Drupal\Core\Entity\EntityBase->access('view', NULL, 1) (Line: 63)
Drupal\block\BlockRepository->getVisibleBlocksPerRegion(Array) (Line: 137)
Drupal\block\Plugin\DisplayVariant\BlockPageVariant->build() (Line: 270)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 128)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 168)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 74)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 686)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
/**
* Implements hook_entity_extra_field_info().
*/
function gcontact_entity_extra_field_info() {
$extra = [];
// Add each profile type as an extra field for display. Enabled by default.
foreach (GroupType::loadMultiple() as $group_type) {
$plugin = $group_type->getContentPlugin('group_membership');
$extra['group_content'][$plugin->getContentTypeConfigId()]['display']['contact'] = [
'label' => t('Contact link'),
'description' => t("Display a link to the member's contact form."),
'weight' => 10,
'visible' => TRUE,
];
}
return $extra;
}