The module's stylesheet glyphicons.css and the plugins' stylesheet bootstrap.css does not load when logged out.
When logged in as administrator, the icons show perfectly fine. When logged out, the stylesheets are not loaded.
Tested on two websites.
System information:
Drupal 8.4.2
module: glyphicons-8.x-1.2
plugin: glyphicons_2.2

Comments

pramielaB created an issue. See original summary.

marjina-constantin’s picture

This issue happens because the library with css is not attached to page. It works for admin because he has the permissions to edit content and use the text format that has CKEditor and glyphicons button, in other words, the css is loaded when CKEditor is present on page. The code that is responsible for loading css for admin is "getCssFiles" method from "Glyphicons.php" file, and not hook_library_info_alter from the module file. This hook can be entirely removed because $libraries['glyphicons'] is never set as it's not attached to page. Instead, we can use hook_page_attachments to attach that css. Because we don't really know where we can have content rendered from a wysiwyg field, I would say that the css can be attached to all pages, even admin ones (for example view preview).
Patch attached.

marjina-constantin’s picture

Status: Active » Needs review
anprok’s picture

Tested on Drupal 8.6.7 clean install
with glyphicons 8.x-1.x-dev and library glyphicons 2.2

Icon displayed fine for anonymous user and administrator without any errors or warnings.

Without patch applied I have problem with missing icon for anonymous user.

anprok’s picture

Status: Needs review » Reviewed & tested by the community
ddrozdik’s picture

Thanks. Merged.

ddrozdik’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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