No Code Attached Yet
avatar Chaosxmk
Chaosxmk
12 Aug 2021

Steps to reproduce

Install Joomla 4.0.0-rc7-dev
Change configuration options

Expected result

The site load stylesheets/javascript properly.

Actual result

No stylesheets are loading, and any actions reliant on javascript do not function.

System information (as much as possible)

PHP Version: 7.4.22

class JConfig {
	public $offline = false;
	public $offline_message = 'This site is down for maintenance.<br />Please check back again soon.';
	public $display_offline_message = 1;
	public $offline_image = '';
	public $sitename = 'Test';
	public $editor = 'tinymce';
	public $captcha = '0';
	public $list_limit = 20;
	public $access = 1;
	public $debug = false;
	public $debug_lang = false;
	public $debug_lang_const = true;
	public $dbtype = 'mysqli';
	public $host = '127.0.0.1';
	public $user = '[...]';
	public $password = '[...]';
	public $db = '[...]';
	public $dbprefix = 'vireh_';
	public $dbencryption = 0;
	public $dbsslverifyservercert = false;
	public $dbsslkey = '';
	public $dbsslcert = '';
	public $dbsslca = '';
	public $dbsslcipher = '';
	public $force_ssl = 0;
	public $live_site = '';
	public $secret = '[...]';
	public $gzip = true;
	public $error_reporting = 'default';
	public $helpurl = 'https://help.joomla.org/proxy?keyref=Help{major}{minor}:{keyref}&lang={langcode}';
	public $offset = 'America/Toronto';
	public $mailonline = true;
	public $mailer = 'mail';
	public $mailfrom = '[...]';
	public $fromname = 'Test';
	public $sendmail = '/usr/sbin/sendmail';
	public $smtpauth = false;
	public $smtpuser = '';
	public $smtppass = '';
	public $smtphost = 'localhost';
	public $smtpsecure = 'none';
	public $smtpport = 25;
	public $caching = 0;
	public $cache_handler = 'file';
	public $cachetime = 15;
	public $cache_platformprefix = false;
	public $MetaDesc = '';
	public $MetaAuthor = true;
	public $MetaVersion = false;
	public $robots = '';
	public $sef = true;
	public $sef_rewrite = true;
	public $sef_suffix = false;
	public $unicodeslugs = false;
	public $feed_limit = 10;
	public $feed_email = 'none';
	public $log_path = '/home/test/domains/test.domain.ca/public_html/administrator/logs';
	public $tmp_path = '/home/test/domains/test.domain.ca/public_html/tmp';
	public $lifetime = 60;
	public $session_handler = 'database';
	public $shared_session = false;
	public $session_metadata = true;
	public $memcached_persist = true;
	public $memcached_compress = false;
	public $memcached_server_host = 'localhost';
	public $memcached_server_port = 11211;
	public $redis_persist = true;
	public $redis_server_host = 'localhost';
	public $redis_server_port = 6379;
	public $redis_server_db = 0;
	public $cors = false;
	public $cors_allow_origin = '*';
	public $cors_allow_headers = 'Content-Type,X-Joomla-Token';
	public $cors_allow_methods = '';
	public $behind_loadbalancer = false;
	public $proxy_enable = false;
	public $proxy_host = '';
	public $proxy_port = '';
	public $proxy_user = '';
	public $massmailoff = false;
	public $replyto = '';
	public $replytoname = '';
	public $MetaRights = '';
	public $sitename_pagetitles = 1;
	public $session_filesystem_path = '';
	public $session_memcached_server_host = 'localhost';
	public $session_memcached_server_port = 11211;
	public $session_redis_persist = 1;
	public $session_redis_server_host = 'localhost';
	public $session_redis_server_port = 6379;
	public $session_redis_server_db = 0;
	public $frontediting = 0;
	public $block_floc = 1;
	public $log_everything = 0;
	public $log_deprecated = 0;
	public $log_priorities = array('0' => 'all');
	public $log_categories = '';
	public $log_category_mode = 0;
	public $cookie_domain = '';
	public $cookie_path = '';
	public $asset_id = '1';
	public $redis_server_auth = '';
	public $session_redis_server_auth = '';
}

Additional comments

Unfortunately, I'm at a loss for what exactly I did to produce this bug. I was looking through the main site configuration setting various options to debug my custom components/modules in the new environment, and after a save nothing is working correctly anymore.

I've included a redacted copy of my configuration file in case it helps.

avatar Chaosxmk Chaosxmk - open - 12 Aug 2021
avatar joomla-cms-bot joomla-cms-bot - change - 12 Aug 2021
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 12 Aug 2021
avatar Chaosxmk Chaosxmk - change - 12 Aug 2021
The description was changed
avatar Chaosxmk Chaosxmk - edited - 12 Aug 2021
avatar richard67
richard67 - comment - 12 Aug 2021

@Chaosxmk Have you used the file "htaccess.txt" shipped with Joomla 4? With "used" I mean renamed to ".htaccess".

If that is the case, please edit the ".htaccess" file and go to the end of the file. There you should see following code:

## These directives are only enabled if the Apache mod_headers module is enabled.
## This section will check if a .gz file exists and if so will stream it
##     directly or fallback to gzip any asset on the fly
## If your site starts to look strange after enabling this, and you see
##     ERR_CONTENT_DECODING_FAILED in your browser console network tab,
##     then your server is already gzipping css and js files and you don't need this
##     block enabled in your .htaccess
<IfModule mod_headers.c>
	# Serve gzip compressed CSS files if they exist
	# and the client accepts gzip.
	RewriteCond "%{HTTP:Accept-encoding}" "gzip"
	RewriteCond "%{REQUEST_FILENAME}\.gz" -s
	RewriteRule "^(.*)\.css" "$1\.css\.gz" [QSA]

	# Serve gzip compressed JS files if they exist
	# and the client accepts gzip.
	RewriteCond "%{HTTP:Accept-encoding}" "gzip"
	RewriteCond "%{REQUEST_FILENAME}\.gz" -s
	RewriteRule "^(.*)\.js" "$1\.js\.gz" [QSA]

	# Serve correct content types, and prevent mod_deflate double gzip.
	RewriteRule "\.css\.gz$" "-" [T=text/css,E=no-gzip:1]
	RewriteRule "\.js\.gz$" "-" [T=text/javascript,E=no-gzip:1]

	<FilesMatch "(\.js\.gz|\.css\.gz)$">
		# Serve correct encoding type.
		Header append Content-Encoding gzip

		# Force proxies to cache gzipped &
		# non-gzipped css/js files separately.
		Header append Vary Accept-Encoding
	</FilesMatch>
</IfModule>

Comment the lines of this code which do not already with a "#" so it looks as follows:

## These directives are only enabled if the Apache mod_headers module is enabled.
## This section will check if a .gz file exists and if so will stream it
##     directly or fallback to gzip any asset on the fly
## If your site starts to look strange after enabling this, and you see
##     ERR_CONTENT_DECODING_FAILED in your browser console network tab,
##     then your server is already gzipping css and js files and you don't need this
##     block enabled in your .htaccess
# <IfModule mod_headers.c>
	# Serve gzip compressed CSS files if they exist
	# and the client accepts gzip.
	# RewriteCond "%{HTTP:Accept-encoding}" "gzip"
	# RewriteCond "%{REQUEST_FILENAME}\.gz" -s
	# RewriteRule "^(.*)\.css" "$1\.css\.gz" [QSA]

	# Serve gzip compressed JS files if they exist
	# and the client accepts gzip.
	# RewriteCond "%{HTTP:Accept-encoding}" "gzip"
	# RewriteCond "%{REQUEST_FILENAME}\.gz" -s
	# RewriteRule "^(.*)\.js" "$1\.js\.gz" [QSA]

	# Serve correct content types, and prevent mod_deflate double gzip.
	# RewriteRule "\.css\.gz$" "-" [T=text/css,E=no-gzip:1]
	# RewriteRule "\.js\.gz$" "-" [T=text/javascript,E=no-gzip:1]

	# <FilesMatch "(\.js\.gz|\.css\.gz)$">
		# Serve correct encoding type.
		# Header append Content-Encoding gzip

		# Force proxies to cache gzipped &
		# non-gzipped css/js files separately.
		# Header append Vary Accept-Encoding
	# </FilesMatch>
# </IfModule>

Does that help?

avatar Chaosxmk
Chaosxmk - comment - 12 Aug 2021

That did help. Everything is loading correctly again. Would this be considered an issue in my server that I'll need to correct before updating to Joomla 4 fully?

avatar richard67
richard67 - comment - 12 Aug 2021

No, your server is fine. See the explanation in the comment of that code. We have to think about changing our htaccess.txt so this code is not enabled by default.

avatar Chaosxmk Chaosxmk - change - 12 Aug 2021
Status New Closed
Closed_Date 0000-00-00 00:00:00 2021-08-12 13:05:59
Closed_By Chaosxmk
avatar Chaosxmk Chaosxmk - close - 12 Aug 2021

Add a Comment

Login with GitHub to post a comment