This is what I see when I open admin/reports/libraries:

The website encountered an unexpected error. Please try again later.

InvalidArgumentException: Library fontawesome does not exist in Drupal\system_stream_wrapper\StreamWrapper\LibraryStream->getOwnerName() (line 32 of modules/contrib/system_stream_wrapper/src/StreamWrapper/LibraryStream.php).
Drupal\system_stream_wrapper\StreamWrapper\LibraryStream->getDirectoryPath() (Line: 67)
Drupal\system_stream_wrapper\StreamWrapper\LocalStream->getLocalPath() (Line: 414)
Drupal\system_stream_wrapper\StreamWrapper\LocalStream->url_stat('library://fontawesome', 2)
file_exists('library://fontawesome') (Line: 17)
fontawesome_requirements('runtime')
call_user_func_array('fontawesome_requirements', Array) (Line: 402)
Drupal\Core\Extension\ModuleHandler->invokeAll('requirements', Array) (Line: 112)
Drupal\system\SystemManager->listRequirements() (Line: 49)
Drupal\system\Controller\SystemInfoController->status()
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 574)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
call_user_func_array(Object, Array) (Line: 144)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 64)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 652)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

juampynr created an issue. See original summary.

juampynr’s picture

Status: Active » Needs review
FileSize
1.77 KB

Fontawesome is set by default to use the CDN. This moves the file_exists() check down so it is called only when you don't want to use the CDN. It also catches the exception so when the CDN setting is deactivated, it shows a requirement warning instead of a PHP error.

Dave Reid’s picture

Status: Needs review » Needs work

Now that #2825005: Fix warning when loading a library is merged, we should not need the try/catch statement around the file_exists() call.

Dave Reid’s picture

I'm though totally unclear on the status of the module dependencies as of http://cgit.drupalcode.org/fontawesome/commit/?h=8.x-1.x&id=3a5600e79099.... Because by using the library:// stream wrapper, we do need to depend on system_stream_wrapper (not currently in the dependencies), which would also require the libraries module to be a dependency.

juampynr’s picture

Issue summary: View changes
Status: Needs work » Needs review
FileSize
1.68 KB
1.01 KB
25.4 KB
60.23 KB

While this bug does not happen any more with the latest HEAD of system_stream_wrapper now that #2825005: Fix warning when loading a library has been fixed, I am still posting here an updated version of the patch where I simply make the wording clearer.

Currently, when the CDN version of Fontawesome is not being used, here is how the message at the Status Report looks like:

Fontawesome warning 8.x-1.x

And here is how it looks using this patch:

Fontawesome warning with this patch

devil2005’s picture

Still buggy for me, message in double now with patch #2 then #5 applied on the last version of the module

Error level is good (Fontawesome - Fontawesome library is installed.) but i have still this error :

Warning: file_exists(): Unable to find the wrapper "library" - did you forget to enable it when you configured PHP? in fontawesome_requirements() (line 30 of modules\fontawesome\fontawesome.install).

fontawesome_requirements('runtime')
call_user_func_array('fontawesome_requirements', Array) (Line: 402)
Drupal\Core\Extension\ModuleHandler->invokeAll('requirements', Array) (Line: 112)
Drupal\system\SystemManager->listRequirements() (Line: 49)
Drupal\system\Controller\SystemInfoController->status()
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 574)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
call_user_func_array(Object, Array) (Line: 144)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 64)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 656)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

devil2005’s picture

Daniel.Moberly’s picture

Status: Needs review » Closed (duplicate)