-
-
Notifications
You must be signed in to change notification settings - Fork 451
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
I've noticed, that when changing folders in WYSIWYG "insert image" modalbox, \Mage_Adminhtml_Cms_Wysiwyg_ImagesController::contentsAction saves current browsed path to $this->_initAction()->_saveSessionCurrentPath().
However, there still can be some pending \Mage_Adminhtml_Cms_Wysiwyg_ImagesController::thumbnailAction requests (like https://magento.local/index.php/admin/cms_wysiwyg_images/thumbnail/file/<b64key>/key/<adminkey>), which from that point will try to search for images in different directory.
Because of that Mage_Cms_Model_Wysiwyg_Images_Storage::resizeFile will always return false; for them.
However, there was custom patch for SUPEE-9767 to allow upload/view PDFs after that patch named Ash_PdfUploadAfterSupee9767, and this specific file https://github.com/augustash/ash_pdfuploadaftersupee9767/blob/cd74d79f42f40782824091f68a40527a51c841a7/app/code/community/Ash/PdfUploadAfterSupee9767/Model/Rewrite/Cms/Wysiwyg/Images/Storage.php#L18 will cause to throw warnings in that case:
Warning: mime_content_type(/home/.../public/media/wysiwyg/home/<somefile.jpg>): failed to open stream: No such file or directory in /home/.....
This doesn't seem to be a big issue, I'm rather reporting it to point out that in case of Image Browser thousands of requests might be done to server, even if folder was already changed. It would be good idea, if they could be somehow queued, as it seems that no more than 21 images fits in this window at once (yet it calls for thumbnail for each image).
Expected Behavior
When using Insert Image/Insert File in WYSIWYG, don't load all thumbnails for folder at once.
Steps To Reproduce
- Put breakpoint in
app/code/core/Mage/Cms/Model/Wysiwyg/Images/Storage.php:370 - Open Insert Image/Insert File in WYSIWYG
- Try to quickly change directories, go to directory root, close and open window few times
- Notice that at some point it would enter into
return false;like file is not existing, because of another folder in session by_saveSessionCurrentPath(). This can be even few hundred of files on complex pages.
Environment
- OpenMage:
- php:Anything else?
No response