solidus icon indicating copy to clipboard operation
solidus copied to clipboard

Solidus favicon overrides custom favicon using Sprockets 4

Open pelargir opened this issue 5 years ago • 2 comments

After upgrading to Sprockets 4, the Solidus favicon has effectively replaced our custom favicon.

Solidus Version: 2.9

To Reproduce

  1. Copy a custom favicon to app/assets/images/favicon.ico
  2. Include this icon in a view with <%= favicon_link_tag 'favicon.ico' %>
  3. Pre-compile assets with rake assets:precompile
  4. Note that 2 favicon files are placed in public/assets, one from Solidus and the other being our custom icon. Each has a different fingerprint appended to the file name.
  5. Open the view in a browser. The Solidus favicon is used.

Current behavior The Solidus favicon is displayed instead of our custom favicon.

Expected behavior Any custom favicon at app/assets/images/favicon.ico should be displayed, overriding the Solidus favicon that lives in the solidus_frontend and solidus_backend gems.

Desktop (please complete the following information):

  • OS: macOS Catalina 10.15.3
  • Browser: Chrome 79.0.3945.130

Additional context This seems to be a problem with Solidus interacting with Sprockets 4. Anecdotal reports from Slack suggest this problem does not occur with Sprockets 3, and indeed this problem didn't surface for us until we upgraded to Sprockets 4 and app/assets/config/manifest.js

We can get around the problem by moving our favicon into a subfolder (app/assets/images/icons/favicon.ico) and updating the reference in our view (<%= favicon_link_tag 'icons/favicon.ico' %>) but this is sub-optimal. Images from Solidus should not be overriding our own images when placed at the same path.

pelargir avatar Feb 14 '20 14:02 pelargir

@MFRWDesign Looks like it's a known issue from recent versions of solidus.

jontarg avatar Nov 26 '20 15:11 jontarg

I've followed the reproduction steps on HEAD but my custom favicon is displayed in both frontend and backend.

Could you please try with HEAD ?

willianveiga avatar May 31 '21 00:05 willianveiga