I have cloned the Socialblue theme in order to extend it, as suggested in the theme's readme.md file:
The safest and fastest way to get started is to duplicate this theme and rename it to your custom theme name.
After enabling my new cloned theme, I uninstalled the socialblue theme. I expected that this would be fine because now my cloned theme depends on the socialbase theme. However; when I visit a group's members management page (E.g.: /group/5/membership), I get the following error:
TypeError: Argument 1 passed to Drupal\block\BlockViewBuilder::view() must implement interface Drupal\Core\Entity\EntityInterface, null given, called in /app/html/profiles/contrib/social/modules/social_features/social_group/social_group.module on line 1102 in Drupal\block\BlockViewBuilder->view() (line 30 of /app/html/core/modules/block/src/BlockViewBuilder.php)
After inspecting the content of social_group.module, I see that a block with ID socialblue_local_actions is being loaded near line 1102:
$entity = \Drupal::entityTypeManager()->getStorage('block')
->load('socialblue_local_actions');
Upon further inspection, I see that the block called "Primary admin actions" has the ID socialblue_local_actions on the Socialblue theme; however, the same block has the ID mythemename_local_actions on my cloned theme.
I have fixed the problem by re-enabling the Socialblue theme; but, I think it shouldn't be necessary to have a theme enabled if it isn't going to be used.
A possibly better solution would be to move the function
/**
* Implements hook_preprocess_HOOK().
*/
function social_group_preprocess_views_view(&$variables) {
/** @var \Drupal\views\ViewExecutable $view */
$view = &$variables['view'];
if ($view->id() === 'group_manage_members') {
$entity = \Drupal::entityTypeManager()->getStorage('block')
->load('socialblue_local_actions');
$variables['header']['actions'] = \Drupal::entityTypeManager()
->getViewBuilder('block')
->view($entity);
}
}
...into the socialblue.theme file and document the necessary string replacements for new cloned themes.
I'd be happy to try this fix and share a patch, if you think this is a good idea.
Thank you for the great work on this distribution.