exponentcms / exponent-cms

Content Management, Simple.
exponentcms.org
GNU General Public License v2.0
60 stars 24 forks source link

File Manager - Thumbnails & Uploading #1454

Closed exponentcms closed 4 years ago

exponentcms commented 4 years ago

Site http://sandtoft.slx-online.biz - just got back into this development site after a long break to try out some customer requests for the main site. First I updated to 2.4.1 then went to try some images that I already FTPed. I see the same problem as that in the second part of ticket #1163. When the file manager opens, the thumbnails are all displayed as a default image, as you can see in the screenshot. I then tried to upload one of the files again, using file manager, and got the error 'File type not allowed', also shown in the screenshot (capture.JPG).

I have checked folder permissions, 775 for the image folder as well as the folders in tmp/elfinder and img_cache. Also looked at the other things I tried last time that eventually worked, but no luck this time.

I also went and checked http://www.britishtrolley.org.uk. Here there are blank spaces where the thumbnails should be - capture1.JPG. I also get the 'File type not allowed' error when I try to upload.

In addition, I set up a slide show, but the thumbnails don't show up when you add the files, and the running slide show scrolls through blank images with just the little icon top left.(capture2.JPG / capture3.JPG)

Help please! Thanks.

exponentcms commented 4 years ago

Version 2.4.1...what patch? we are at v2.4.1 patch #5...I can't reproduce this locally, but it looks like a bug in a release prior to v2.4.1 where we were too restrictive in allowed mimetypes in the elFinder uploads. Though the specific issue isn't addressed in any of the 2.4.1 patches, we have updated the elFinder module several times in the patches since the original v2.4.1 release.

exponentcms commented 4 years ago

2.4.1 January 26th 2017, no patch number shown. Now updated to patch 5.

Image icons still don't display correctly. Drag / drop upload now works, but upload / select folder says no files even though there are. See attached.

PHP 5.6.24

exponentcms commented 4 years ago

I also have an ongoing problem with ckeditor. When I edit the source and save my changes are there. Next time I go into the editor they are stripped out. On the page http://sandtoft.slx-online.biz/events I have created a calendar with lots of custom formatting. Right now it's as it should be, next time I edit it will remove all of my tagging.

Looking around the web, this seems to be a headache for lots of people, in areas other than Exponent. One suggestion I saw was to add to external/editors/ckeditor/config.js the line - config.allowedContent = true; but this has not made any difference.

Please, is there a way to stop ckeditor trying to be cleverer than me? Thank you.

exponentcms commented 4 years ago

What specific formatting is being removed? In essence a 'feature' of CKEditor is to remove content (e.g. forms, etc...) which the toolbar doesn't have the plugins loaded for.

exponentcms commented 4 years ago

Attached is the code, together with the css which is in base-styles.

exponentcms commented 4 years ago

Please could you let me know when you might be able to fix this problem? I am now having real time issues being unable to add my custom css reliably. I do have other pages where I need to customise. Thank you.

exponentcms commented 4 years ago

Regarding the issue with CKEditor removing classes/styles...

The recommended method to customize the CKEditor is to use a theme based config.js instead of editing a system file (which will be written over during patch/version updates). You may place the file in /themes/yourtheme/editors/ckeditor/config.js with contents similar to:

CKEDITOR.editorConfig = function( config ) {
    // Define changes to default configuration here. For example:
    config.allowedContent = true;
    config.protectedSource.push( /<i class[\s\S]*?\>/g );
    config.protectedSource.push( /<\/i>/g );

    CKEDITOR.dtd.$removeEmpty['span'] = false;
    CKEDITOR.dtd.$removeEmpty['i'] = false;
};

You will need to clear the browser cache to ensure the javascript is reloaded. If you've done that, the class names should not be stripped out.

If you are attempting to place within the editor, we do NOT support that as it could lead to security vulnerabilities. THe recommended method for adding styles to your site/theme, is to add a .css or .less stylesheet to the theme's /css or /less folders (or tack it onto the end of one of the theme's existing ones).

exponentcms commented 4 years ago

If you are still having issues with the thumbnails, you may need to check the /tmp/elfinder folder, which is where all the elfinder temp files such as thumbnails are stored. In the past I seem to remember your server had issues with the shipped .htaccess files within the /tmp folder structure.

exponentcms commented 4 years ago

Actually, with the above editor customization (config.js), I can copy/paste the attached sample above and it remains intact...however, we tend to strip out quite a bit of garbage in all input to prevent xss and injection attacks.

exponentcms commented 4 years ago

Thanks Dave. That seems to work (editor).

I did rename the htaccess file in that folder but it made no difference. I still get the panda bear icon. There are thumbnails in the folder. I also renamed any htaccess under tmp but still no change.

exponentcms commented 4 years ago

In a drastic move I deleted all htaccess files in all folders under tmp and now I have thumbnails!

exponentcms commented 4 years ago

Lighthouse URL: https://exponentcms.lighthouseapp.com/projects/61783/tickets/1411