Problem/Motivation

After updating to OS 12.4.6, pages displaying groups throw errors indicating that the plugin_id could not be found.

Steps to reproduce

I will try to reproduce the issue with a new installation but need to find some time to do so.

Ok what worked on first attempt.

  1. Composer require OS Version 11.11.4
  2. Install on PHP 7.4 and Generate demo content and users
  3. Switch to PHP 8.1
  4. Update to OS Version 12.1.5
  5. Update database
  6. Update to OS Version 12.4.6
  7. Update database
  8. Visit user/1/groups

Two example errors with error trace:

/user/1/groups

Drupal\Core\Database\DatabaseExceptionWrapper: Exception in User Groups[groups]: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'gc.plugin_id' in 'where clause': SELECT "groups_field_data"."created" AS "groups_field_data_created", "groups_field_data"."label" AS "groups_field_data_label", "groups_field_data"."id" AS "id", "flagging_groups_field_data"."id" AS "flagging_groups_field_data_id" FROM "groups_field_data" "groups_field_data" LEFT JOIN "flagging" "flagging_groups_field_data" ON groups_field_data.id = flagging_groups_field_data.entity_id AND (flagging_groups_field_data.flag_id = :views_join_condition_0 AND flagging_groups_field_data.uid = :views_join_condition_1) INNER JOIN "groups" "groups" ON groups_field_data.id = groups.id WHERE "groups"."id" IN (SELECT "gc"."gid" AS "gid" FROM "group_content_field_data" "gc" WHERE ("gc"."entity_id" = :db_condition_placeholder_2) AND ("gc"."plugin_id" LIKE :db_condition_placeholder_3 ESCAPE '\\')) ORDER BY "groups_field_data_created" DESC, "groups_field_data_label" ASC LIMIT 7 OFFSET 0; Array ( [:db_condition_placeholder_2] => 1 [:db_condition_placeholder_3] => %membership% [:views_join_condition_0] => mute_group_notifications [:views_join_condition_1] => 1 ) in main() (line 19 of index.php).
Drupal\views\ViewExecutable->execute(NULL) (Line: 1470)
Drupal\views\ViewExecutable->render() (Line: 199)
Drupal\views\Plugin\views\display\Page->execute() (Line: 1646)
Drupal\views\ViewExecutable->executeDisplay('page_user_groups', Array) (Line: 81)
Drupal\views\Element\View::preRenderViewElement(Array)
call_user_func_array(Array, Array) (Line: 111)
Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/2966725', 'exception', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 859)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 421)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 240)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 238)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 627)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 239)
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: 186)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
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: 28)
Drupal\Core\StackMiddleware\ContentLength->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: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

/group/1/stream

Drupal\Core\Entity\Query\QueryException: 'plugin_id' not found in Drupal\Core\Entity\Query\Sql\Tables->ensureEntityTable() (line 369 of core/lib/Drupal/Core/Entity/Query/Sql/Tables.php).
Drupal\Core\Entity\Query\Sql\Tables->addField('plugin_id', 'INNER', NULL) (Line: 58)
Drupal\Core\Entity\Query\Sql\Condition->compile(Object) (Line: 176)
Drupal\Core\Entity\Query\Sql\Query->compile() (Line: 81)
Drupal\Core\Entity\Query\Sql\Query->execute() (Line: 89)
Drupal\social_group\GroupStatistics->count(Object, 'group_membership') (Line: 53)
Drupal\social_group\GroupStatistics->getGroupMemberCount(Object) (Line: 356)
social_group_preprocess_group(Array, 'group', Array)
call_user_func_array('social_group_preprocess_group', Array) (Line: 261)
Drupal\Core\Theme\ThemeManager->render('group', Array) (Line: 480)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 240)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 238)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 627)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 239)
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: 186)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
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: 28)
Drupal\Core\StackMiddleware\ContentLength->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: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Comments

corn696 created an issue. See original summary.

corn696’s picture

Issue summary: View changes
corn696’s picture

Added steps to reproduce

corn696’s picture

Issue summary: View changes
corn696’s picture

Issue summary: View changes
corn696’s picture

Issue summary: View changes
corn696’s picture

Issue summary: View changes
ronaldtebrake’s picture

Thanks for the input in both issues.
I think the actual issue is that the cherry picked code in the referenced issue: https://www.drupal.org/project/social/issues/3487220
is created with group version 2 in mind, which is part of the 13.x release, so that doesn't work for 12.4.6 which still is on group version 1.

I will revert that commit and make sure that this is part of the next 12.4.7 release.

slowflyer’s picture

corn696’s picture

Thanks. Based on the response to the other issue I commented on, I thought it might be a specific problem with my installation.

ronaldtebrake’s picture

Status: Active » Needs review
corn696’s picture

Not entirely. The plugin_id is requested in additional places, such as in the related issue mentioned by slowflyer, but that should be it.

jkdaza’s picture

The 12.4.7 release fixed the `Unknown column 'gc.plugin_id'` error, but I had to add a patch for the related issue:

https://www.drupal.org/project/social/issues/3489147#comment-15878221

robertragas’s picture

Releasing 12.4.8 with a fix for this now https://git.drupalcode.org/project/social/-/commit/d8a89fc7ea4d5e96c72de...

Feel free to re-open if you still run into issues.

robertragas’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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