localgovdrupal / localgov_tasty_backend

Tasty backend intergration with Localgov Drupal
GNU General Public License v2.0
0 stars 0 forks source link

Non admin users get PHP error when viewing moderated content views #1

Closed andybroomfield closed 7 months ago

andybroomfield commented 8 months ago

After install and after rebuilding content access permissions.

Go to http://localgov.lndo.site:8000/admin/content/localgov_approvals

See this PHP error

TypeError: Unsupported operand types: array + null in Drupal\Core\Database\Query\Condition->compile() (line 236 of core/lib/Drupal/Core/Database/Query/Condition.php).

Full stack trace

TypeError: Unsupported operand types: array + null in Drupal\Core\Database\Query\Condition->compile() (line 236 of core/lib/Drupal/Core/Database/Query/Condition.php).
Drupal\Core\Database\Query\Select->compile(Object, Object) (Line: 248)
Drupal\Core\Database\Query\Select->compile(Object, Object) (Line: 448)
Drupal\Core\Database\Query\Select->getArguments() (Line: 524)
Drupal\Core\Database\Query\Select->execute() (Line: 155)
Drupal\views\Plugin\views\pager\PagerPluginBase->executeCountQuery(Object) (Line: 1528)
Drupal\views\Plugin\views\query\Sql->execute(Object) (Line: 1441)
Drupal\views\ViewExecutable->execute(NULL) (Line: 1469)
Drupal\views\ViewExecutable->render() (Line: 199)
Drupal\views\Plugin\views\display\Page->execute() (Line: 1645)
Drupal\views\ViewExecutable->executeDisplay('approvals_dashboard', 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: 858)
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)
andybroomfield commented 8 months ago

This is due to view unpublished module, might be something to do with a conflict between itself and content moderation. Possibly Drupal 10.2+ only.

andybroomfield commented 8 months ago

I traced this down to this patch.

https://www.drupal.org/files/issues/2023-11-27/1349080-537.patch (node_access filters out accessible nodes when node is left joined (1349080))

Located in Localgov_services. On the Drupal.org issue Localgov Drupal currently uses the patch in comment 537, there's actually a merge request and the patch has been committed to 10.3.

andybroomfield commented 7 months ago

The linked issue has now been fixed.