Symfony\Component\Routing\Exception\MissingMandatoryParametersException: Some mandatory parameters are missing ("source") to generate a URL for route "project_browser.browse". in Drupal\Core\Routing\UrlGenerator->doGenerate() (line 180 of core/lib/Drupal/

Created on 15 January 2025, 4 months ago

Problem/Motivation

Following the following step produces the famous, The website encountered an unexpected error. Try again later. message.

Steps to reproduce

Installed Drupal CMS using DDEV, it was working as expected

  • Install admin toolbar module in Project Browser UI
  • Go to extend and check Admin Toolbar Extra Tools
  • Click Install

Proposed resolution

User interface changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Active

Component

General

Created by

πŸ‡³πŸ‡ΏNew Zealand siramsay

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

Comments & Activities

  • Issue created by @siramsay
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

    I suspect this is a bug in Project Browser, and likely one that would necessitate a new version once we fix it.

    Moving to Project Browser's issue queue for the time being, but tagging it as being of importance to Drupal CMS.

  • πŸ‡³πŸ‡ΏNew Zealand siramsay

    Yes, you are probably right. I added Admin Toolbar Extras with no issue using a non-ddev instance using composer require admin_toolbar last week. Works fine.

  • πŸ‡ΊπŸ‡¬Uganda Thomas Kaisuka

    Mine was throwing up these errors that even made me contact my hosting provider

    [16-Jan-2025 13:27:22 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'oci8.so' (tried: /opt/alt/php83/usr/lib64/php/modules/oci8.so (libclntsh.so.12.1: cannot open shared object file: No such file or directory), /opt/alt/php83/usr/lib64/php/modules/oci8.so.so (/opt/alt/php83/usr/lib64/php/modules/oci8.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
    [16-Jan-2025 13:27:22 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_oci.so' (tried: /opt/alt/php83/usr/lib64/php/modules/pdo_oci.so (libclntsh.so.21.1: cannot open shared object file: No such file or directory), /opt/alt/php83/usr/lib64/php/modules/pdo_oci.so.so (/opt/alt/php83/usr/lib64/php/modules/pdo_oci.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

    So i just unsintalled project browser and my site was up and running normally.

    In my case, i could access the site without logging in. Once i logged into the back end, all i would get was a WSOD

  • πŸ‡ΊπŸ‡ΈUnited States tim.plunkett Philadelphia

    There's a chance this could be mitigated by πŸ› WSOD when using settings to limit sources to recipes Active .
    Both are tied to the changes made in ✨ Make all enabled sources exposed as local tasks Active .

    It's not clear if the report in #4 is related, that seems to be about Oracle DBs?

  • πŸ‡ΊπŸ‡ΈUnited States tim.plunkett Philadelphia

    Admin Toolbar Extra Tools adds a menu link for Project Browser:
    https://git.drupalcode.org/project/admin_toolbar/-/blob/3.x/admin_toolba...

    However, that URL won't work anymore now that there's no default source and the source is required.

  • πŸ‡³πŸ‡ΏNew Zealand siramsay

    @tim.plunkett

    I tried to use the code from your merge request https://git.drupalcode.org/project/project_browser/-/merge_requests/673/... on the issue #3500024: WSOD when accessing non-enabled or non-existent source plugin.

    But I am unsure if I was able to apply that correctly. I can try again, it will be a bit of trial and error on my part, or do you have a guide on how to apply that branch to my installation? Drupal CMS using DDEV.

    However, I used the patch, the alternative approach and the site came alive. #33499406 Fix fallback logic for empty $source in browse() method to ensure config validation with improved fallback logic
    https://www.drupal.org/files/issues/2025-01-13/project_browser--2025-01-... β†’

    Admin toolbar works, and it has Tools from the admin toolbar extras in the navigation.

  • πŸ‡³πŸ‡ΏNew Zealand siramsay

    This is the patch I applied that I create locally.

    It is the same as the commit that was recently merged
    https://git.drupalcode.org/project/project_browser/-/commit/a500525a0ac6...

    I guess I need to use the project_browser 2.0.x-dev release to test again, but as said, the patch I applied did not work, so don't think this will nay different.

    The patch #4 above still works even with the above applied.

    I manually applied it

    public function browse(ProjectBrowserSourceInterface $source): array {
    
        if ($source == '') {
          $enabled_sources = $this->config('project_browser.admin_settings')->get('enabled_sources') ?? [];
          if (!empty($enabled_sources) && isset($enabled_sources[0])) {
              $source = $enabled_sources[0];
          }
        }
    
    
        return [
          '#type' => 'project_browser',
          '#source' => $source,
        ];
      }
  • πŸ‡«πŸ‡·France dydave

    Closing in favor of πŸ› Some mandatory parameters are missing ("source") to generate a URL for route Active .

    Could you please provide some feedback on the proposed patch in MR!117?

    Thank you very much for all the work in this issue.

Production build 0.71.5 2024