0

I am using Responsive Filemanager with tinyMce 4.6.5 in Codeigniter. After the page is loaded, if I try to insert an image from the existing ones, the thumbnails are not displayed (example in the picture).

enter image description here

My Responsive Filemanager configuration:

'base_url' => ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] && ! in_array(strtolower($_SERVER['HTTPS']), array( 'off', 'no' ))) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'],
'upload_dir' => '/testsite/uploads/tinyMce/thumbs/',
'current_path' => '../../uploads/tinyMce/thumbs/',
'thumbs_base_path' => '../../uploads/tinyMce/thumbs/', //opens in filemanager

And tinyMce configuration:

tinymce.init({
selector: selector,
height: 200,
width: 700,
theme: 'modern',
skin:'lightgray',
plugins: [
    'advlist autolink lists charmap print preview hr anchor pagebreak',
    'searchreplace wordcount visualblocks visualchars code fullscreen',
    'insertdatetime nonbreaking save table contextmenu directionality',
    'emoticons template paste textcolor textpattern imagetools toc responsivefilemanager'
],
filemanager_title:"Responsive Filemanager",
external_filemanager_path: siteURL + "scripts/filemanager/",
external_plugins: { "filemanager" : siteURL + "scripts/filemanager/plugin.min.js"},
toolbar1: 'undo redo | insert | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image',
toolbar2: 'print preview media | forecolor backcolor emoticons | help',
image_advtab: true,
templates: [
    { title: 'Test template 1', content: 'Test 1' },
    { title: 'Test template 2', content: 'Test 2' }
]
});

If I inspect the image container, this is the html:

<img class=" lazy-loaded" data-original="../../uploads/tinyMce/thumbs/doggo.jpg" src="data:image/png;base64...">

And after pressing the refresh button from Responsive filemanager, it changes to this:

<img class=" lazy-loaded" data-original="../../uploads/tinyMce/thumbs/doggo.jpg" src="../../uploads/tinyMce/thumbs/doggo.jpg" style="display: inline;">

The thumbnail is displayed if I press on 'Preview'.

Thanks in advance :)

mihaela
  • 394
  • 2
  • 12
  • 1
    Is there a "../../uploads/tinyMce/thumbs/doggo.jpg" file? If so, does the web server have read permission on the file? – ourmandave Aug 25 '17 at 11:26
  • Yes, the photo is on the server and it has 755 permission set. When I press the insert file for the first time the thumbnail is not displayed, if i close the popup and try again, it appears. – mihaela Aug 25 '17 at 11:59
  • [I found this related answer](https://stackoverflow.com/a/44430586/3585500). Are you getting any script errors in the console? – ourmandave Aug 25 '17 at 12:37
  • Still not working – mihaela Aug 29 '17 at 09:55
  • From my experience RFM thumb problems are almost always related to permissions. I think it auto-generates the thumbs with weird permissions like 766 which might be a problem on some systems. Is the site running on cPane/WHM by any chance? – Ynhockey Nov 16 '17 at 07:06
  • @Ynhockey, yes, it's running cPanel and WHM Thanks for the suggestion! – mihaela Nov 16 '17 at 07:59

1 Answers1

2

try to edit a file from filemanager folder that name is dialog.php Type search "img" and you will find div with class img-precontainer. Then you will see "data-src". You must change it to be "src". Hope it works.

here is the link for the code/example https://gist.github.com/cloudsnight/f44103499e9bb5b782efea7e80b4c9a6

here is the link of complete example from me : https://github.com/cloudsnight/testplugins.git

Uchin
  • 21
  • 3