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

Comments

siramsay created an issue. See original summary.

phenaproxima’s picture

Project: Drupal CMS development repository » Project Browser
Version: » 2.0.0-alpha7
Component: General » Code
Issue tags: -Project Browser +Drupal CMS dependency critical

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.

siramsay’s picture

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.

thomas kaisuka’s picture

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

tim.plunkett’s picture

There's a chance this could be mitigated by #3500024: WSOD when accessing non-enabled or non-existent source plugin.
Both are tied to the changes made in #3494672: Expose each source as a regular local task, replacing the tabs managed by the Svelte app.

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

tim.plunkett’s picture

Title: 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/ » Top-level menu link to /admin/modules/browse no longer works in Project Browser 2.x
Project: Project Browser » Admin Toolbar
Version: 2.0.0-alpha7 » 3.x-dev

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.

siramsay’s picture

@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.
#3499406: Fix fallback logic for empty $source in browse() method to ensure config validation with improved fallback logic
Patch #4 - 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.

siramsay’s picture

StatusFileSize
new10 KB

This is the patch I applied that I created 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 be any 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,
    ];
  }
dydave’s picture

Status: Active » Closed (duplicate)
Related issues: +#3506824: Compatibility with Project Browser

Closing in favor of #3506824: Compatibility with Project Browser.

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

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