public-accountability / littlesis-news-theme

Custom theme for news.littlesis.org, based on understrap
https://news.littlesis.org
GNU General Public License v3.0
0 stars 0 forks source link

loading script/403 error on some browsers for category-filters.js - missing "load more" button #13

Closed aepyornis closed 5 years ago

aepyornis commented 5 years ago

Problem

Loading news.littlesis.org fails to show the "load more" button on some browsers.

Reported to occur on

This error is printed onto the console:

Loading failed for the <script> with source “https://news.littlesis.org/wp-content/themes/littlesis/js/category-filters.js”. news.littlesis.org:729:1 

These browsers don't seem to have the same issue:

Details

By navigating to https://news.littlesis.org/wp-content/themes/littlesis/js/category-filters.js you can reproduce the problem in affected browsers. On some browsers it shows up correctly, but on others it displays a 403 message.

On Firefox 64, this message is sent to the console:

The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol.
misfist commented 5 years ago

This is a strange and inconsistent problem...

On one laptop, I can't reproduce

On another laptop, I can reproduce

I'd like to have a look at the file permissions for that file, but I don't have access.

https://github.com/public-accountability/littlesis-news-theme/blob/master/js/category-filters.js

aepyornis commented 5 years ago

Yeah! it's a weird one. I'm guessing it has to do with a character encoding header -- since that's something where the browser interacts with the laptop setting? I find it odd that the same browser version has a different result on different laptops.

misfist commented 5 years ago

The character encoding header is present on the page and other js files are being loaded without a problem. There seems to be something particular about this file.

 I find it odd that the same browser version has a different result on different laptops.

Yes, very odd. The one that failed to load had 2 primary differences (that I can think of):

  1. Newer version of Ubuntu (18.04 vs 16.04)
  2. Accessing the internet over wif-fi rather than wired connection
aepyornis commented 5 years ago

I think I've fixed it now. It was simply that there were wrong permissions wp-content.

I think the only reason (at least on my computer) why some browsers worked had to do with caching (either locally or on the CDN)

I chown'd the whole directory with user wordpress and importantly with group www-data

misfist commented 5 years ago

I chown'd the whole directory with user wordpress and importantly with group www-data

OK. What permissions did you give the directory? Just want to verify that they are correct for uploading images, which are stored in wp-content/uploads

aepyornis commented 5 years ago

i think they are 755 -- i'll double check

misfist commented 5 years ago

Once this is verified, let's close this.