joomla / joomla-cms

Home of the Joomla! Content Management System
https://www.joomla.org
GNU General Public License v2.0
4.77k stars 3.65k forks source link

[4.3.4] Relative sprite url in chosen.css may cause 404-error #41771

Open JoomlaN00b opened 1 year ago

JoomlaN00b commented 1 year ago

Steps to reproduce the issue

Unsure what users local settings are but some users get 404 when trying to load chosen-sprite.png and chosen-sprite@2x.png when in SEO-adjusted url that is not root. So for example in domain.com/page/ instead of domain.com/

Expected result

No 404-error and sprite loaded correctly.

Actual result

The image files are not loaded and 404-error.

Additional comments

Changing all url() in media/vendor/chosen/css/chosen.css from relative url, like url("chosen-sprite@2x.png"), to absolute url, like url("/media/vendor/chosen/css/chosen-sprite@2x.png"), solves the issue.

dgrammatiko commented 1 year ago

Are you using any template or plugin that concatenates CSS files? If so then the problem is with those (also as a side comment concatenating CSS/JS files is not anymore considered a best practice, in reality it's an anti pattern). Also since this is not a problem with the core templates I would suggest closing this @richard67

JoomlaN00b commented 1 year ago

No aggregation of css files or nothing like that and I would say that 99% of my visitors do not see issue (neither do I when trying to reproduce) but I have a push notification for all 404-error for logged in users and there are some users who see this issue repeatedly. The same users had 404 error for other images in custom component that was solved the same way.

Since this issue is a vendor file and would probably also occur in core template files I wanted to report what change solved the issue.

dgrammatiko commented 1 year ago

No aggregation of css files or nothing like that

Are you behind Cloudflare or similar, because the concatenation might happen in the server layer or caching layer, etc?

JoomlaN00b commented 1 year ago

Nope. Own dedicated server. The few users that have issues might have some local browser plugins or such but haven't got any replies that have helped me localise issue.