8
Magento 1.9.1
Porto theme

We had to have our hosting company do a full restore. Now most things work except for when going into the images tab in the Admin panel:

  • it shows the BROWSE FILES and UPLOAD FILES buttons and those seem to work

however, there are no photos visible in the Image column and it actually says: No image

enter image description here

I can click on Browse files, select a file from a folder and upload it successfully - it confirms that by saying:

1.jpg (55.83 kB) Complete

But still no visible images.

What can I try to do to fix this?


the last entry in: var/log/exception.log is this:

2018-03-08T23:15:04+00:00 ERR (3): 
exception 'Zend_Mail_Protocol_Exception' with message 'Connection refused' in /home/thisISmySITE/public_html/lib/Zend/Mail/Protocol/Abstract.php:277
Stack trace:
#0 /home/thisISmySITE/public_html/lib/Zend/Mail/Protocol/Smtp.php(167): Zend_Mail_Protocol_Abstract->_connect('tcp://smtp.send...')
#1 /home/thisISmySITE/public_html/lib/Zend/Mail/Transport/Smtp.php(199): Zend_Mail_Protocol_Smtp->connect()
#2 /home/thisISmySITE/public_html/lib/Zend/Mail/Transport/Abstract.php(348): Zend_Mail_Transport_Smtp->_sendMail()
#3 /home/thisISmySITE/public_html/lib/Zend/Mail.php(1194): Zend_Mail_Transport_Abstract->send(Object(Zend_Mail))
#4 /home/thisISmySITE/public_html/app/code/local/Aschroder/SMTPPro/Model/Email/Queue.php(98): Zend_Mail->send(Object(Zend_Mail_Transport_Smtp))
#5 [internal function]: Aschroder_SMTPPro_Model_Email_Queue->send(Object(Mage_Cron_Model_Schedule))
#6 /home/thisISmySITE/public_html/app/code/core/Mage/Cron/Model/Observer.php(325): call_user_func_array(Array, Array)
#7 /home/thisISmySITE/public_html/app/code/core/Mage/Cron/Model/Observer.php(72): Mage_Cron_Model_Observer->_processJob(Object(Mage_Cron_Model_Schedule), Object(Mage_Core_Model_Config_Element))
#8 /home/thisISmySITE/public_html/app/code/core/Mage/Core/Model/App.php(1338): Mage_Cron_Model_Observer->dispatch(Object(Varien_Event_Observer))
#9 /home/thisISmySITE/public_html/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Mage_Cron_Model_Observer), 'dispatch', Object(Varien_Event_Observer))
#10 /home/thisISmySITE/public_html/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('default', Array)
#11 /home/thisISmySITE/public_html/cron.php(75): Mage::dispatchEvent('default')
#12 {main}

This is what the console says during the process of uploading an image:

DOM7011: The code on this page disabled back and forward caching. For more information, see: http://go.microsoft.com/fwlink/?LinkID=291337 File: 55c7f862cd1a4eefae384ccd2ce42493 HTML1300: Navigation occurred. File: 06dc7ed0d3ba9cd48335ee3599697dbe DOM7011: The code on this page disabled back and forward caching. For more information, see: http://go.microsoft.com/fwlink/?LinkID=291337 File: 55c7f862cd1a4eefae384ccd2ce42493 SCRIPT5007: Unable to set property 'target' of undefined or null reference File:

> 55c7f862cd1a4eefae384ccd2ce42493, Line: 538, Column: 36

This is what was posted into the var/log/system.log file during me trying to upload an image in the Product page of the Magento Admin Panel:

2018-11-13T21:47:33+00:00 ERR (3): Warning: simplexml_load_string(): Entity: line 9: parser error : Premature end of data in tag config line 2 in /home/newthisISmySITE/public_html/lib/Varien/Simplexml/Config.php on line 510 2018-11-13T21:47:33+00:00 ERR (3): Warning: simplexml_load_string(): in /home/newthisISmySITE/public_html/lib/Varien/Simplexml/Config.php on line 510 2018-11-13T21:47:33+00:00 ERR (3): Warning: simplexml_load_string(): ^ in /home/newthisISmySITE/public_html/lib/Varien/Simplexml/Config.php on line 510 2018-11-13T21:47:33+00:00 ERR (3): Warning: simplexml_load_string(): Entity: line 9: parser error : Premature end of data in tag config line 2 in /home/newthisISmySITE/public_html/lib/Varien/Simplexml/Config.php on line 510 2018-11-13T21:47:33+00:00 ERR (3): Warning: simplexml_load_string(): in /home/newthisISmySITE/public_html/lib/Varien/Simplexml/Config.php on line 510 2018-11-13T21:47:33+00:00 ERR (3): Warning: simplexml_load_string(): ^ in /home/newthisISmySITE/public_html/lib/Varien/Simplexml/Config.php on

> line 510

This is how that section in

lib/Varien/Simplexml/Config.php

looks like now:

public function loadFile($filePath)
        {
            if (!is_readable($filePath)) {
                //throw new Exception('Can not read xml file '.$filePath);
                return false;
            }

            $fileData = file_get_contents($filePath);
            $fileData = $this->processFileData($fileData);
            return $this->loadString($fileData, $this->_elementClass);
        }

I did change it to this and then got Errors (in /var/log/system.log) which I listed below...

public function loadFile($filePath)
        {

    file_put_contents(MAGENTO_ROOT.'/var/log/system.log', $filePath."\n", FILE_APPEND);

            if (!is_readable($filePath)) {
                //throw new Exception('Can not read xml file '.$filePath);
                return false;
            }

            $fileData = file_get_contents($filePath);
            $fileData = $this->processFileData($fileData);
            return $this->loadString($fileData, $this->_elementClass);
        }

I changed the code exactly as it is above but I wonder if that is not correct? The messages I found in the system.log file are these:

2018-11-13T21:47:33+00:00 ERR (3): Warning: simplexml_load_string(): Entity: line 9: parser error : Premature end of data in tag config line 2  in /home/newnewthisISmySITE/public_html/lib/Varien/Simplexml/Config.php on line 510
2018-11-13T21:47:33+00:00 ERR (3): Warning: simplexml_load_string():   in /home/newnewthisISmySITE/public_html/lib/Varien/Simplexml/Config.php on line 510

2018-11-14T13:37:09+00:00 ERR (3): Warning: file_put_contents(MAGENTO_ROOT/var/log/system.log): failed to open stream: No such file or directory  in /home/newnewthisISmySITE/public_html/lib/Varien/Simplexml/Config.php on line 492
2018-11-14T13:37:09+00:00 ERR (3): Warning: file_put_contents(MAGENTO_ROOT/var/log/system.log): failed to open stream: No such file or directory  in /home/newnewthisISmySITE/public_html/lib/Varien/Simplexml/Config.php on line 492

2018-11-14T13:37:10+00:00 ERR (3): Warning: simplexml_load_string(): Entity: line 9: parser error : Premature end of data in tag config line 2  in /home/newnewthisISmySITE/public_html/lib/Varien/Simplexml/Config.php on line 514
2018-11-14T13:37:10+00:00 ERR (3): Warning: simplexml_load_string():   in /home/newnewthisISmySITE/public_html/lib/Varien/Simplexml/Config.php on line 514

2018-11-14T13:37:10+00:00 ERR (3): Warning: file_put_contents(MAGENTO_ROOT/var/log/system.log): failed to open stream: No such file or directory  in /home/newnewthisISmySITE/public_html/lib/Varien/Simplexml/Config.php on line 492
35
  • 1. You're referring to images in the edit product section? 2. What happens when you save the product after uploading a new image, does that image show when you go back into the product?
    – Haim
    Nov 7, 2018 at 23:00
  • yes Edit product section and I have done that and it does NOT show in the front end or back end.
    – Allysin
    Nov 7, 2018 at 23:26
  • Something is corrupted with your database or your permissions. What happens when you create a new product?
    – Haim
    Nov 8, 2018 at 1:32
  • @Haim Thank you for trying to help. When I create a new product, I upload a new product photo, it gives me a message stating it was uploaded but does not show the photo in the back or front end. The product saves though and is visible on the front end...
    – Allysin
    Nov 8, 2018 at 20:45
  • when you go onto your server, is there a directory for magento_root/media/catalog/product?
    – Haim
    Nov 12, 2018 at 21:58

2 Answers 2

0

Ensure Flash is enabled on your website/browser. Try your steps on a different browser to debug, and if that is your issue follow this quick Google guide here https://support.google.com/chrome/answer/6258784

2
  • 3
    Thanks for that. I know what you mean. When I connect from a browser where flash is NOT enabled, the BROWSE and UPLOAD buttons do not appear. That is a different issue from the image not appearing though.
    – Allysin
    Nov 13, 2018 at 9:28
  • Permissions issue then perhaps? Or try to chown the folders to www-data if you're using a common LAMP setup.
    – A. Lal
    Dec 13, 2018 at 1:28
0

Open up the following file:-

lib/Varien/File/Uploader.php

Look for this line:-

chmod($destinationFile, 0640);

Replace it with this line:-

chmod($destinationFile, 0644);

Look for this line:-

chmod($destinationFile, 0750);

Replace it with this line:-

chmod($destinationFile, 0755);

3
  • I only found 1 instance of chmod($destinationFile,.... and mine says: chmod($destinationFile, 0666); I changed it 0644. I am unable to find the 2nd one at all (this one: chmod($destinationFile, 0750); ) Could this be the problem?
    – Allysin
    Nov 13, 2018 at 15:22
  • changing it to 0644 did not help. I will try to change it to 0755 now.
    – Allysin
    Nov 13, 2018 at 15:27
  • I've changed it to 0755, deleted Cache, re-indexed but it did not help.
    – Allysin
    Nov 13, 2018 at 15:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.