Problem/Motivation
When Tried to create subgroup, got "The website encountered an unexpected error. Please try again later.". Then uable to take subgoup page (http://localhost:8080/admin/group/subgroup).
Steps to reproduce
1. Create 2 Groups.
2. Create subgroup using that groups.
3. When submit, got exception.
Log
[Fri Jun 23 06:13:44.344179 2023] [php:notice] [pid 17] [client 172.19.0.1:53778] TypeError: Unsupported operand types: array + null in /var/www/html/core/lib/Drupal/Core/Render/Element/Select.php on line 152 #0 [internal function]: Drupal\\Core\\Render\\Element\\Select::processSelect(Array, Object(Drupal\\Core\\Form\\FormState), Array)\n#1 /var/www/html/core/lib/Drupal/Core/Form/FormBuilder.php(1012): call_user_func_array(Array, Array)\n#2 /var/www/html/core/lib/Drupal/Core/Form/FormBuilder.php(1075): Drupal\\Core\\Form\\FormBuilder->doBuildForm('subgroup_settin...', Array, Object(Drupal\\Core\\Form\\FormState))\n#3 /var/www/html/core/lib/Drupal/Core/Form/FormBuilder.php(1075): Drupal\\Core\\Form\\FormBuilder->doBuildForm('subgroup_settin...', Array, Object(Drupal\\Core\\Form\\FormState))\n#4 /var/www/html/core/lib/Drupal/Core/Form/FormBuilder.php(1075): Drupal\\Core\\Form\\FormBuilder->doBuildForm('subgroup_settin...', Array, Object(Drupal\\Core\\Form\\FormState))\n#5 /var/www/html/core/lib/Drupal/Core/Form/FormBuilder.php(1075): Drupal\\Core\\Form\\FormBuilder->doBuildForm('subgroup_settin...', Array, Object(Drupal\\Core\\Form\\FormState))\n#6 /var/www/html/core/lib/Drupal/Core/Form/FormBuilder.php(579): Drupal\\Core\\Form\\FormBuilder->doBuildForm('subgroup_settin...', Array, Object(Drupal\\Core\\Form\\FormState))\n#7 /var/www/html/core/lib/Drupal/Core/Form/FormBuilder.php(325): Drupal\\Core\\Form\\FormBuilder->processForm('subgroup_settin...', Array, Object(Drupal\\Core\\Form\\FormState))\n#8 /var/www/html/core/lib/Drupal/Core/Controller/FormController.php(73): Drupal\\Core\\Form\\FormBuilder->buildForm(Object(Drupal\\subgroup\\Form\\SubgroupSettingsForm), Object(Drupal\\Core\\Form\\FormState))\n#9 [internal function]: Drupal\\Core\\Controller\\FormController->getContentResult(Object(Symfony\\Component\\HttpFoundation\\Request), Object(Drupal\\Core\\Routing\\RouteMatch))\n#10 /var/www/html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)\n#11 /var/www/html/core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\\Core\\EventSubscriber\\EarlyRenderingControllerWrapperSubscriber->Drupal\\Core\\EventSubscriber\\{closure}()\n#12 /var/www/html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\\Core\\Render\\Renderer->executeInRenderContext(Object(Drupal\\Core\\Render\\RenderContext), Object(Closure))\n#13 /var/www/html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\\Core\\EventSubscriber\\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)\n#14 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(169): Drupal\\Core\\EventSubscriber\\EarlyRenderingControllerWrapperSubscriber->Drupal\\Core\\EventSubscriber\\{closure}()\n#15 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\\Component\\HttpKernel\\HttpKernel->handleRaw(Object(Symfony\\Component\\HttpFoundation\\Request), 1)\n#16 /var/www/html/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\\Component\\HttpKernel\\HttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#17 /var/www/html/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\\Core\\StackMiddleware\\Session->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#18 /var/www/html/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\\Core\\StackMiddleware\\KernelPreHandle->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#19 /var/www/html/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\\page_cache\\StackMiddleware\\PageCache->pass(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#20 /var/www/html/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\\page_cache\\StackMiddleware\\PageCache->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#21 /var/www/html/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\\Core\\StackMiddleware\\ReverseProxyMiddleware->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#22 /var/www/html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\\Core\\StackMiddleware\\NegotiationMiddleware->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#23 /var/www/html/core/lib/Drupal/Core/DrupalKernel.php(718): Stack\\StackedHttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#24 /var/www/html/index.php(19): Drupal\\Core\\DrupalKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request))\n#25 {main}, referer: http://localhost:8080/admin/group/types
Proposed resolution
There is some issue in member role selector. It getting null.