Trying to install the module I get an error about some directories that don't exists (eg. modules/contrib/admin_toolbar/templates).

I created a patch to check if directories exists before passing through fileScanDirectory method.

Comments

Ralkeon created an issue. See original summary.

ralkeon’s picture

Here's the patch

sozkara’s picture

Or just simply:

-    foreach ($active_directories as $provider => $path) {
+    foreach ($active_directories as $provider => $path) { if (file_exists($path . "/templates")) {
       $active_directories[$provider] = $path . "/templates";
+      }
crasx’s picture

StatusFileSize
new841 bytes

Here is a simpler version of the patch

brianperry’s picture

StatusFileSize
new822 bytes

Made a minor adjustment to the patch - prepareDirectory checks that a directory exists and is writable. In this case we only care that it exists, so we should be able to use is_dir instead.

  • brianperry committed e53903b on 8.x-1.x
    Issue #3160747 by Ralkeon, crasx, brianperry: fileScanDirectory fails on...
brianperry’s picture

Status: Needs review » Fixed

Thanks for the help with this! I merged this into 8.x-1.x and plan on tagging a new release soon.

brianperry’s picture

It looks like this was actually caused by an upstream issue with UI Patterns: https://github.com/nuvoleweb/ui_patterns/issues/293

I don't think the check that was added here will cause problems, but it shouldn't be necessary once the UI Patterns issue is merged.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.