VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: AnSit on January 24, 2020, 01:50:35 AM

Title: The problem with styles when administering the frontend
Post by: AnSit on January 24, 2020, 01:50:35 AM
Speshitpillts and developers, please tell me how to fix another problem with the administration of VM through the frontend.

When I enter the edit mode of VM in the frontend, it seems that no styles work (see screen). It is only necessary for me to authorize once this user in the backend, as immediately all styles are perfectly loaded in the frontend. And as soon as the cache disappears, then all the styles disappear again.

How to fix this problem so that all styles are loaded normally without logging into the backend? This is very important, as there are vendors who do not have access to the backend at all and need to administer the VM from the frontend. But with such a terrible display of VMs, they are very uncomfortable and difficult to work with.
Title: Re: The problem with styles when administering the frontend
Post by: Studio 42 on January 24, 2020, 02:13:51 AM
What error do you see in the browser console (F12)
Title: Re: The problem with styles when administering the frontend
Post by: AnSit on January 24, 2020, 09:31:43 AM
Thank you for your help!
Title: Re: The problem with styles when administering the frontend
Post by: Studio 42 on January 24, 2020, 10:03:29 AM
I think that you use page cache ?
Change cache mode in Joomla should work.
Title: Re: The problem with styles when administering the frontend
Post by: AnSit on January 24, 2020, 10:24:39 AM
In general settings, I always disable caching completely.

Tell me where and what settings to try yet?
Title: Re: The problem with styles when administering the frontend
Post by: Studio 42 on January 24, 2020, 16:12:13 PM
Do the template use a compression/minifaction for scripts ?
Jquery is not defined erro mean that jquery is not loaded, so the file missing in your HTML header.
Title: Re: The problem with styles when administering the frontend
Post by: AnSit on January 24, 2020, 16:25:26 PM
No, I don't use anything for compression and optimization.
This is the standard Protostar template.

Yes, I see that the necessary scripts are not loaded. And the reason most likely is that their download is blocking something in the VM. After all, as soon as I log in with this user on the same browser in the backend, then immediately all scripts and styles are loaded and in the frontend. But as soon as I get out of the backend and clear the cache, all scripts and styles disappear immediately and can't load in any way.
Title: Re: The problem with styles when administering the frontend
Post by: AnSit on January 24, 2020, 21:16:21 PM
If you look carefully at the errors in the browser console, then all the necessary stylesheets and scripts files are in a closed administrative folder from the frontend. Of course they can't boot. And now, just after entering the backend, access appears, they load and start working as expected. But they are stored in the browser cache. And as soon as it cleans up in time - again these style and script files disappear and everything is again incorrectly displayed in the frontend.

How to correct this serious error?
Title: Re: The problem with styles when administering the frontend
Post by: GJC Web Design on January 24, 2020, 22:30:49 PM
why do u say closed? Have u put an .htaccess or something in front of the admin area?

Normally scripts and css e.g. https://www.yoursite.com/administrator/components/com_virtuemart/assets/js/orders.js are accessible
Title: Re: The problem with styles when administering the frontend
Post by: Studio 42 on January 24, 2020, 23:03:58 PM
Perhaps the problem can be if you filled livesite in the Joomla config ?
Title: Re: The problem with styles when administering the frontend
Post by: AnSit on January 24, 2020, 23:07:08 PM
Oh yes! I'm sorry.
Tried to open all stylesheets and scripts. Indeed, they are all accessible from the frontend.

I cannot understand in what then the problem that these style files are not applied ?!
Title: Re: The problem with styles when administering the frontend
Post by: AnSit on January 24, 2020, 23:09:58 PM
In Joomla's configuration everything is standard and properly configured.
By the way this problem manifests itself on my two different sites.
Tried three browsers, three user accounts and two different computers! It's the same problem.
Title: Re: The problem with styles when administering the frontend
Post by: GJC Web Design on January 25, 2020, 11:15:00 AM
just tested on a standard setup.. only the FE opened .. all JS and css load fine when using FE admin .. FE and admin scripts.
So your next step is look at the your server end. caching etc
Title: Re: The problem with styles when administering the frontend
Post by: AnSit on January 25, 2020, 14:18:59 PM
I'm not that strong in web technology yet.

"So your next step is look at the your server end. caching etc"
Tell me, please, what exactly did you mean I need to do?

Or, if I may, I could give you access to the site so that you can check everything yourself. Can this be done?
Title: Re: The problem with styles when administering the frontend
Post by: GJC Web Design on January 25, 2020, 20:30:23 PM
All I meant is that as I tested it is fine, no one else complains about this problem .. so that leaves one other source of problem unique to you -- your host..

So you need to ask them if they have any ideas as to why yours exhibits this problem ..  is the hard caching at the server, cloud flare etc etc
try switching any thing you can find off and see what happens
Title: Re: The problem with styles when administering the frontend
Post by: AnSit on January 25, 2020, 23:55:25 PM
GJC Web Design, I am very grateful for your help and advice! And to all who participated in the topic!
I turned in support of hosting. And indeed they found the cause of this problem! It was that by default, they use this technology to protect the backend from attacks: nginx brute force protection.
Oddly enough, it blocked the normal loading of scripts and styles.
Unfortunately, the support does not know how to solve this problem and had to disable this protection altogether.

Can anyone know or learn how to combine this security technology and the smooth functioning of the VM in the frontend - please be sure to let us know. I will be very grateful to you!
Title: Re: The problem with styles when administering the frontend
Post by: diri on January 26, 2020, 10:31:12 AM
Possibilities depend very much on what you are able to modify at Nginx' settings.

Starts with security headers, rate limit, ...

Be ensured:
It will take some hours to get some relative fine grained and working setup.  ;)
Title: Re: The problem with styles when administering the frontend
Post by: AnSit on January 26, 2020, 11:25:03 AM
So do you think it can still be customized? The hosting support team said that you can't leave the protection and solve the problem with the normal loading of styles and scripts.

I would try to configure something myself, but these settings are most likely available only to the hosting support team.

If someone gave specific instructions on what to turn on or off, then I would pass this information to support.
Title: Re: The problem with styles when administering the frontend
Post by: GJC Web Design on January 26, 2020, 14:42:10 PM
For a start u need to know what is the rule in their "protection" that is blocking the delivery
Title: Re: The problem with styles when administering the frontend
Post by: AnSit on January 26, 2020, 18:02:14 PM
If they told me what settings they made there. They said that you cannot configure protection so that the page works normally. That's all. :(

What else can I advise them? Himself without understanding this issue.
Title: Re: The problem with styles when administering the frontend
Post by: GJC Web Design on January 26, 2020, 20:03:54 PM
simplest is change hosts .. this has never been reported before afaik
Title: Re: The problem with styles when administering the frontend
Post by: diri on January 27, 2020, 09:01:55 AM
I can only recommend a change of hoster as well. They don't look capable to handle Nginx.

But, be carefull with change. Other hosters might have other drawbacks.

In Germany I have a customer with not really cheap hosting at Ionos (1und1). They run Apache, customer can modify some settings with .htaccess but:
To get a security grade of A+ I had to modify  some things with PHP. Without this site had grade C.

Problem there:
Session limit is 16, PHP is running in cgi mode. Too many extra open handles (many parallel running tasks) - session limit reached. Eg backend of Piwik with default settings for one site in dashboard is disturbed for this. I must look for a reliable alternative for them as well.

edit:
Ionos (1und1) belongs to United Internet. Other lables are gmx, web.de, strato, ...
Title: Re: The problem with styles when administering the frontend
Post by: AnSit on January 27, 2020, 10:50:54 AM
Got it! Thank you all for these tips and details!