- Issue created by @dydave
- Merge request !96Issue #3466743 by DYdave: Fixed fatal error 'Call to undefined method... → (Open) created by dydave
- Status changed to Needs review
5 months ago 11:20pm 7 August 2024 - 🇫🇷France dydave
Quick follow-up on this issue:
Fixed fatal error 'Call to undefined method Drupal\Core\Menu\MenuLinkManager::invalidateAll()' and added basic automated tests for the 'AdminToolbarToolsSettingsForm':
Submit the form and confirm it doesn't crash with error.✅ The merge request seems to be passing all tests, thus moving issue to Needs review.
Please note: much more work is needed to improve the tests for the
AdminToolbarToolsSettingsForm
, in particular:
While trying to write tests formax_bundle_number
it appeared issue 🐛 Max Bundles not being honored Fixed is still not completely fixed:
Tested with Media bundles: Setting themax_bundle_number
to2
, for example, on a standard fresh D10 install (which should install several Media bundles by default: Audio, Document, Image, etc...), doesn't have any effect on the links underContent > Add media
==> All bundles are still displayed in the menu (under Content).However, this setting seems to work with menu items under
Structure
.I'm not sure if this is by design, but it is a bit misleading, as we would potentially expect bundles would be limited everywhere links for entity bundles are added, as the field says:
Maximum number of bundle sub-menus to display
Loading a large number of items can cause performance issues.
In any case, this should most likely be addressed in a separate ticket, so for the time being, the tests minimally cover the error reported in this issue summary.
We would greatly appreciate if a maintainer or someone with write permission could take a look at ticket's merge request MR!96 and let us know if there would be any more work needed.
Feel free to let us know if you have any questions or concerns on any of the changes in the merge request or any aspect of this ticket in general, we would surely be glad to help.
Thanks in advance for your feedback and reviews. Similar problem here:
- A batch upgrade from D10.2.7 to 10.3.2 brought the WSOD. A selective upgrade on 10.3.1 with PHP 8.3.9 made possible to pinpoint 'admin_toolbar' as the primary culprit, in combination with the 'admin_toolbar_tools'.
Upgrading 'admin_toolbar_tools' (3.4.2 => 3.5.0) first while keeping 'admin_toolbar' at 3.4.2 went well. Then upgrading 'admin_toolbar' (3.4.2 => 3.5.0) as well yielded the trace below:TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, null given in method_exists() (line 68 of modules/contrib/admin_toolbar/admin_toolbar_tools/src/Plugin/Menu/MenuLinkEntity.php).
Drupal\admin_toolbar_tools\Plugin\Menu\MenuLinkEntity->getDescription() (Line: 124)
Drupal\Core\Menu\MenuLinkBase->getUrlObject() (Line: 215)
Drupal\Core\Menu\DefaultMenuLinkTreeManipulators->menuLinkCheckAccess() (Line: 107)
Drupal\Core\Menu\DefaultMenuLinkTreeManipulators->checkAccess() (Line: 111)
Drupal\Core\Menu\DefaultMenuLinkTreeManipulators->checkAccess() (Line: 111)
Drupal\Core\Menu\DefaultMenuLinkTreeManipulators->checkAccess()
call_user_func() (Line: 153)
Drupal\Core\Menu\MenuLinkTree->transform() (Line: 124)
Drupal\toolbar\Controller\ToolbarController::preRenderGetRenderedSubtrees()
call_user_func_array() (Line: 113)
Drupal\Core\Render\Renderer->doTrustedCallback() (Line: 870)
Drupal\Core\Render\Renderer->doCallback() (Line: 432)
Drupal\Core\Render\Renderer->doRender() (Line: 248)
Drupal\Core\Render\Renderer->render() (Line: 283)
{closure}() (Line: 638)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 282)
toolbar_get_rendered_subtrees() (Line: 295)
_toolbar_get_subtrees_hash() (Line: 168)
toolbar_toolbar()
call_user_func_array() (Line: 416)
Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}() (Line: 395)
Drupal\Core\Extension\ModuleHandler->invokeAllWith() (Line: 415)
Drupal\Core\Extension\ModuleHandler->invokeAll() (Line: 78)
Drupal\toolbar\Element\Toolbar::preRenderToolbar()
call_user_func_array() (Line: 113)
Drupal\Core\Render\Renderer->doTrustedCallback() (Line: 870)
Drupal\Core\Render\Renderer->doCallback() (Line: 432)
Drupal\Core\Render\Renderer->doRender() (Line: 504)
Drupal\Core\Render\Renderer->doRender() (Line: 248)
Drupal\Core\Render\Renderer->render() (Line: 475)
Drupal\Core\Template\TwigExtension->escapeFilter() (Line: 83)
__TwigTemplate_d68a68533d331dfee346749b4e3826a0->doDisplay() (Line: 360)
Twig\Template->yield() (Line: 335)
Twig\Template->render() (Line: 38)
Twig\TemplateWrapper->render() (Line: 33)
twig_render_template() (Line: 348)
Drupal\Core\Theme\ThemeManager->render() (Line: 491)
Drupal\Core\Render\Renderer->doRender() (Line: 248)
Drupal\Core\Render\Renderer->render() (Line: 158)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 638)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 153)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse() (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray()
call_user_func() (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch() (Line: 186)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 50)
Drupal\ban\BanMiddleware->handle() (Line: 263)
Drupal\shield\ShieldMiddleware->bypass() (Line: 219)
Drupal\shield\ShieldMiddleware->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)s
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 741)
Drupal\Core\DrupalKernel->handle() (Line: 19)- 🇫🇷France dydave
@dgwolf ==> Wrong issue :
Could you please take a look at : 🐛 TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, null given Needs review ?
Thanks in advance !
- Status changed to Needs work
4 months ago 9:10pm 6 September 2024 - 🇨🇦Canada Liam Morland Ontario, CA 🇨🇦
@dydave The merge request only adds a test. It does not appear to do anything that would fix the error with
::invalidateAll()
. - 🇩🇪Germany osopolar 🇩🇪 GER 🌐
It seems that the fix got committed with the related issue 🐛 [AdminToolbarSettingsForm] Fix Fatal Error: Call to undefined method Drupal\Core\Menu\MenuLinkManager::invalidateAll() Fixed , see also https://git.drupalcode.org/project/admin_toolbar/-/merge_requests/94/diffs