Jump to content

ContextErrorException Notice: Undefined offset: 0


hari44

Recommended Posts

Hi

I have problem with my shop.
I changed a Validate.php (i commented some lines to display iframes in main page). When I reload it's http error 500.
Of course I put original Validate.php file instead, but it's still not working. Can someone help me?

Logs from debug mode below.

 

ContextErrorException in tt_productimagehover.php line 76:Notice: Undefined offset: 0

  1. in tt_productimagehover.php line 76
  2. at ErrorHandler->handleError('8', 'Undefined offset: 0', '/home/users/sklepanmar/public_html/sklepanmar.pl/modules/tt_productimagehover/tt_productimagehover.php', '76', array('params' => array('id_product' => '34', 'home' => 'home_default', 'large' => 'large_default', 'smarty' => object(SmartyDevTemplate), 'cookie' => object(Cookie), 'cart' => object(Cart), 'altern' => '1'), 'id_lang' => '2', 'id_shop' => '1', 'obj' => object(Product), 'images' => array(array('cover' => '1', 'id_image' => '70', 'legend' => '', 'position' => '1')), '_images' => array(), 'image' => array('cover' => '1', 'id_image' => '70', 'legend' => '', 'position' => '1'))) in tt_productimagehover.php line 76
  3. at Tt_Productimagehover->hookDisplayTtproductImageHover(array('id_product' => '34', 'home' => 'home_default', 'large' => 'large_default', 'smarty' => object(SmartyDevTemplate), 'cookie' => object(Cookie), 'cart' => object(Cart), 'altern' => '1')) in Hook.php line 924
  4. at HookCore::coreCallHook(object(Tt_Productimagehover), 'hookdisplayTtproductImageHover', array('id_product' => '34', 'home' => 'home_default', 'large' => 'large_default', 'smarty' => object(SmartyDevTemplate), 'cookie' => object(Cookie), 'cart' => object(Cart), 'altern' => '1')) in Hook.php line 328
  5. at HookCore::callHookOn(object(Tt_Productimagehover), 'displayTtproductImageHover', array('id_product' => '34', 'home' => 'home_default', 'large' => 'large_default', 'smarty' => object(SmartyDevTemplate), 'cookie' => object(Cookie), 'cart' => object(Cart), 'altern' => '1')) in Hook.php line 860
  6. at HookCore::exec('displayTtproductImageHover', array('id_product' => '34', 'home' => 'home_default', 'large' => 'large_default', 'smarty' => object(SmartyDevTemplate)), null) in smarty.config.inc.php line 168
  7. at smartyHook(array('h' => 'displayTtproductImageHover', 'id_product' => '34', 'home' => 'home_default', 'large' => 'large_default'), object(SmartyDevTemplate))
  8. at call_user_func_array('smartyHook', array(array('h' => 'displayTtproductImageHover', 'id_product' => '34', 'home' => 'home_default', 'large' => 'large_default'), object(SmartyDevTemplate))) in SmartyLazyRegister.php line 83
  9. at SmartyLazyRegister->__call('smartyHook', array(array('h' => 'displayTtproductImageHover', 'id_product' => '34', 'home' => 'home_default', 'large' => 'large_default'), object(SmartyDevTemplate))) in a9adb559860d4edc1973d5bb2b67b1e73b34f364.file.product.tpl.cache.php line 59
  10. at SmartyLazyRegister->smartyHook(array('h' => 'displayTtproductImageHover', 'id_product' => '34', 'home' => 'home_default', 'large' => 'large_default'), object(SmartyDevTemplate)) in a9adb559860d4edc1973d5bb2b67b1e73b34f364.file.product.tpl.cache.php line 59
  11. at content_5ca742d808a482_97919889(object(SmartyDevTemplate)) in smarty_internal_templatebase.php line 188
  12. at Smarty_Internal_TemplateBase->fetch(null, null, null, null, false, false, true) in SmartyDevTemplate.php line 41
  13. at SmartyDevTemplateCore->fetch(null, null, null, null, false, false, true) in smarty_internal_template.php line 303
  14. at Smarty_Internal_Template->getSubTemplate('catalog/_partials/miniatures/product.tpl', 'tt_bestsellers|1|1|1|3|14', null, '9999', null, array('product' => array('id_product' => '34', 'id_supplier' => '0', 'id_manufacturer' => '0', 'id_category_default' => '7', 'id_shop_default' => '1', 'id_tax_rules_group' => '3', 'on_sale' => '0', 'online_only' => '0', 'ean13' => '', 'isbn' => '', 'upc' => '', 'ecotax' => array('value' => '0,00 zł', 'amount' => '0.000000', 'rate' => '0'), 'quantity' => '998740', 'minimal_quantity' => '30', 'low_stock_threshold' => null, 'low_stock_alert' => '0', 'price' => '0,41 zł', 'wholesale_price' => '0.000000', 'unity' => 'kg', 'unit_price_ratio' => '0.010000', 'additional_shipping_cost' => '0.00', 'reference' => '', 'supplier_reference' => '', 'location' => '', 'width' => '0.000000', 'height' => '0.000000', 'depth' => '0.000000', 'weight' => '0.010000', 'out_of_stock' => '2', 'additional_delivery_times' => '1', 'quantity_discount' => '0', 'customizable' => '0', 'uploadable_files' => '0', 'text_fields' => '0', 'active' => '1', 'redirect_type' => '404', 'id_type_redirected' => '0', 'available_for_order' => '1', 'available_date' => '0000-00-00', 'show_condition' => '0', 'condition' => false, 'show_price' => true, 'indexed' => '1', 'visibility' => 'both', 'cache_is_pack' => '0', 'cache_has_attachments' => '0', 'is_virtual' => '0', 'cache_default_attribute' => '0', 'date_add' => '2018-03-28 11:55:17', 'date_upd' => '2018-06-19 10:09:13', 'advanced_stock_management' => '0', 'pack_stock_type' => '3', 'state' => '1', 'id_shop' => '1', 'id_lang' => '2', 'description' => '<p>Boczek wileński - surowiec bez skóry i żebra - natarty solą i świeżo zmielonym pieprzem czarnym, kolendrą, gałką, zielem angielskimi papryką.</p>', 'description_short' => '<p>Minimalna ilość boczku do zamówienia to 0,3kg<br />Cena za 100g produktu - 4,10 zł brutto</p> <p>Dopuszcza się różnice wagowe +/- 15% co wpływa na finalną cenę<br />(jesteśmy tradycyjnym sklepem regionalnym i wszystkie wędliny kroi się nożem)</p>', 'link_rewrite' => 'boczek-wilenski', 'meta_description' => '', 'meta_keywords' => '', 'meta_title' => '', 'name' => 'Boczek wileński', 'available_now' => '', 'available_later' => '', 'delivery_in_stock' => '', 'delivery_out_stock' => '', 'new' => '0', 'product_attribute_minimal_quantity' => null, 'id_product_attribute' => '0', 'manufacturer_name' => null, 'id_image' => '34-70', 'legend' => '', 'sales' => '330', 'rate' => '5', 'allow_oosp' => '1', 'category' => 'wedliny-wieprzowe', 'category_name' => 'Wędliny wieprzowe', 'link' => 'https://sklepanmar.pl/wedliny-wieprzowe/34-boczek-wilenski.html', 'attribute_price' => '0', 'price_tax_exc' => '0.390476', 'price_without_reduction' => '0.41', 'reduction' => '0', 'specific_prices' => array(), 'quantity_all_versions' => '998740', 'features' => array(), 'attachments' => array(), 'virtual' => '0', 'pack' => '0', 'packItems' => array(), 'nopackprice' => '0', 'customization_required' => false, 'tax_name' => 'PTU PL 5%', 'ecotax_rate' => '0', 'unit_price' => '41,00 zł', 'id' => '34', 'attributes' => array(), 'weight_unit' => 'kg', 'images' => array(array('bySize' => array('small_default' => array('url' => 'https://sklepanmar.pl/70-small_default/boczek-wilenski.jpg', 'width' => '98', 'height' => '98'), 'cart_default' => array('url' => 'https://sklepanmar.pl/70-cart_default/boczek-wilenski.jpg', 'width' => '125', 'height' => '125'), 'home_default' => array('url' => 'https://sklepanmar.pl/70-home_default/boczek-wilenski.jpg', 'width' => '450', 'height' => '450'), 'medium_default' => array('url' => 'https://sklepanmar.pl/70-medium_default/boczek-wilenski.jpg', 'width' => '452', 'height' => '452'), 'large_default' => array('url' => 'https://sklepanmar.pl/70-large_default/boczek-wilenski.jpg', 'width' => '800', 'height' => '800')), 'small' => array('url' => 'https://sklepanmar.pl/70-small_default/boczek-wilenski.jpg', 'width' => '98', 'height' => '98'), 'medium' => array('url' => 'https://sklepanmar.pl/70-home_default/boczek-wilenski.jpg', 'width' => '450', 'height' => '450'), 'large' => array('url' => 'https://sklepanmar.pl/70-large_default/boczek-wilenski.jpg', 'width' => '800', 'height' => '800'), 'legend' => '', 'cover' => '1', 'id_image' => '70', 'position' => '1', 'associatedVariants' => array())), 'cover' => array('bySize' => array('small_default' => array('url' => 'https://sklepanmar.pl/70-small_default/boczek-wilenski.jpg', 'width' => '98', 'height' => '98'), 'cart_default' => array('url' => 'https://sklepanmar.pl/70-cart_default/boczek-wilenski.jpg', 'width' => '125', 'height' => '125'), 'home_default' => array('url' => 'https://sklepanmar.pl/70-home_default/boczek-wilenski.jpg', 'width' => '450', 'height' => '450'), 'medium_default' => array('url' => 'https://sklepanmar.pl/70-medium_default/boczek-wilenski.jpg', 'width' => '452', 'height' => '452'), 'large_default' => array('url' => 'https://sklepanmar.pl/70-large_default/boczek-wilenski.jpg', 'width' => '800', 'height' => '800')), 'small' => array('url' => 'https://sklepanmar.pl/70-small_default/boczek-wilenski.jpg', 'width' => '98', 'height' => '98'), 'medium' => array('url' => 'https://sklepanmar.pl/70-home_default/boczek-wilenski.jpg', 'width' => '450', 'height' => '450'), 'large' => array('url' => 'https://sklepanmar.pl/70-large_default/boczek-wilenski.jpg', 'width' => '800', 'height' => '800'), 'legend' => '', 'cover' => '1', 'id_image' => '70', 'position' => '1', 'associatedVariants' => array()), 'url' => 'https://sklepanmar.pl/wedliny-wieprzowe/34-boczek-wilenski.html', 'canonical_url' => 'https://sklepanmar.pl/wedliny-wieprzowe/34-boczek-wilenski.html', 'has_discount' => false, 'discount_type' => null, 'discount_percentage' => null, 'discount_percentage_absolute' => null, 'discount_amount' => null, 'discount_amount_to_display' => null, 'price_amount' => '0.41', 'regular_price_amount' => '0.41', 'regular_price' => '0,41 zł', 'discount_to_display' => null, 'unit_price_full' => '41,00 zł kg', 'add_to_cart_url' => 'https://sklepanmar.pl/koszyk?add=1&id_product=34&id_product_attribute=0&token=3aff33175ff36cb85253d11816af5097', 'main_variants' => array(), 'flags' => array(), 'labels' => array('tax_short' => '(brutto)', 'tax_long' => 'Brutto'), 'show_availability' => true, 'availability_date' => null, 'availability_message' => '', 'availability' => 'available', 'delivery_information' => '', 'quantity_discounts' => array(), 'embedded_attributes' => array('id_product' => '34', 'id_supplier' => '0', 'id_manufacturer' => '0', 'id_category_default' => '7', 'id_shop_default' => '1', 'on_sale' => '0', 'online_only' => '0', 'ecotax' => '0.000000', 'quantity' => '998740', 'minimal_quantity' => '30', 'low_stock_threshold' => null, 'low_stock_alert' => '0', 'price' => '0.41', 'unity' => 'kg', 'unit_price_ratio' => '0.010000', 'additional_shipping_cost' => '0.00', 'reference' => '', 'out_of_stock' => '2', 'customizable' => '0', 'uploadable_files' => '0', 'text_fields' => '0', 'redirect_type' => '404', 'id_type_redirected' => '0', 'available_for_order' => '1', 'available_date' => '0000-00-00', 'show_condition' => '0', 'condition' => 'new', 'show_price' => '1', 'indexed' => '1', 'visibility' => 'both', 'is_virtual' => '0', 'cache_default_attribute' => '0', 'date_add' => '2018-03-28 11:55:17', 'date_upd' => '2018-06-19 10:09:13', 'advanced_stock_management' => '0', 'pack_stock_type' => '3', 'description' => '<p>Boczek wileński - surowiec bez skóry i żebra - natarty solą i świeżo zmielonym pieprzem czarnym, kolendrą, gałką, zielem angielskimi papryką.</p>', 'description_short' => '<p>Minimalna ilość boczku do zamówienia to 0,3kg<br />Cena za 100g produktu - 4,10 zł brutto</p> <p>Dopuszcza się różnice wagowe +/- 15% co wpływa na finalną cenę<br />(jesteśmy tradycyjnym sklepem regionalnym i wszystkie wędliny kroi się nożem)</p>', 'link_rewrite' => 'boczek-wilenski', 'meta_description' => '', 'meta_keywords' => '', 'meta_title' => '', 'name' => 'Boczek wileński', 'available_now' => '', 'available_later' => '', 'delivery_in_stock' => '', 'delivery_out_stock' => '', 'new' => '0', 'id_product_attribute' => '0', 'id_image' => '34-70', 'rate' => '5', 'allow_oosp' => '1', 'category' => 'wedliny-wieprzowe', 'category_name' => 'Wędliny wieprzowe', 'link' => 'https://sklepanmar.pl/wedliny-wieprzowe/34-boczek-wilenski.html', 'attribute_price' => '0', 'price_tax_exc' => '0.390476', 'price_without_reduction' => '0.41', 'reduction' => '0', 'specific_prices' => array(), 'quantity_all_versions' => '998740', 'features' => array(), 'attachments' => array(), 'virtual' => '0', 'pack' => '0', 'packItems' => array(), 'nopackprice' => '0', 'customization_required' => false, 'tax_name' => 'PTU PL 5%', 'ecotax_rate' => '0', 'unit_price' => '41'), 'grouped_features' => array())), '0') in 9eb91118876b66d5ea09de80bf30567df3044bf4.module.tt_bestsellers.tpl.cache.php line 62
  15. at content_5ca742d7dc30c3_59173290(object(SmartyDevTemplate)) in smarty_internal_templatebase.php line 188
  16. at Smarty_Internal_TemplateBase->fetch(null, null, null, null, false, true, false) in SmartyDevTemplate.php line 41
  17. at SmartyDevTemplateCore->fetch() in Module.php line 2282
  18. at ModuleCore->fetch('module:tt_bestsellers/views/templates/hook/tt_bestsellers.tpl', 'tt_bestsellers|1|1|1|3|14') in tt_bestsellers.php line 194
  19. at Tt_BestSellers->renderWidget('displayHomeTab', array('smarty' => object(SmartyDevTemplate), 'cookie' => object(Cookie), 'cart' => object(Cart))) in Hook.php line 929
  20. at HookCore::coreRenderWidget(object(Tt_BestSellers), 'displayHomeTab', array('smarty' => object(SmartyDevTemplate), 'cookie' => object(Cookie), 'cart' => object(Cart))) in Hook.php line 881
  21. at HookCore::exec('displayHomeTab', array('smarty' => object(SmartyDevTemplate)), null) in smarty.config.inc.php line 168
  22. at smartyHook(array('h' => 'displayHomeTab'), object(SmartyDevTemplate))
  23. at call_user_func_array('smartyHook', array(array('h' => 'displayHomeTab'), object(SmartyDevTemplate))) in SmartyLazyRegister.php line 83
  24. at SmartyLazyRegister->__call('smartyHook', array(array('h' => 'displayHomeTab'), object(SmartyDevTemplate))) in 68ed643394eeb8954b06deeea5b6acfec897e04d.file.index.tpl.php line 184
  25. at SmartyLazyRegister->smartyHook(array('h' => 'displayHomeTab'), object(SmartyDevTemplate)) in 68ed643394eeb8954b06deeea5b6acfec897e04d.file.index.tpl.php line 184
  26. at content_5ca742d71dcf06_59987153(object(SmartyDevTemplate)) in smarty_internal_templatebase.php line 188
  27. at Smarty_Internal_TemplateBase->fetch('index.tpl', null, 'layouts/layout-full-width.tpl', null, false, true, false) in SmartyDev.php line 41
  28. at SmartyDev->fetch('index.tpl', null, 'layouts/layout-full-width.tpl') in FrontController.php line 669
  29. at FrontControllerCore->smartyOutputContent('index.tpl') in FrontController.php line 653
  30. at FrontControllerCore->display() in Controller.php line 225
  31. at ControllerCore->run() in Dispatcher.php line 428
  32. at DispatcherCore->dispatch() in index.php line 28
Link to comment
Share on other sites

			$this->smarty->assign(array(
				'home_image' => $this->context->link->getImageLink($obj->link_rewrite, $_images[0], $params['home']),
				'large_image' => $this->context->link->getImageLink($obj->link_rewrite, $_images[0], $params['large'])
			));

In my opinion there is nothing wrong 😕 This file last modification was 1 year ago. I wonder why shop crashed after put original file classes/Validate.php

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...