Warning: Undefined array key "rid" + Trying to access array offset on value of type null in nodeaccess_node_access()

Created on 2 May 2023, over 1 year ago
Updated 10 July 2024, 5 months ago

I don't have concrete steps to reproduce this non-deterministic error.

I just want to initiate the conversation in case others also have this error.

From time to time, I encounter 12 error messages while browsing a node as an anonymous user on Safari.

php	05/02/2023 - 11:38	Warning: Trying to access array offset on value of type…	Anonymous (not verified)	
php	05/02/2023 - 11:38	Warning: Trying to access array offset on value of type…	Anonymous (not verified)	
php	05/02/2023 - 11:38	Warning: Undefined array key "rid" in…				Anonymous (not verified)	
php	05/02/2023 - 11:38	Warning: Trying to access array offset on value of type…	Anonymous (not verified)	
php	05/02/2023 - 11:38	Warning: Trying to access array offset on value of type…	Anonymous (not verified)	
php	05/02/2023 - 11:38	Warning: Undefined array key "rid" in…				Anonymous (not verified)	
php	05/02/2023 - 11:38	Warning: Trying to access array offset on value of type…	Anonymous (not verified)	
php	05/02/2023 - 11:38	Warning: Trying to access array offset on value of type…	Anonymous (not verified)	
php	05/02/2023 - 11:38	Warning: Undefined array key "rid" in…				Anonymous (not verified)	
php	05/02/2023 - 11:38	Warning: Trying to access array offset on value of type…	Anonymous (not verified)	
php	05/02/2023 - 11:38	Warning: Trying to access array offset on value of type…	Anonymous (not verified)	
php	05/02/2023 - 11:38	Warning: Undefined array key "rid" in…				Anonymous (not verified)

Examples of the error:

Warning: Trying to access array offset on value of type null in nodeaccess_node_access() (line 276 of /home/{USER}/public_html/modules/contrib/nodeaccess/nodeaccess.module)
#0 /home/{USER}/public_html/core/includes/bootstrap.inc(347): _drupal_error_handler_real(2, 'Trying to acces...', '/home/{USER}/p...', 276)
#1 /home/{USER}/public_html/modules/contrib/nodeaccess/nodeaccess.module(276): _drupal_error_handler(2, 'Trying to acces...', '/home/{USER}/p...', 276)
#2 [internal function]: nodeaccess_node_access(Object(Drupal\node\Entity\Node), 'delete', Object(Drupal\Core\Session\AccountProxy))
#3 /home/{USER}/public_html/core/lib/Drupal/Core/Extension/ModuleHandler.php(426): call_user_func_array(Object(Closure), Array)
#4 /home/{USER}/public_html/core/lib/Drupal/Core/Extension/ModuleHandler.php(405): Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}(Object(Closure), 'nodeaccess')
#5 /home/{USER}/public_html/core/lib/Drupal/Core/Extension/ModuleHandler.php(433): Drupal\Core\Extension\ModuleHandler->invokeAllWith('node_access', Object(Closure))
#6 /home/{USER}/public_html/core/lib/Drupal/Core/Entity/EntityAccessControlHandler.php(97): Drupal\Core\Extension\ModuleHandler->invokeAll('node_access', Array)
#7 /home/{USER}/public_html/core/modules/node/src/NodeAccessControlHandler.php(105): Drupal\Core\Entity\EntityAccessControlHandler->access(Object(Drupal\node\Entity\Node), 'delete', Object(Drupal\Core\Session\AccountProxy), true)
#8 /home/{USER}/public_html/core/lib/Drupal/Core/Entity/ContentEntityBase.php(710): Drupal\node\NodeAccessControlHandler->access(Object(Drupal\node\Entity\Node), 'delete', Object(Drupal\Core\Session\AccountProxy), true)
#9 /home/{USER}/public_html/core/modules/node/src/Entity/Node.php(195): Drupal\Core\Entity\ContentEntityBase->access('delete', Object(Drupal\Core\Session\AccountProxy), true)
#10 /home/{USER}/public_html/core/lib/Drupal/Core/Entity/EntityAccessCheck.php(68): Drupal\node\Entity\Node->access('delete', Object(Drupal\Core\Session\AccountProxy), true)
#11 [internal function]: Drupal\Core\Entity\EntityAccessCheck->access(Object(Symfony\Component\Routing\Route), Object(Drupal\Core\Routing\RouteMatch), Object(Drupal\Core\Session\AccountProxy))
#12 /home/{USER}/public_html/core/lib/Drupal/Core/Access/AccessManager.php(160): call_user_func_array(Array, Array)
#13 /home/{USER}/public_html/core/lib/Drupal/Core/Access/AccessManager.php(136): Drupal\Core\Access\AccessManager->performCheck('access_check.en...', Object(Drupal\Component\Utility\ArgumentsResolver))
#14 /home/{USER}/public_html/core/lib/Drupal/Core/Access/AccessManager.php(93): Drupal\Core\Access\AccessManager->check(Object(Drupal\Core\Routing\RouteMatch), Object(Drupal\Core\Session\AccountProxy), NULL, true)
#15 /home/{USER}/public_html/core/lib/Drupal/Core/Menu/LocalTaskManager.php(327): Drupal\Core\Access\AccessManager->checkNamedRoute('entity.node.del...', Array, Object(Drupal\Core\Session\AccountProxy), true)
#16 /home/{USER}/public_html/core/lib/Drupal/Core/Menu/LocalTaskManager.php(358): Drupal\Core\Menu\LocalTaskManager->getTasksBuild('entity.node.can...', Object(Drupal\Core\Cache\CacheableMetadata))
#17 /home/{USER}/public_html/core/lib/Drupal/Core/Menu/Plugin/Block/LocalTasksBlock.php(95): Drupal\Core\Menu\LocalTaskManager->getLocalTasks('entity.node.can...', 0)
#18 /home/{USER}/public_html/core/modules/block/src/BlockViewBuilder.php(171): Drupal\Core\Menu\Plugin\Block\LocalTasksBlock->build()
#19 [internal function]: Drupal\block\BlockViewBuilder::preRender(Array)
#20 /home/{USER}/public_html/core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php(101): call_user_func_array(Array, Array)
#21 /home/{USER}/public_html/core/lib/Drupal/Core/Render/Renderer.php(788): Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_ren...', 'exception', 'Drupal\\Core\\Ren...')
#22 /home/{USER}/public_html/core/lib/Drupal/Core/Render/Renderer.php(374): Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array)
#23 /home/{USER}/public_html/core/lib/Drupal/Core/Render/Renderer.php(446): Drupal\Core\Render\Renderer->doRender(Array)
#24 /home/{USER}/public_html/core/lib/Drupal/Core/Render/Renderer.php(204): Drupal\Core\Render\Renderer->doRender(Array, false)
#25 /home/{USER}/public_html/core/lib/Drupal/Core/Template/TwigExtension.php(479): Drupal\Core\Render\Renderer->render(Array)
#26 /home/{USER}/public_html/sites/default/files/php/twig/644c527a312c0_page.html.twig_fFZ8kNxEp52n2MpXhBsQnCY9H/62JkAjccwK8StqZBED-hndNh4q8GLnsOfNNb9-zYo6g.php(113): Drupal\Core\Template\TwigExtension->escapeFilter(Object(Drupal\Core\Template\TwigEnvironment), Array, 'html', NULL, true)
#27 /home/{USER}/public_html/vendor/twig/twig/src/Template.php(405): __TwigTemplate_f6c2311af1195023da69219442093d7d->doDisplay(Array, Array)
#28 /home/{USER}/public_html/vendor/twig/twig/src/Template.php(378): Twig\Template->displayWithErrorHandling(Array, Array)
#29 /home/{USER}/public_html/vendor/twig/twig/src/Template.php(390): Twig\Template->display(Array)
#30 /home/{USER}/public_html/core/themes/engines/twig/twig.engine(55): Twig\Template->render(Array)
#31 /home/{USER}/public_html/core/lib/Drupal/Core/Theme/ThemeManager.php(384): twig_render_template('themes/custom/l...', Array)
#32 /home/{USER}/public_html/core/lib/Drupal/Core/Render/Renderer.php(433): Drupal\Core\Theme\ThemeManager->render('page', Array)
#33 /home/{USER}/public_html/core/lib/Drupal/Core/Render/Renderer.php(204): Drupal\Core\Render\Renderer->doRender(Array, false)
#34 /home/{USER}/public_html/core/lib/Drupal/Core/Template/TwigExtension.php(479): Drupal\Core\Render\Renderer->render(Array)
#35 /home/{USER}/public_html/sites/default/files/php/twig/644c527a312c0_html.html.twig_QXQ8FpeD8QuLFgZsj7--AXB6b/jnnT1BtwVnodgMQ4diHHdxGFdDWZ1B6KqOKxZz6OQGc.php(95): Drupal\Core\Template\TwigExtension->escapeFilter(Object(Drupal\Core\Template\TwigEnvironment), Array, 'html', NULL, true)
#36 /home/{USER}/public_html/vendor/twig/twig/src/Template.php(405): __TwigTemplate_09908d2bdf3e2ef5624b023ddd391081->doDisplay(Array, Array)
#37 /home/{USER}/public_html/vendor/twig/twig/src/Template.php(378): Twig\Template->displayWithErrorHandling(Array, Array)
#38 /home/{USER}/public_html/vendor/twig/twig/src/Template.php(390): Twig\Template->display(Array)
#39 /home/{USER}/public_html/core/themes/engines/twig/twig.engine(55): Twig\Template->render(Array)
#40 /home/{USER}/public_html/core/lib/Drupal/Core/Theme/ThemeManager.php(384): twig_render_template('themes/custom/l...', Array)
#41 /home/{USER}/public_html/core/lib/Drupal/Core/Render/Renderer.php(433): Drupal\Core\Theme\ThemeManager->render('html', Array)
#42 /home/{USER}/public_html/core/lib/Drupal/Core/Render/Renderer.php(204): Drupal\Core\Render\Renderer->doRender(Array, false)
#43 /home/{USER}/public_html/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(162): Drupal\Core\Render\Renderer->render(Array)
#44 /home/{USER}/public_html/core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}()
#45 /home/{USER}/public_html/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(163): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#46 /home/{USER}/public_html/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))
#47 [internal function]: Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object(Symfony\Component\HttpKernel\Event\ViewEvent), 'kernel.view', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#48 /home/{USER}/public_html/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))
#49 /home/{USER}/public_html/vendor/symfony/http-kernel/HttpKernel.php(174): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object(Symfony\Component\HttpKernel\Event\ViewEvent), 'kernel.view')
#50 /home/{USER}/public_html/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#51 /home/{USER}/public_html/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#52 /home/{USER}/public_html/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#53 /home/{USER}/public_html/core/modules/page_cache/src/StackMiddleware/PageCache.php(191): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#54 /home/{USER}/public_html/core/modules/page_cache/src/StackMiddleware/PageCache.php(128): Drupal\page_cache\StackMiddleware\PageCache->fetch(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#55 /home/{USER}/public_html/core/modules/page_cache/src/StackMiddleware/PageCache.php(82): Drupal\page_cache\StackMiddleware\PageCache->lookup(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#56 /home/{USER}/public_html/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#57 /home/{USER}/public_html/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#58 /home/{USER}/public_html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#59 /home/{USER}/public_html/core/lib/Drupal/Core/DrupalKernel.php(718): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#60 /home/{USER}/public_html/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#61 {main}
Warning: Undefined array key "rid" in nodeaccess_node_access() (line 276 of /home/{USER}/public_html/modules/contrib/nodeaccess/nodeaccess.module)
#0 /home/{USER}/public_html/core/includes/bootstrap.inc(347): _drupal_error_handler_real(2, 'Undefined array...', '/home/{USER}/p...', 276)
#1 /home/{USER}/public_html/modules/contrib/nodeaccess/nodeaccess.module(276): _drupal_error_handler(2, 'Undefined array...', '/home/{USER}/p...', 276)
#2 [internal function]: nodeaccess_node_access(Object(Drupal\node\Entity\Node), 'delete', Object(Drupal\Core\Session\AccountProxy))
#3 /home/{USER}/public_html/core/lib/Drupal/Core/Extension/ModuleHandler.php(426): call_user_func_array(Object(Closure), Array)
#4 /home/{USER}/public_html/core/lib/Drupal/Core/Extension/ModuleHandler.php(405): Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}(Object(Closure), 'nodeaccess')
#5 /home/{USER}/public_html/core/lib/Drupal/Core/Extension/ModuleHandler.php(433): Drupal\Core\Extension\ModuleHandler->invokeAllWith('node_access', Object(Closure))
#6 /home/{USER}/public_html/core/lib/Drupal/Core/Entity/EntityAccessControlHandler.php(97): Drupal\Core\Extension\ModuleHandler->invokeAll('node_access', Array)
#7 /home/{USER}/public_html/core/modules/node/src/NodeAccessControlHandler.php(105): Drupal\Core\Entity\EntityAccessControlHandler->access(Object(Drupal\node\Entity\Node), 'delete', Object(Drupal\Core\Session\AccountProxy), true)
#8 /home/{USER}/public_html/core/lib/Drupal/Core/Entity/ContentEntityBase.php(710): Drupal\node\NodeAccessControlHandler->access(Object(Drupal\node\Entity\Node), 'delete', Object(Drupal\Core\Session\AccountProxy), true)
#9 /home/{USER}/public_html/core/modules/node/src/Entity/Node.php(195): Drupal\Core\Entity\ContentEntityBase->access('delete', Object(Drupal\Core\Session\AccountProxy), true)
#10 /home/{USER}/public_html/core/lib/Drupal/Core/Entity/EntityAccessCheck.php(68): Drupal\node\Entity\Node->access('delete', Object(Drupal\Core\Session\AccountProxy), true)
#11 [internal function]: Drupal\Core\Entity\EntityAccessCheck->access(Object(Symfony\Component\Routing\Route), Object(Drupal\Core\Routing\RouteMatch), Object(Drupal\Core\Session\AccountProxy))
#12 /home/{USER}/public_html/core/lib/Drupal/Core/Access/AccessManager.php(160): call_user_func_array(Array, Array)
#13 /home/{USER}/public_html/core/lib/Drupal/Core/Access/AccessManager.php(136): Drupal\Core\Access\AccessManager->performCheck('access_check.en...', Object(Drupal\Component\Utility\ArgumentsResolver))
#14 /home/{USER}/public_html/core/lib/Drupal/Core/Access/AccessManager.php(93): Drupal\Core\Access\AccessManager->check(Object(Drupal\Core\Routing\RouteMatch), Object(Drupal\Core\Session\AccountProxy), NULL, true)
#15 /home/{USER}/public_html/core/lib/Drupal/Core/Menu/LocalTaskManager.php(327): Drupal\Core\Access\AccessManager->checkNamedRoute('entity.node.del...', Array, Object(Drupal\Core\Session\AccountProxy), true)
#16 /home/{USER}/public_html/core/lib/Drupal/Core/Menu/LocalTaskManager.php(358): Drupal\Core\Menu\LocalTaskManager->getTasksBuild('entity.node.can...', Object(Drupal\Core\Cache\CacheableMetadata))
#17 /home/{USER}/public_html/core/lib/Drupal/Core/Menu/Plugin/Block/LocalTasksBlock.php(95): Drupal\Core\Menu\LocalTaskManager->getLocalTasks('entity.node.can...', 0)
#18 /home/{USER}/public_html/core/modules/block/src/BlockViewBuilder.php(171): Drupal\Core\Menu\Plugin\Block\LocalTasksBlock->build()
#19 [internal function]: Drupal\block\BlockViewBuilder::preRender(Array)
#20 /home/{USER}/public_html/core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php(101): call_user_func_array(Array, Array)
#21 /home/{USER}/public_html/core/lib/Drupal/Core/Render/Renderer.php(788): Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_ren...', 'exception', 'Drupal\\Core\\Ren...')
#22 /home/{USER}/public_html/core/lib/Drupal/Core/Render/Renderer.php(374): Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array)
#23 /home/{USER}/public_html/core/lib/Drupal/Core/Render/Renderer.php(446): Drupal\Core\Render\Renderer->doRender(Array)
#24 /home/{USER}/public_html/core/lib/Drupal/Core/Render/Renderer.php(204): Drupal\Core\Render\Renderer->doRender(Array, false)
#25 /home/{USER}/public_html/core/lib/Drupal/Core/Template/TwigExtension.php(479): Drupal\Core\Render\Renderer->render(Array)
#26 /home/{USER}/public_html/sites/default/files/php/twig/644c527a312c0_page.html.twig_fFZ8kNxEp52n2MpXhBsQnCY9H/62JkAjccwK8StqZBED-hndNh4q8GLnsOfNNb9-zYo6g.php(113): Drupal\Core\Template\TwigExtension->escapeFilter(Object(Drupal\Core\Template\TwigEnvironment), Array, 'html', NULL, true)
#27 /home/{USER}/public_html/vendor/twig/twig/src/Template.php(405): __TwigTemplate_f6c2311af1195023da69219442093d7d->doDisplay(Array, Array)
#28 /home/{USER}/public_html/vendor/twig/twig/src/Template.php(378): Twig\Template->displayWithErrorHandling(Array, Array)
#29 /home/{USER}/public_html/vendor/twig/twig/src/Template.php(390): Twig\Template->display(Array)
#30 /home/{USER}/public_html/core/themes/engines/twig/twig.engine(55): Twig\Template->render(Array)
#31 /home/{USER}/public_html/core/lib/Drupal/Core/Theme/ThemeManager.php(384): twig_render_template('themes/custom/l...', Array)
#32 /home/{USER}/public_html/core/lib/Drupal/Core/Render/Renderer.php(433): Drupal\Core\Theme\ThemeManager->render('page', Array)
#33 /home/{USER}/public_html/core/lib/Drupal/Core/Render/Renderer.php(204): Drupal\Core\Render\Renderer->doRender(Array, false)
#34 /home/{USER}/public_html/core/lib/Drupal/Core/Template/TwigExtension.php(479): Drupal\Core\Render\Renderer->render(Array)
#35 /home/{USER}/public_html/sites/default/files/php/twig/644c527a312c0_html.html.twig_QXQ8FpeD8QuLFgZsj7--AXB6b/jnnT1BtwVnodgMQ4diHHdxGFdDWZ1B6KqOKxZz6OQGc.php(95): Drupal\Core\Template\TwigExtension->escapeFilter(Object(Drupal\Core\Template\TwigEnvironment), Array, 'html', NULL, true)
#36 /home/{USER}/public_html/vendor/twig/twig/src/Template.php(405): __TwigTemplate_09908d2bdf3e2ef5624b023ddd391081->doDisplay(Array, Array)
#37 /home/{USER}/public_html/vendor/twig/twig/src/Template.php(378): Twig\Template->displayWithErrorHandling(Array, Array)
#38 /home/{USER}/public_html/vendor/twig/twig/src/Template.php(390): Twig\Template->display(Array)
#39 /home/{USER}/public_html/core/themes/engines/twig/twig.engine(55): Twig\Template->render(Array)
#40 /home/{USER}/public_html/core/lib/Drupal/Core/Theme/ThemeManager.php(384): twig_render_template('themes/custom/l...', Array)
#41 /home/{USER}/public_html/core/lib/Drupal/Core/Render/Renderer.php(433): Drupal\Core\Theme\ThemeManager->render('html', Array)
#42 /home/{USER}/public_html/core/lib/Drupal/Core/Render/Renderer.php(204): Drupal\Core\Render\Renderer->doRender(Array, false)
#43 /home/{USER}/public_html/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(162): Drupal\Core\Render\Renderer->render(Array)
#44 /home/{USER}/public_html/core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}()
#45 /home/{USER}/public_html/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(163): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#46 /home/{USER}/public_html/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))
#47 [internal function]: Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object(Symfony\Component\HttpKernel\Event\ViewEvent), 'kernel.view', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#48 /home/{USER}/public_html/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))
#49 /home/{USER}/public_html/vendor/symfony/http-kernel/HttpKernel.php(174): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object(Symfony\Component\HttpKernel\Event\ViewEvent), 'kernel.view')
#50 /home/{USER}/public_html/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#51 /home/{USER}/public_html/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#52 /home/{USER}/public_html/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#53 /home/{USER}/public_html/core/modules/page_cache/src/StackMiddleware/PageCache.php(191): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#54 /home/{USER}/public_html/core/modules/page_cache/src/StackMiddleware/PageCache.php(128): Drupal\page_cache\StackMiddleware\PageCache->fetch(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#55 /home/{USER}/public_html/core/modules/page_cache/src/StackMiddleware/PageCache.php(82): Drupal\page_cache\StackMiddleware\PageCache->lookup(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#56 /home/{USER}/public_html/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#57 /home/{USER}/public_html/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#58 /home/{USER}/public_html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#59 /home/{USER}/public_html/core/lib/Drupal/Core/DrupalKernel.php(718): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#60 /home/{USER}/public_html/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#61 {main}
🐛 Bug report
Status

RTBC

Version

1.1

Component

Code

Created by

🇨🇦Canada Nathan Tsai

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Nathan Tsai
  • Status changed to Postponed: needs info over 1 year ago
  • 🇮🇳India samit.310@gmail.com

    Hi @Nathan Tsai,

    I am not able to reproduce this at my end, Looks like there is some module's version issue.

    The nodeaccess_node_access function is not exists in nodeaccess.module file. also nodeaccess.module file only have 204 lines of code.

    following, I am adding a line of code you added in the description.

    Warning: Undefined array key "rid" in nodeaccess_node_access() (line 276 of /home/{USER}/public_html/modules/contrib/nodeaccess/nodeaccess.module)

  • 🇨🇦Canada OMD

    I'm getting the same error for content that is not protected by node access:

    Node Access Version: 8.x-1.1
    Drupal Version 9.5.9

    Warning: Undefined array key "rid" in nodeaccess_node_access() (line 276 of /var/www/html/drupal/web/modules/contrib/nodeaccess/nodeaccess.module)

    #0 /var/www/html/drupal/web/core/includes/bootstrap.inc(347): _drupal_error_handler_real()
    #1 /var/www/html/drupal/web/modules/contrib/nodeaccess/nodeaccess.module(276): _drupal_error_handler()
    #2 [internal function]: nodeaccess_node_access()
    #3 /var/www/html/drupal/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(426): call_user_func_array()
    #4 /var/www/html/drupal/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(405): Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}()
    #5 /var/www/html/drupal/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(433): Drupal\Core\Extension\ModuleHandler->invokeAllWith()
    #6 /var/www/html/drupal/web/core/lib/Drupal/Core/Entity/EntityAccessControlHandler.php(97): Drupal\Core\Extension\ModuleHandler->invokeAll()
    #7 /var/www/html/drupal/web/core/modules/node/src/NodeAccessControlHandler.php(105): Drupal\Core\Entity\EntityAccessControlHandler->access()
    #8 /var/www/html/drupal/web/core/lib/Drupal/Core/Entity/ContentEntityBase.php(710): Drupal\node\NodeAccessControlHandler->access()
    #9 /var/www/html/drupal/web/core/modules/node/src/Entity/Node.php(195): Drupal\Core\Entity\ContentEntityBase->access()
    #10 /var/www/html/drupal/web/core/lib/Drupal/Core/Entity/EntityAccessCheck.php(68): Drupal\node\Entity\Node->access()
    #11 [internal function]: Drupal\Core\Entity\EntityAccessCheck->access()
    #12 /var/www/html/drupal/web/core/lib/Drupal/Core/Access/AccessManager.php(160): call_user_func_array()
    #13 /var/www/html/drupal/web/core/lib/Drupal/Core/Access/AccessManager.php(136): Drupal\Core\Access\AccessManager->performCheck()
    #14 /var/www/html/drupal/web/core/lib/Drupal/Core/Access/AccessManager.php(93): Drupal\Core\Access\AccessManager->check()
    #15 /var/www/html/drupal/web/core/lib/Drupal/Core/Menu/LocalTaskManager.php(327): Drupal\Core\Access\AccessManager->checkNamedRoute()
    #16 /var/www/html/drupal/web/core/lib/Drupal/Core/Menu/LocalTaskManager.php(358): Drupal\Core\Menu\LocalTaskManager->getTasksBuild()
    #17 /var/www/html/drupal/web/core/lib/Drupal/Core/Menu/Plugin/Block/LocalTasksBlock.php(95): Drupal\Core\Menu\LocalTaskManager->getLocalTasks()
    #18 /var/www/html/drupal/web/core/modules/block/src/BlockViewBuilder.php(171): Drupal\Core\Menu\Plugin\Block\LocalTasksBlock->build()
    #19 [internal function]: Drupal\block\BlockViewBuilder::preRender()
    #20 /var/www/html/drupal/web/core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php(101): call_user_func_array()
    #21 /var/www/html/drupal/web/core/lib/Drupal/Core/Render/Renderer.php(788): Drupal\Core\Render\Renderer->doTrustedCallback()
    #22 /var/www/html/drupal/web/core/lib/Drupal/Core/Render/Renderer.php(374): Drupal\Core\Render\Renderer->doCallback()
    #23 /var/www/html/drupal/web/core/lib/Drupal/Core/Render/Renderer.php(446): Drupal\Core\Render\Renderer->doRender()
    #24 /var/www/html/drupal/web/core/lib/Drupal/Core/Render/Renderer.php(204): Drupal\Core\Render\Renderer->doRender()
    #25 /var/www/html/drupal/web/core/lib/Drupal/Core/Template/TwigExtension.php(479): Drupal\Core\Render\Renderer->render()
    #26 /var/www/html/drupal/web/sites/default/files/php/twig/6481d54819d62_page.html.twig_tLX3lPAG5dWYGtWw8b8JXWQEv/aKal22MJHFblo_i_SqOXTNdTm10wA5vPCmOGlMswQkI.php(83): Drupal\Core\Template\TwigExtension->escapeFilter()
    #27 /var/www/html/drupal/vendor/twig/twig/src/Template.php(405): __TwigTemplate_3e135de154d5de9377e6dc85c6165ee7->doDisplay()
    #28 /var/www/html/drupal/vendor/twig/twig/src/Template.php(378): Twig\Template->displayWithErrorHandling()
    #29 /var/www/html/drupal/vendor/twig/twig/src/Template.php(390): Twig\Template->display()
    #30 /var/www/html/drupal/web/core/themes/engines/twig/twig.engine(55): Twig\Template->render()
    #31 /var/www/html/drupal/web/core/lib/Drupal/Core/Theme/ThemeManager.php(384): twig_render_template()
    #32 /var/www/html/drupal/web/core/lib/Drupal/Core/Render/Renderer.php(433): Drupal\Core\Theme\ThemeManager->render()
    #33 /var/www/html/drupal/web/core/lib/Drupal/Core/Render/Renderer.php(204): Drupal\Core\Render\Renderer->doRender()
    #34 /var/www/html/drupal/web/core/lib/Drupal/Core/Template/TwigExtension.php(479): Drupal\Core\Render\Renderer->render()
    #35 /var/www/html/drupal/web/sites/default/files/php/twig/6481d54819d62_html.html.twig_6hWXcJ1V-Qz6Co4MgIuQvr8BF/GeseC_Qu_u9SIMKWzBHNuUex80uZo4d_6Km3UlI_UFQ.php(109): Drupal\Core\Template\TwigExtension->escapeFilter()
    #36 /var/www/html/drupal/vendor/twig/twig/src/Template.php(405): __TwigTemplate_9820deedac8deb08ba334f2bbd93e4f8->doDisplay()
    #37 /var/www/html/drupal/vendor/twig/twig/src/Template.php(378): Twig\Template->displayWithErrorHandling()
    #38 /var/www/html/drupal/vendor/twig/twig/src/Template.php(390): Twig\Template->display()
    #39 /var/www/html/drupal/web/core/themes/engines/twig/twig.engine(55): Twig\Template->render()
    #40 /var/www/html/drupal/web/core/lib/Drupal/Core/Theme/ThemeManager.php(384): twig_render_template()
    #41 /var/www/html/drupal/web/core/lib/Drupal/Core/Render/Renderer.php(433): Drupal\Core\Theme\ThemeManager->render()
    #42 /var/www/html/drupal/web/core/lib/Drupal/Core/Render/Renderer.php(204): Drupal\Core\Render\Renderer->doRender()
    #43 /var/www/html/drupal/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(162): Drupal\Core\Render\Renderer->render()
    #44 /var/www/html/drupal/web/core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}()
    #45 /var/www/html/drupal/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(163): Drupal\Core\Render\Renderer->executeInRenderContext()
    #46 /var/www/html/drupal/web/core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php(90): Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse()
    #47 [internal function]: Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray()
    #48 /var/www/html/drupal/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(142): call_user_func()
    #49 /var/www/html/drupal/vendor/symfony/http-kernel/HttpKernel.php(174): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch()
    #50 /var/www/html/drupal/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
    #51 /var/www/html/drupal/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle()
    #52 /var/www/html/drupal/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
    #53 /var/www/html/drupal/web/modules/contrib/cleantalk/src/EventSubscriber/BootSubscriber.php(187): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
    #54 /var/www/html/drupal/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\cleantalk\EventSubscriber\BootSubscriber->handle()
    #55 /var/www/html/drupal/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
    #56 /var/www/html/drupal/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
    #57 /var/www/html/drupal/web/core/lib/Drupal/Core/DrupalKernel.php(718): Stack\StackedHttpKernel->handle()
    #58 /var/www/html/drupal/web/index.php(19): Drupal\Core\DrupalKernel->handle()
    #59 {main}

  • 🇨🇦Canada OMD

    I'm getting a similar warning triggered by line 276 as well. Not sure if it's related but there's the warning info from drupal log. Oddly this is being triggered on a node that is not access controlled.

    Warning: Trying to access array offset on value of type null in nodeaccess_node_access() (line 276 of /var/www/html/drupal/web/modules/contrib/nodeaccess/nodeaccess.module)

    #0 /var/www/html/drupal/web/core/includes/bootstrap.inc(347): _drupal_error_handler_real()
    #1 /var/www/html/drupal/web/modules/contrib/nodeaccess/nodeaccess.module(276): _drupal_error_handler()
    #2 [internal function]: nodeaccess_node_access()
    #3 /var/www/html/drupal/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(426): call_user_func_array()
    #4 /var/www/html/drupal/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(405): Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}()
    #5 /var/www/html/drupal/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(433): Drupal\Core\Extension\ModuleHandler->invokeAllWith()
    #6 /var/www/html/drupal/web/core/lib/Drupal/Core/Entity/EntityAccessControlHandler.php(97): Drupal\Core\Extension\ModuleHandler->invokeAll()
    #7 /var/www/html/drupal/web/core/modules/node/src/NodeAccessControlHandler.php(105): Drupal\Core\Entity\EntityAccessControlHandler->access()
    #8 /var/www/html/drupal/web/core/lib/Drupal/Core/Entity/ContentEntityBase.php(710): Drupal\node\NodeAccessControlHandler->access()
    #9 /var/www/html/drupal/web/core/modules/node/src/Entity/Node.php(195): Drupal\Core\Entity\ContentEntityBase->access()
    #10 /var/www/html/drupal/web/core/lib/Drupal/Core/Entity/EntityAccessCheck.php(68): Drupal\node\Entity\Node->access()
    #11 [internal function]: Drupal\Core\Entity\EntityAccessCheck->access()
    #12 /var/www/html/drupal/web/core/lib/Drupal/Core/Access/AccessManager.php(160): call_user_func_array()
    #13 /var/www/html/drupal/web/core/lib/Drupal/Core/Access/AccessManager.php(136): Drupal\Core\Access\AccessManager->performCheck()
    #14 /var/www/html/drupal/web/core/lib/Drupal/Core/Access/AccessManager.php(93): Drupal\Core\Access\AccessManager->check()
    #15 /var/www/html/drupal/web/core/lib/Drupal/Core/Menu/LocalTaskManager.php(327): Drupal\Core\Access\AccessManager->checkNamedRoute()
    #16 /var/www/html/drupal/web/core/lib/Drupal/Core/Menu/LocalTaskManager.php(358): Drupal\Core\Menu\LocalTaskManager->getTasksBuild()
    #17 /var/www/html/drupal/web/core/lib/Drupal/Core/Menu/Plugin/Block/LocalTasksBlock.php(95): Drupal\Core\Menu\LocalTaskManager->getLocalTasks()
    #18 /var/www/html/drupal/web/core/modules/block/src/BlockViewBuilder.php(171): Drupal\Core\Menu\Plugin\Block\LocalTasksBlock->build()
    #19 [internal function]: Drupal\block\BlockViewBuilder::preRender()
    #20 /var/www/html/drupal/web/core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php(101): call_user_func_array()
    #21 /var/www/html/drupal/web/core/lib/Drupal/Core/Render/Renderer.php(788): Drupal\Core\Render\Renderer->doTrustedCallback()
    #22 /var/www/html/drupal/web/core/lib/Drupal/Core/Render/Renderer.php(374): Drupal\Core\Render\Renderer->doCallback()
    #23 /var/www/html/drupal/web/core/lib/Drupal/Core/Render/Renderer.php(446): Drupal\Core\Render\Renderer->doRender()
    #24 /var/www/html/drupal/web/core/lib/Drupal/Core/Render/Renderer.php(204): Drupal\Core\Render\Renderer->doRender()
    #25 /var/www/html/drupal/web/core/lib/Drupal/Core/Template/TwigExtension.php(479): Drupal\Core\Render\Renderer->render()
    #26 /var/www/html/drupal/web/sites/default/files/php/twig/64b9161e11d89_page.html.twig_tLX3lPAG5dWYGtWw8b8JXWQEv/NR-hfDevAXcDXWQrSd7CyLJrHa5D1MLr60D2NyDWrbI.php(83): Drupal\Core\Template\TwigExtension->escapeFilter()
    #27 /var/www/html/drupal/vendor/twig/twig/src/Template.php(405): __TwigTemplate_3e135de154d5de9377e6dc85c6165ee7->doDisplay()
    #28 /var/www/html/drupal/vendor/twig/twig/src/Template.php(378): Twig\Template->displayWithErrorHandling()
    #29 /var/www/html/drupal/vendor/twig/twig/src/Template.php(390): Twig\Template->display()
    #30 /var/www/html/drupal/web/core/themes/engines/twig/twig.engine(55): Twig\Template->render()
    #31 /var/www/html/drupal/web/core/lib/Drupal/Core/Theme/ThemeManager.php(384): twig_render_template()
    #32 /var/www/html/drupal/web/core/lib/Drupal/Core/Render/Renderer.php(433): Drupal\Core\Theme\ThemeManager->render()
    #33 /var/www/html/drupal/web/core/lib/Drupal/Core/Render/Renderer.php(204): Drupal\Core\Render\Renderer->doRender()
    #34 /var/www/html/drupal/web/core/lib/Drupal/Core/Template/TwigExtension.php(479): Drupal\Core\Render\Renderer->render()
    #35 /var/www/html/drupal/web/sites/default/files/php/twig/64b9161e11d89_html.html.twig_6hWXcJ1V-Qz6Co4MgIuQvr8BF/dyAQBUrxCqdR4phYiFisBpfpGLQV7oCFByX8RVFSo-M.php(109): Drupal\Core\Template\TwigExtension->escapeFilter()
    #36 /var/www/html/drupal/vendor/twig/twig/src/Template.php(405): __TwigTemplate_9820deedac8deb08ba334f2bbd93e4f8->doDisplay()
    #37 /var/www/html/drupal/vendor/twig/twig/src/Template.php(378): Twig\Template->displayWithErrorHandling()
    #38 /var/www/html/drupal/vendor/twig/twig/src/Template.php(390): Twig\Template->display()
    #39 /var/www/html/drupal/web/core/themes/engines/twig/twig.engine(55): Twig\Template->render()
    #40 /var/www/html/drupal/web/core/lib/Drupal/Core/Theme/ThemeManager.php(384): twig_render_template()
    #41 /var/www/html/drupal/web/core/lib/Drupal/Core/Render/Renderer.php(433): Drupal\Core\Theme\ThemeManager->render()
    #42 /var/www/html/drupal/web/core/lib/Drupal/Core/Render/Renderer.php(204): Drupal\Core\Render\Renderer->doRender()
    #43 /var/www/html/drupal/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(162): Drupal\Core\Render\Renderer->render()
    #44 /var/www/html/drupal/web/core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}()
    #45 /var/www/html/drupal/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(163): Drupal\Core\Render\Renderer->executeInRenderContext()
    #46 /var/www/html/drupal/web/core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php(90): Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse()
    #47 [internal function]: Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray()
    #48 /var/www/html/drupal/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(142): call_user_func()
    #49 /var/www/html/drupal/vendor/symfony/http-kernel/HttpKernel.php(174): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch()
    #50 /var/www/html/drupal/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
    #51 /var/www/html/drupal/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle()
    #52 /var/www/html/drupal/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
    #53 /var/www/html/drupal/web/modules/contrib/cleantalk/src/EventSubscriber/BootSubscriber.php(187): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
    #54 /var/www/html/drupal/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\cleantalk\EventSubscriber\BootSubscriber->handle()
    #55 /var/www/html/drupal/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
    #56 /var/www/html/drupal/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
    #57 /var/www/html/drupal/web/core/lib/Drupal/Core/DrupalKernel.php(718): Stack\StackedHttpKernel->handle()
    #58 /var/www/html/drupal/web/index.php(19): Drupal\Core\DrupalKernel->handle()
    #59 {main}

  • 🇨🇦Canada OMD

    in tandem with that warning I'm also getting the Undefined array key "rid" warning as well:

    Warning: Undefined array key "rid" in nodeaccess_node_access() (line 276 of /var/www/html/drupal/web/modules/contrib/nodeaccess/nodeaccess.module)

    #0 /var/www/html/drupal/web/core/includes/bootstrap.inc(347): _drupal_error_handler_real()
    #1 /var/www/html/drupal/web/modules/contrib/nodeaccess/nodeaccess.module(276): _drupal_error_handler()
    #2 [internal function]: nodeaccess_node_access()
    #3 /var/www/html/drupal/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(426): call_user_func_array()
    #4 /var/www/html/drupal/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(405): Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}()
    #5 /var/www/html/drupal/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(433): Drupal\Core\Extension\ModuleHandler->invokeAllWith()
    #6 /var/www/html/drupal/web/core/lib/Drupal/Core/Entity/EntityAccessControlHandler.php(97): Drupal\Core\Extension\ModuleHandler->invokeAll()
    #7 /var/www/html/drupal/web/core/modules/node/src/NodeAccessControlHandler.php(105): Drupal\Core\Entity\EntityAccessControlHandler->access()
    #8 /var/www/html/drupal/web/core/lib/Drupal/Core/Entity/ContentEntityBase.php(710): Drupal\node\NodeAccessControlHandler->access()
    #9 /var/www/html/drupal/web/core/modules/node/src/Entity/Node.php(195): Drupal\Core\Entity\ContentEntityBase->access()
    #10 /var/www/html/drupal/web/core/lib/Drupal/Core/Entity/EntityAccessCheck.php(68): Drupal\node\Entity\Node->access()
    #11 [internal function]: Drupal\Core\Entity\EntityAccessCheck->access()
    #12 /var/www/html/drupal/web/core/lib/Drupal/Core/Access/AccessManager.php(160): call_user_func_array()
    #13 /var/www/html/drupal/web/core/lib/Drupal/Core/Access/AccessManager.php(136): Drupal\Core\Access\AccessManager->performCheck()
    #14 /var/www/html/drupal/web/core/lib/Drupal/Core/Access/AccessManager.php(93): Drupal\Core\Access\AccessManager->check()
    #15 /var/www/html/drupal/web/core/lib/Drupal/Core/Menu/LocalTaskManager.php(327): Drupal\Core\Access\AccessManager->checkNamedRoute()
    #16 /var/www/html/drupal/web/core/lib/Drupal/Core/Menu/LocalTaskManager.php(358): Drupal\Core\Menu\LocalTaskManager->getTasksBuild()
    #17 /var/www/html/drupal/web/core/lib/Drupal/Core/Menu/Plugin/Block/LocalTasksBlock.php(95): Drupal\Core\Menu\LocalTaskManager->getLocalTasks()
    #18 /var/www/html/drupal/web/core/modules/block/src/BlockViewBuilder.php(171): Drupal\Core\Menu\Plugin\Block\LocalTasksBlock->build()
    #19 [internal function]: Drupal\block\BlockViewBuilder::preRender()
    #20 /var/www/html/drupal/web/core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php(101): call_user_func_array()
    #21 /var/www/html/drupal/web/core/lib/Drupal/Core/Render/Renderer.php(788): Drupal\Core\Render\Renderer->doTrustedCallback()
    #22 /var/www/html/drupal/web/core/lib/Drupal/Core/Render/Renderer.php(374): Drupal\Core\Render\Renderer->doCallback()
    #23 /var/www/html/drupal/web/core/lib/Drupal/Core/Render/Renderer.php(446): Drupal\Core\Render\Renderer->doRender()
    #24 /var/www/html/drupal/web/core/lib/Drupal/Core/Render/Renderer.php(204): Drupal\Core\Render\Renderer->doRender()
    #25 /var/www/html/drupal/web/core/lib/Drupal/Core/Template/TwigExtension.php(479): Drupal\Core\Render\Renderer->render()
    #26 /var/www/html/drupal/web/sites/default/files/php/twig/64b918864031d_page.html.twig_tLX3lPAG5dWYGtWw8b8JXWQEv/YqFOnnW-6ePvfmiNG-F8xMd2iLQNwICeESJLeWD8ivY.php(83): Drupal\Core\Template\TwigExtension->escapeFilter()
    #27 /var/www/html/drupal/vendor/twig/twig/src/Template.php(405): __TwigTemplate_3e135de154d5de9377e6dc85c6165ee7->doDisplay()
    #28 /var/www/html/drupal/vendor/twig/twig/src/Template.php(378): Twig\Template->displayWithErrorHandling()
    #29 /var/www/html/drupal/vendor/twig/twig/src/Template.php(390): Twig\Template->display()
    #30 /var/www/html/drupal/web/core/themes/engines/twig/twig.engine(55): Twig\Template->render()
    #31 /var/www/html/drupal/web/core/lib/Drupal/Core/Theme/ThemeManager.php(384): twig_render_template()
    #32 /var/www/html/drupal/web/core/lib/Drupal/Core/Render/Renderer.php(433): Drupal\Core\Theme\ThemeManager->render()
    #33 /var/www/html/drupal/web/core/lib/Drupal/Core/Render/Renderer.php(204): Drupal\Core\Render\Renderer->doRender()
    #34 /var/www/html/drupal/web/core/lib/Drupal/Core/Template/TwigExtension.php(479): Drupal\Core\Render\Renderer->render()
    #35 /var/www/html/drupal/web/sites/default/files/php/twig/64b918864031d_html.html.twig_6hWXcJ1V-Qz6Co4MgIuQvr8BF/r0ykf4em7G2uZDFMxiMaTUUNpDQDzO66Fg-8QqxKr3E.php(109): Drupal\Core\Template\TwigExtension->escapeFilter()
    #36 /var/www/html/drupal/vendor/twig/twig/src/Template.php(405): __TwigTemplate_9820deedac8deb08ba334f2bbd93e4f8->doDisplay()
    #37 /var/www/html/drupal/vendor/twig/twig/src/Template.php(378): Twig\Template->displayWithErrorHandling()
    #38 /var/www/html/drupal/vendor/twig/twig/src/Template.php(390): Twig\Template->display()
    #39 /var/www/html/drupal/web/core/themes/engines/twig/twig.engine(55): Twig\Template->render()
    #40 /var/www/html/drupal/web/core/lib/Drupal/Core/Theme/ThemeManager.php(384): twig_render_template()
    #41 /var/www/html/drupal/web/core/lib/Drupal/Core/Render/Renderer.php(433): Drupal\Core\Theme\ThemeManager->render()
    #42 /var/www/html/drupal/web/core/lib/Drupal/Core/Render/Renderer.php(204): Drupal\Core\Render\Renderer->doRender()
    #43 /var/www/html/drupal/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(162): Drupal\Core\Render\Renderer->render()
    #44 /var/www/html/drupal/web/core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}()
    #45 /var/www/html/drupal/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(163): Drupal\Core\Render\Renderer->executeInRenderContext()
    #46 /var/www/html/drupal/web/core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php(90): Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse()
    #47 [internal function]: Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray()
    #48 /var/www/html/drupal/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(142): call_user_func()
    #49 /var/www/html/drupal/vendor/symfony/http-kernel/HttpKernel.php(174): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch()
    #50 /var/www/html/drupal/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
    #51 /var/www/html/drupal/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle()
    #52 /var/www/html/drupal/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
    #53 /var/www/html/drupal/web/modules/contrib/cleantalk/src/EventSubscriber/BootSubscriber.php(187): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
    #54 /var/www/html/drupal/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\cleantalk\EventSubscriber\BootSubscriber->handle()
    #55 /var/www/html/drupal/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
    #56 /var/www/html/drupal/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
    #57 /var/www/html/drupal/web/core/lib/Drupal/Core/DrupalKernel.php(718): Stack\StackedHttpKernel->handle()
    #58 /var/www/html/drupal/web/index.php(19): Drupal\Core\DrupalKernel->handle()
    #59 {main}

  • 🇨🇦Canada OMD

    I'm using a stable release version as well Version: 8.x-1.1 not the alpha version

  • 🇨🇦Canada OMD

    After investigating more, I discovered this is only happening when users are viewing older nodes that have "anonymous" as the author, presumably because the author's user account is no longer active. I can confirm that if I assign an author to the offending node, and then visit it that node, there is no further php warning messasges in the logs for this node.

  • 🇨🇦Canada Nathan Tsai

    So, the issue is the with 1.x branch.

    And it appears that many other pages also receive the error (on the public-facing side of the website) looking at Google:

    https://www.google.com/search?q=Warning%3A+Undefined+array+key+%22rid%22...

  • 🇨🇦Canada Nathan Tsai

    So the code in question is below.

    The question is: why is _nodeaccess_get_grants($node) returning an empty array for some nodes?

    I also tried resaving the Node Access page, but it didn't resolve the issue.

    /**
     * Implements hook_node_access().
     */
    function nodeaccess_node_access(NodeInterface $node, $op, $account) {
      $settings = \Drupal::configFactory()->get('nodeaccess.settings');
      $role_map = $settings->get('role_map');
      switch ($op) {
        case 'update':
        case 'delete':
          // If the node belongs to a deleted user.
          if ($account->id() == 0 && $node->getOwnerId() == 0) {
            // We check if the role has particular access to this node.
            $grants = _nodeaccess_get_grants($node);
            $anonymous_rid = $role_map[AccountInterface::ANONYMOUS_ROLE];
            // If anonymous has rights to this node, we allow them.
            if (($grants['rid'][$anonymous_rid]['grant_update'] && $op == 'update') ||
                ($grants['rid'][$anonymous_rid]['grant_delete'] && $op == 'delete')) {
              return AccessResult::Allowed();
            }
            return AccessResult::forbidden();
          }
          break;
      }
    }
    
  • 🇫🇮Finland jviitamaki

    In my use case this comes up for node types which doesn't have nodeaccess enabled.
    Attached patch which at least circumvents the error message although there might be a better way to fix this.

  • Status changed to RTBC about 1 year ago
  • 🇺🇸United States BenStallings

    +1 for this patch. PHP doesn't like us to reference array keys that aren't defined. IMO it doesn't matter why the keys are not defined; we need to do a sanity check because PHP demands we do a sanity check.

  • This is still an issue on 2.0.x as well

Production build 0.71.5 2024