I have Drupal 9.5.9, Group 8.x-1.5 and Groupmenu 8.x-1.0-beta3
Groupmenu is not showing. I tried the following lines without any luck.
--------------- code -------------------
$block_manager = \Drupal::service('plugin.manager.block');
$plugin_block = $block_manager->createInstance('groupmenus');
$plugin_block->setContextValue('group', $group);
$block = $plugin_block->build();
-------------------------------------------
Error I get when using setContextValue() in above code.
---------------- Error----------------------
Uncaught PHP Exception Drupal\Component\Plugin\Exception\ContextException: "The group context is not a valid context." at \web\core\lib\Drupal\Core\Plugin\ContextAwarePluginTrait.php line 184
---------------------------------------------
I also tried 2 patches following patches mentioned in above comment #7. I had to make changes to make patch 1 compatible with D-9.
---------------------- Patches-------------------
patch 1 -
https://www.drupal.org/files/issues/2018-08-28/group-configurable-entiti... β
patch 2-
https://www.drupal.org/files/issues/2019-04-04/groupmenu-change_referenc... β
---------------------------------------------------
Not sure if I am on right path. Looking for help.