Problem/Motivation

The Content Model Documentation (CMD) module is meant to provide administrators with a way to document the content model for a given Drupal site. You can document fields, entities that use them, modules and other items. Eventually it would make sense for CMD to be able to document groups and group content as well.

Unfortunately there is an incompatibility between the Configuration Views module (a dependency for CMD) and Group. I've managed to locate the exact location in code where the incompatibility exists but I'm not sure how to fix the problem (and I'm not sure if the fix needs to be with the Group module or the Configuration Views module)

Steps to reproduce

  1. Set up a new Drupal 10 site and install / configure the group module.
  2. Visit /admin/content (a view) and note the page loads fine
  3. Visit /admin/structure/types (not currently a view) and note the page loads fine
  4. Now install Configuration Views: https://www.drupal.org/project/config_views
  5. Visit /admin/content (a view) and note the page still loads fine
  6. Visit /admin/structure/types (NOW A VIEW) and note the page will not load
  7. You should see the message "The website encountered an unexpected error. Please try again later."
  8. The issue starts on line 372 in the group_views_query_alter function in group.module

More Details

For views provided by Drupal core, Line 372 sets the $view->build_info['query'] item properly. But for views provided by the Configuration Views module this line does nothing. The $view->build_info['query'] item remains an empty string. As a result, line 376 sets $query to an empty string for these views provided by the Configuration Views module. As a result, line 378 (where we attempt to call $query->addMetaData) fails.

Proposed resolution

Unsure how to fix. I'm not sure if the group module is making an assumption about the structure of the provided $view and $query parameters that isn't always true or if the new views provided by Configuration Views are not properly formatted.

Remaining tasks

Determine if the group code needs an update or if the Configuration Views module needs to alter the data structure for their views.

User interface changes

N/A

API changes

N/A

Data model changes

N/A

https://www.drupal.org/project/config_views/issues/3358929

Comments

JayDarnell created an issue. See original summary.

jaydarnell’s picture

Issue summary: View changes
swirt’s picture

This is a problem with the default list being replaced by a View from Configuration Views.

One way around it, is to do config export but then not commit that file for that particular View, and any others you don't want. Those Views are created on module install, but do not survive config import if their config does not exist.

However, I think this issue is really ought to be filed against config_views.

jaydarnell’s picture

Issue summary: View changes
monaw’s picture

I am having a very similar problem with Drupal 9.5.2, Group 3.0.1, Content Model Documentation 1.0.5, and Configuration Entity View 2.0.0...the page admin/reports/content-model/fields gives white screen with error message "The website encountered an unexpected error. Please try again later." and Drupal's recent log shows:

Location http://group3.ddev.site/admin/reports/content-model/fields
Referrer Error: Call to a member function addMetaData() on string in group_views_query_alter() (line 378 of /var/www/html/web/modules/contrib/group/group.module)
Message
#0 [internal function]: group_views_query_alter(Object(Drupal\views\ViewExecutable), '')
#1 /var/www/html/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(426): call_user_func_array(Object(Closure), Array)
#2 /var/www/html/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(405): Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}(Object(Closure), 'group')
#3 /var/www/html/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(433): Drupal\Core\Extension\ModuleHandler->invokeAllWith('views_query_alt...', Object(Closure))
#4 /var/www/html/web/core/modules/views/src/Plugin/views/query/Sql.php(1434): Drupal\Core\Extension\ModuleHandler->invokeAll('views_query_alt...', Array)
#5 /var/www/html/web/core/modules/views/src/ViewExecutable.php(1321): Drupal\views\Plugin\views\query\Sql->alter(Object(Drupal\views\ViewExecutable))
#6 /var/www/html/web/core/modules/views/src/Plugin/views/display/PathPluginBase.php(392): Drupal\views\ViewExecutable->build()
#7 /var/www/html/web/core/modules/views/src/Plugin/views/display/Page.php(196): Drupal\views\Plugin\views\display\PathPluginBase->execute()
#8 /var/www/html/web/core/modules/views/src/ViewExecutable.php(1635): Drupal\views\Plugin\views\display\Page->execute()
#9 /var/www/html/web/core/modules/views/src/Element/View.php(81): Drupal\views\ViewExecutable->executeDisplay('content_model_d...', Array)
#10 [internal function]: Drupal\views\Element\View::preRenderViewElement(Array)
#11 /var/www/html/web/core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php(101): call_user_func_array(Array, Array)
#12 /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php(788): Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_ren...', 'exception', 'Drupal\\Core\\Ren...')
#13 /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php(374): Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array)
#14 /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php(204): Drupal\Core\Render\Renderer->doRender(Array, false)
#15 /var/www/html/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(242): Drupal\Core\Render\Renderer->render(Array, false)
#16 /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}()
#17 /var/www/html/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(243): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#18 /var/www/html/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(132): Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\CurrentRouteMatch))
#19 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php(90): Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\CurrentRouteMatch))
#20 [internal function]: Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object(Symfony\Component\HttpKernel\Event\ViewEvent), 'kernel.view', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#21 /var/www/html/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(142): call_user_func(Array, Object(Symfony\Component\HttpKernel\Event\ViewEvent), 'kernel.view', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#22 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(174): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object(Symfony\Component\HttpKernel\Event\ViewEvent), 'kernel.view')
#23 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#24 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#25 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#26 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#27 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#28 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#29 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#30 /var/www/html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#31 /var/www/html/web/core/lib/Drupal/Core/DrupalKernel.php(713): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#32 /var/www/html/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#33 {main}

swirt’s picture

I believe the issue is between Group and Configuration Entity View #3358929: Incompatible with Group 3.x