Vinai / nicer-image-names

Magento extension to build catalog image file names from product attributes so they have neat descriptive names.
77 stars 31 forks source link

Image file not found - massive report #1

Closed sportluffi closed 11 years ago

sportluffi commented 11 years ago

I'm getting a very huge amount of error-reports, all with the "Image file not found"-error. Running Magento 1.7.0.2 CE.

a:5:{i:0;s:20:"Image file not found";i:1;s:6224:"#0  /app/code/core/Mage/Catalog/Helper/Image.php(163): Netzarbeiter_NicerImageNames_Model_Image->setBaseFile('no_selection')
#1  /app/code/community/Netzarbeiter/NicerImageNames/Helper/Image.php(48): Mage_Catalog_Helper_Image->init(Object(Mage_Catalog_Model_Product), 'thumbnail', NULL)
#2  /app/design/frontend/corporate/default/template/easytabs/catalogproductrelated.phtml(42): Netzarbeiter_NicerImageNames_Helper_Image->init(Object(Mage_Catalog_Model_Product), 'thumbnail')
#3  /app/code/core/Mage/Core/Block/Template.php(241): include('home/.../...')
#4  /app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/corpor...')
#5  /app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#6  /app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Core_Block_Template->_toHtml()
#7  /app/code/core/Mage/Core/Block/Abstract.php(582): Mage_Core_Block_Abstract->toHtml()
#8  /app/code/core/Mage/Core/Block/Abstract.php(526): Mage_Core_Block_Abstract->_getChildHtml('related_tabbed', true)
#9  /app/design/frontend/corporate/default/template/easytabs/tabs.phtml(35): Mage_Core_Block_Abstract->getChildHtml('related_tabbed')
#10  /app/code/core/Mage/Core/Block/Template.php(241): include('home/.../...')
#11  /app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/corpor...')
#12  /app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#13  /app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Core_Block_Template->_toHtml()
#14  /app/code/core/Mage/Catalog/Block/Product/View/Additional.php(55): Mage_Core_Block_Abstract->toHtml()
#15  /app/design/frontend/corporate/default/template/catalog/product/view/additional.phtml(27): Mage_Catalog_Block_Product_View_Additional->getChildHtmlList()
#16  /app/code/core/Mage/Core/Block/Template.php(241): include('home/.../...')
#17  /app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/corpor...')
#18  /app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#19  /app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Core_Block_Template->_toHtml()
#20  /app/code/core/Mage/Core/Block/Abstract.php(582): Mage_Core_Block_Abstract->toHtml()
#21  /app/code/core/Mage/Core/Block/Abstract.php(526): Mage_Core_Block_Abstract->_getChildHtml('product_additio...', true)
#22  /app/design/frontend/corporate/default/template/easytabs/catalogproductview.phtml(117): Mage_Core_Block_Abstract->getChildHtml('product_additio...')
#23  /app/code/core/Mage/Core/Block/Template.php(241): include('/home/.../...')
#24  /app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/corpor...')
#25  /app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#26  /app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Core_Block_Template->_toHtml()
#27  /app/code/core/Mage/Core/Block/Text/List.php(43): Mage_Core_Block_Abstract->toHtml()
#28  /app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Core_Block_Text_List->_toHtml()
#29  /app/code/core/Mage/Core/Block/Abstract.php(582): Mage_Core_Block_Abstract->toHtml()
#30  /app/code/core/Mage/Core/Block/Abstract.php(526): Mage_Core_Block_Abstract->_getChildHtml('content', true)
#31  /app/design/frontend/corporate/default/template/page/2columns-right.phtml(49): Mage_Core_Block_Abstract->getChildHtml('content')
#32  /app/code/core/Mage/Core/Block/Template.php(241): include('/home/.../...')
#33  /app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/corpor...')
#34  /app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#35  /app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Core_Block_Template->_toHtml()
#36  /app/code/core/Mage/Core/Model/Layout.php(555): Mage_Core_Block_Abstract->toHtml()
#37  /app/code/core/Mage/Core/Controller/Varien/Action.php(390): Mage_Core_Model_Layout->getOutput()
#38  /app/code/core/Mage/Cms/Helper/Page.php(137): Mage_Core_Controller_Varien_Action->renderLayout()
#39  /app/code/core/Mage/Cms/Helper/Page.php(52): Mage_Cms_Helper_Page->_renderPage(Object(Mage_Cms_IndexController), 'no-route')
#40  /app/code/core/Mage/Cms/controllers/IndexController.php(75): Mage_Cms_Helper_Page->renderPage(Object(Mage_Cms_IndexController), 'no-route')
#41  /app/code/core/Mage/Core/Controller/Varien/Action.php(419): Mage_Cms_IndexController->noRouteAction()
#42  /app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('noRoute')
#43  /app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#44  /app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#45  /app/Mage.php(683): Mage_Core_Model_App->run(Array)
#46  /index.php(92): Mage::run('', 'store')
#47 {main}";s:3:"url";s:38:"/product.html";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:9:"store";}
Vinai commented 11 years ago

The exception is actually triggered in the parent class Mage_Catalog_Model_Product_Image from the core. Please refer to the method setBaseFile() (on line 263) in my copy of Magento. What is happening is that it is trying to build a path to a placeholder image, but that placeholder doesn't exist. To figure out the place it's looking at, I'd add a Mage::log($baseFile) statement to line 306.

This issue seems to be specific to your installation and will - as far as I can tell - also accure without the NicerImageNames extension.

anhdung307 commented 7 years ago

you can solve this problem in a way $productMediaConfig = Mage::getModel('catalog/product_media_config'); try{ $baseImageUrl = Mage::helper('catalog/image')->init($product, 'image'); } catch(Exception $e) { $baseImageUrl = $productMediaConfig->getMediaUrl($product->getImage()); }