You need to be logged in to post in the forum - Log In

An active JCE Pro Subscription is required to post in the forum - Buy a Subscription

Support is currently Online

Official support hours
Monday to Friday
09:00 - 17:00 Europe/London (BST)

#103349 Impossible to get retina theme on frontend

Posted in ‘Editor’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Latest post by activha on Sunday, 22 March 2020 13:02 GMT

activha
Hello
Just starting with JCE Pro and all is fine except one thing : it's impossible to see retina theme or another theme than classic theme on frontend.
I tried several configurations but no luck, always the default ui is showing.
On the backend everything is ok though... so I'm a bit lost and don't know where to dig ?
Thanks for helping
Jean

Ryan
Do you have more than 1 profile active, ie: do you have a specfic front-end editor profile enabled?

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

activha
Yes we have three profiles all with same theme retina touch. Working great on backend but display default ui on frontend
I tried with protostar template and deactivated all css exterior to JCE so I don't know where to dig

Ryan
Please send me a login - https://www.joomlacontenteditor.net/contact/site-login

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

activha
Hi Ryan
Not sure if you got my emails, you need to copy paste the admin url, I have security errors for admin login, but the user/pass have been rechecked and work fine.

Ryan
The front-end login does not appear to be complete. I am seeing a CB profile form that requires me to fill in a lot of information.

Please provide a simple login and link I can use to test the editor in the front-end.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

activha
I pasted everything in the contact mail for backend and frontend, with two different usernames !

activha
got this error if it helps :

Attachments

activha
Hi Ryan
Hope you manage to enter the website, let me know if not...
BTW I have also noticed that access to image file system from the backend did not work with images set as main folder. I would have to allow access to file system and in this case all folder are displayed :-(
However the settings seem to work for the backend toolbar. When accessing the folders via the toolbar every path is ok, so this is only relative to the main files access from the config page or the JCE component panel.
Hope you got it ;-)
Best regards
Jean

Ryan
Hope you manage to enter the website, let me know if not...


I am unable to replicate the issue with the Retina toolbar theme, using your Front-end profile on a test site. As the issue also does not occur in the Joomla admin, this suggests that something in the front-end is causing the problem.

Are you able to reproduce this on any other site?

BTW I have also noticed that access to image file system from the backend did not work with images set as main folder. I would have to allow access to file system and in this case all folder are displayed :-(
However the settings seem to work for the backend toolbar. When accessing the folders via the toolbar every path is ok, so this is only relative to the main files access from the config page or the JCE component panel.


The File Browser in the JCE Control Panel and in any media field (Images & Links etc.) using the parameters from the File Browser plugin in Editor Profiles -> Plugin Parameters -> File Browser, which you have set to files/docs/users/$id so the File Browser is not accesing the images folder.

Also, in Editor Profiles -> Editor Parameters -> Filesystem you have set a Directory Filter of images/users/$id which essentially means that a user would be prevented from accessing their own folder.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

activha
Thanks for your explanations concerning the file system. I still do not really understand everything though.
We have a backend profile and removing images/users/$id and files/docs/users/$id does give access to the image folder. However our files are located in the files/video , files/audio and files/docs folders not in image/... folders.

So my question is : how can I set this backend profile so that the backend users would have access to the roots of images/ and files/ but with no accesses to users folders in a goal to increase their confidentiality. Ideally a backend users would have access to :
images/... but not to images/users/$id except for his own id for instance images/users/001
files and files/docs/... but not to files/docs/$id except for his own id for instance files/docs/001
files and files/videos/... but not to files/videos/$id except for his own id for instance files/videos/001

Same thing for audios and docs ?

Regarding the front end problem I tried to set up a page with protostar template and removing lots of things but still get the same issue.
Correction : the problem seems linked to Community Builder or one of its plugins. Using Protostar template with only add web link form works fine :-)

I continue to dig why

activha
Guess it comes from $_CB_framework->displayCmsEditor but at this point I'm stuck 🙁

Ryan
So my question is : how can I set this backend profile so that the backend users would have access to the roots of images/ and files/ but with no accesses to users folders in a goal to increase their confidentiality. Ideally a backend users would have access to :
images/... but not to images/users/$id except for his own id for instance images/users/001
files and files/docs/... but not to files/docs/$id except for his own id for instance files/docs/001
files and files/videos/... but not to files/videos/$id except for his own id for instance files/videos/001


This is not currently possible. You can provide access to the images/users/$id folder for a specific user, but not to the images/ folder and just the images/users/$id folder.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

activha
OK thanks we'll do with it ;-) On the CB issue, can you give me the joomla php code to insert the editor so that I could try to check if it's this CB function that's not functioning correctly ? they use

		$event					=	$_CB_framework->displayCmsEditor( 'event', $this->input( 'post/event', $row->get( 'event', null, GetterInterface::HTML ), GetterInterface::HTML ), '100%', null, 40, 10 );

Ryan
I think you would have to direct this at Community Builder support and see if they know if or where any alterations to JCE settings are being made in the front-end by CB.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

activha
Hi Ryan

Got this answer from Kyle (CB team)

$_CB_framework->displayCmsEditor calls JFactory::getEditor() which calls Editor::getInstance(). We call the display function of the editor on display, which calls the "onDisplay" function of an editor plugin. That's all we're doing. It's a pass through function. We are not touching the editors parameters in any way beyond sending input name, input value, width/col, and height/row.

TinyMCE loads editor specific settings, including styling, in onDisplay. JCE appears to load this in onInit, which shouldn't really be a problem. The problem seams to be how JCE detects what editor to use where. CB doesn't use Joomla content events since they're not relevant to CB so if JCE is depending on Joomla content events that could be part of the problem. JCE function getComponent doesn't seam to have any issues finding CB on CB views though.

Investigating further to getProfile in JCE responsible for compiling the list of available editors. The problem comes from "User Group" and "Users" parameters. If both are empty the editor will never load. So if you select an extension in "Components" and don't specify "User Group" or "Users" it won't work. The validation in backend is missing for this which means you don't get an error for making this mistake. It's not even clear those parameters are required, but at least one of them is in getProfile.

With the above information I set "Components" to "comprofiler" and "User Group" to "Public" and the editor loaded perfectly fine throughout CB. The only issue I see now is "Editor Layout" works partially, but for some reason there's a "display: none;" style on several of the toolbar rows preventing them from displaying yet they are there and function. Only the Default editor works right in my tests across multiple extensions (this issue was present even in Joomla articles).


What do you think ?

PS I replied that the uaergroups were correctly set on our website and to dig further

Ryan
I think Kyle has misunderstood, because the editor is loading in the front-end in CB, whereas he seems to assume that it is not.

As for why it is loading the wrong toolbar theme, I have not yet been able to determine this, but as you discovered, this only happens in CB.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

activha
OK here is the reply

My tests were done on a clean install with latest release of JCE. I've no issues getting the editor to load specifically in CB by setting "Component" and "User Group" parameters correctly. It's also possible there's a load order conflict in JCE it self. Try ensuring the component specific editors are ordered before your default editor. My only issues were with toolbars having "display: none;" on them, which was not a CB specific issue as tested a custom editor specific to Joomla articles and it did the same thing.

The other extensions you noted are likely using Joomla content events since those events are relevant. Joomla content events are not relevant to user profiles so we do not fire them and it JCE is depending on them for its loading behavior that will be a problem. JCE should be doing all this behavior in onInit or onDisplay, but it's not from what I can see so I've no clue where it's doing it exactly. In my tests getComponent worked correctly and output CB and getProfile worked correctly outputting the CB specific editor with its correct parameters so I don't know what else to suggest.


Honestly could you speak together on this ?

Ryan
Please try JCE Pro 2.8.10 Beta 3 - https://www.joomlacontenteditor.net/downloads/editor/pro/development

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

activha
Wonderful :-)

Shall I write something specific on CB forums ? or did you fix it from within JCE?

activha
Got this error somehow Any advice ? already got it ?

La ressource à l’adresse « https://xxxxx.com/index.php?option=com_jce&task=editor.pa…93ef59daf291257b23c1ac3b0=1&aff731e79f417e1b3628f037c2dd606c » a été bloquée en raison d’un type MIME (« text/html ») incorrect (X-Content-Type-Options: nosniff).

Ryan
Shall I write something specific on CB forums ? or did you fix it from within JCE?


This was a JCE issue, the result of a conflict with a CB query parameter.

Got this error somehow

Any advice ? already got it ?


I'm not seeing this error on your site in Firefox or Chrome (tested in the front-end with the login and edit link you sent)

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

activha
Yes that's normal, in order to avoid the error, I had to deactivate the three settings : Compress Javascript, Compress CSS and Use Gzip and deactivate JCH optimize for the pages where JCE loads.

So this is a MIME type not sent correctly when JCE uses these settings

Can you correct it ?

Ryan
There may have been an error produced by one of the requests, which is why the url was not generating the correct mimetype.

Try activating Compress Javascript and Compress CSS only, without Use GZip.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

activha
Just tried and same result, as soon as one of the setting is used, we get the error on Firefox.

I leave it on one hour if you want to check but will have to remove them as it's the production website

Ryan
I leave it on one hour if you want to check but will have to remove them as it's the production website


I've just checked this on a clean browser (one that has not been used on your site before) and I am not seeing any errors.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

activha
yes that's normal, but if you use for instance Firefox and you reload the page a few times or navigate to another one and then back, you'll get the error.

Can you check that the mime declaration of the combined sent files by JCE are correct for css and js ? it seems like they are sent as plain html



I mean that of course if cache or browser cache is disabled, that can work, but if browser cache is enabled, you'll get the error at first reload

To be a little more precise:
At first loading the css and js combined files are sent with the correct mime types and display correctly. For every reload without cache, this is fine

When browser cache is activated, then the two files are sent with the html mime types, then provoking the error and the block in the browser avoiding the JCE editor to display.

So can you dig there ?

Attachments

activha
Here are the comparisons :

Loading Request URL:https://activ-ha.com/index.php?option=com_jce&task=editor.pack&context=10020&c1dde4f03212e3732145b5b425ada0a6=1&20669c868901d22355a4cf5bc09263e6

server: nginx
date: Thu, 05 Mar 2020 12:52:24 GMT
content-type: application/javascript; charset: UTF-8
x-powered-by: PHP/7.2.28
vary: Accept-Encoding
cache-control: max-age=0,no-cache
access-control-allow-origin: *
timing-allow-origin: *
referrer-policy: strict-origin-when-cross-origin
strict-transport-security: max-age=31536000
etag: 1ebba321af7967925e140bf381633b7e
content-encoding: gzip
cache-control: max-age=604800, no-transform, public
expires: Thu, 12 Mar 2020 12:52:23 GMT
x-content-type-options: nosniff
x-cache: MISS from activ-ha.com
access-control-allow-origin: *
timing-allow-origin: *
x-content-type-options: nosniff
cache-control: no-transform
X-Firefox-Spdy: h2

Cache Request URL:https://activ-ha.com/index.php?option=com_jce&task=editor.pack&context=10020&c1dde4f03212e3732145b5b425ada0a6=1&20669c868901d22355a4cf5bc09263e6HTTP/2 200 OK

HTTP/2 200 OK
server: nginx
date: Thu, 05 Mar 2020 12:53:19 GMT
content-type: text/html; charset=utf-8
content-length: 181829
etag: 1ebba321af7967925e140bf381633b7e
content-encoding: gzip
cache-control: max-age=300, no-transform, public
expires: Thu, 05 Mar 2020 12:58:18 GMT
x-content-type-options: nosniff
x-powered-by: PHP/7.2.28
vary: Accept-Encoding
cache-control: max-age=0,no-cache
access-control-allow-origin: *
timing-allow-origin: *
referrer-policy: strict-origin-when-cross-origin
strict-transport-security: max-age=31536000
x-cache: REVALIDATE from activ-ha.com
access-control-allow-origin: *
timing-allow-origin: *
x-content-type-options: nosniff
cache-control: no-transform
X-Firefox-Spdy: h2

Ryan
Does this still happen when the Compress with Gzip option is off?

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

activha
yes if you mean the JCE setting

Edit : do you mean compress with gzip on global config also ? because yes we have it by default.

Just checked by deactivating all gzip and same result. At each reload the css and js combined files are sent like html mime types

Ryan
I am not able to reproduce this on the demo site - https://demo.joomlacontenteditor.net

Unless there is a specific error message produce in the Response body of the css or javascript, which might produce the invalid mimetype, then I don't know what else could cause the issue, except for something on your server.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

activha
We use jot cache, did you test with it ?

Ryan
No.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

activha
OK tried with and without cache or jot cache or jch and got the same result.

Can you point where you store JCE cache files and the php files used to issue the combined files ? because it's something from JCE which causes this behavior, our server is rather protective but we have this scenario nowhere else

Ryan
Can you point where you store JCE cache files and the php files used to issue the combined files ? because it's something from JCE which causes this behavior, our server is rather protective but we have this scenario nowhere else


The files are not cached, they are combined, minified and output on the fly. Please see - https://github.com/widgetfactory/jce/blob/master/components/com_jce/editor/libraries/classes/packer.php#L108

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

activha
Thanks, I think there is a problem with etag settings if I uncomment the lines

        // check for sent etag against hash
//         if (!headers_sent() && isset($_SERVER['HTTP_IF_NONE_MATCH'])) {
//             $etag = stripslashes($_SERVER['HTTP_IF_NONE_MATCH']);
// 
//             if ($etag && $etag === $hash) {
//                 header('HTTP/1.x 304 Not Modified', true);
//                 exit(ob_get_clean());
//             }
//         }
then the packer makes its job and sends the correct css and js files each time. Hope it helps

Ryan
then the packer makes its job and sends the correct css and js files each time.


The problem with removing that is that the browser will then never cache the content, so it will always be served from the server, which is not very efficient.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

activha
Well that's not exactly right as all correctly set servers do have now etag management and a lot of extensions such as Admin Tools or JMap or Jot Cache already take care of it.
On our server we manage it through ht access file.

What I would strongly suggest is to make it a setting in JCE global config so that users could activate or deactivate JCE own etags management according to their server config ? this would avoid future problems and a tweak of php files after long searches for devs.

Hope it's ok with you ?
Best regards
Jean

Ryan
What I would strongly suggest is to make it a setting in JCE global config so that users could activate or deactivate JCE own etags management according to their server config ? this would avoid future problems and a tweak of php files after long searches for devs.


This is via the Compress CSS and Compress Javascript options. If you find they are not working on your server, then you need to disable them.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

activha
That' s not an option because we need to compress and javascript the elements which are way too numerous, but without using the Etag. You should add this setting because a lot of people will have the same problems.
I personally already know of two devs here who are happy to know it.

Ryan
Please try JCE Pro 2.8.10 Beta 5 - https://www.joomlacontenteditor.net/downloads/editor/pro/development/jce-pro-2-8-10-dev

I have added a Cache Validation option in the Editor Global Configuration to enable/disable generation and use of the E-tag header

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

activha
Thanks that seems to work fine now