Problem/Motivation

when enabling Layout builder on some content types I got this error
Error: Call to a member function bundle() on null in profiles/contrib/social/modules/social_features/social_group/src/Plugin/EntityReferenceSelection/SocialGroupSelection.php on line 38

Comments

yasmeensalah created an issue. See original summary.

yasmeensalah’s picture

kingdutch’s picture

Version: 10.0.0 » 10.0.x-dev
Status: Active » Needs review
Salif’s picture

I'm having the same issue with 10.0.4.
I've enabled layout builder module. Then I set up the landing page content type to use it, added and deleted sections and blocks to my landing page. The issue occurs when I revisite the manage display page.
The patch #2 seems to solve the issue.

Salif’s picture

Here is the full error message:

The website encountered an unexpected error. Please try again later.
Error: Call to a member function bundle() on null in Drupal\social_group\Plugin\EntityReferenceSelection\SocialGroupSelection->buildEntityQuery() (line 38 of profiles/contrib/social/modules/social_features/social_group/src/Plugin/EntityReferenceSelection/SocialGroupSelection.php).
Drupal\social_group\Plugin\EntityReferenceSelection\SocialGroupSelection->buildEntityQuery(NULL, 'CONTAINS') (Line: 345)
Drupal\Core\Entity\Plugin\EntityReferenceSelection\DefaultSelection->getReferenceableEntities(NULL, 'CONTAINS', 50) (Line: 298)
Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem::generateSampleValue(Object) (Line: 253)
Drupal\Core\Field\FieldItemList->generateSampleItems() (Line: 162)
Drupal\Core\Entity\ContentEntityStorageBase->createWithSampleValues('landing_page') (Line: 55)
Drupal\layout_builder\Entity\LayoutBuilderSampleEntityGenerator->get('node', 'landing_page') (Line: 267)
Drupal\layout_builder\Plugin\SectionStorage\DefaultsSectionStorage->getContextsDuringPreview() (Line: 49)
Drupal\layout_builder_restrictions\Form\FormAlter->getAvailableContexts(Object) (Line: 53)
Drupal\layout_builder_restrictions\Form\FormAlter->getBlockDefinitions(Object) (Line: 132)
Drupal\layout_builder_restrictions\Form\FormAlter->alterEntityViewDisplayForm(Array, Object, 'entity_view_display_edit_form') (Line: 54)
layout_builder_restrictions_form_entity_view_display_edit_form_alter(Array, Object, 'entity_view_display_edit_form') (Line: 539)
Drupal\Core\Extension\ModuleHandler->alter('form', Array, Object, 'entity_view_display_edit_form') (Line: 836)
Drupal\Core\Form\FormBuilder->prepareForm('entity_view_display_edit_form', Array, Object) (Line: 279)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 91)
Drupal\Core\Controller\FormController->getContentResult(Object, Object) (Line: 39)
Drupal\layout_builder\Controller\LayoutBuilderHtmlEntityFormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 573)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
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: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 708)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
delacosta456’s picture

hi
i was having this issue too and the patch work for me .
Thanks

ressinel’s picture

Version: 10.0.x-dev » 11.1.x-dev

Hi, @yasmeensalah

Thank you for your patch.
I have created PR with your fixes: https://github.com/goalgorilla/open_social/pull/2933

ressinel’s picture

Status: Needs review » Reviewed & tested by the community
ressinel’s picture

Status: Reviewed & tested by the community » Fixed

It will be released in Open Social 11.1.7 and above.

  • Ressinel committed 9e34c76 on 11.1.x
    Merge pull request #2933 from goalgorilla/issue/3197241-...

  • Ressinel committed 09c2751 on 11.2.x
    Merge pull request #2933 from goalgorilla/issue/3197241-...

  • Ressinel committed 586a282 on 11.3.x
    Merge pull request #2933 from goalgorilla/issue/3197241-...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

navneet0693’s picture