Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

mail_open
ERR (3): Warning: Missing argument 1 for Mage_Catalog_Helper_Image::resize()
Lindsay Adams

Excellent
December 11, 2015 - 1:09 pm
Member Since: October 27, 2014
Forum Posts: 32
sp_UserOfflineSmall Offline

Hi All,

I’m getting this error message in my system log (many many times)
ERR (3): Warning: Missing argument 1 for Mage_Catalog_Helper_Image::resize(), called in /public_html/app/design/frontend/custom_uk/default/template/catalog/product/home-list.phtml on line 134 and defined in /public_html/app/code/core/Mage/Catalog/Helper/Image.php on line 180

home-list.phtml line 134 is as follows:-

<!– <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, ‘small_image’), null, true) ?>" class="product-image"><img src="<?php echo $this->helper(‘catalog/image’)->init($_product, ‘small_image’)->resize(); ?>" width="231" height="210" alt="<?php echo $this->stripTags($this->getImageLabel($_product, ‘small_image’), null, true) ?>" /></a>

image.php line 180-185 is as follows:-

public function resize($width, $height = null)
{
$this->_getModel()->setWidth($width)->setHeight($height);
$this->_scheduleResize = true;
return $this;
}

as far as I can tell, they are displaying correctly and if I inspect the elements on the page, they have the dimensions specified in line 134 (231x210px)

http://www.petrolthreads.co.uk

any ideas/pointers most welcome….

cheers

Lindsay

Lindsay Adams

Excellent
December 20, 2015 - 1:00 pm
Member Since: October 27, 2014
Forum Posts: 32
sp_UserOfflineSmall Offline

anyone? I’ve googled and googled and nothing has helped.

Badeth - UE
Member
December 21, 2015 - 8:46 am
Member Since: October 23, 2015
Forum Posts: 513
sp_UserOfflineSmall Offline

Hi Lindsay,

Have you tried clearing the caches, re-indexing, etc.?

I’ll try to get Matt to see this error for you.

Thanks,
Badeth

Badeth - UE
Member
December 21, 2015 - 9:47 am
Member Since: October 23, 2015
Forum Posts: 513
sp_UserOfflineSmall Offline

Hi Lindsay,

This line below expects at least one parameter

public function resize($width, $height = null)

While this code does not have any parameters:

img src=”helper(‘catalog/image’)->init($_product, ‘small_image’)->resize(); ?>

So by adding, say 100 to it, would make it work:
img src=”helper(‘catalog/image’)->init($_product, ‘small_image’)->resize(100); ?>

(and make the width 100 pixels)

Please try getting those missing parameters added and let us know if they’re working fine.

Cheers,
Badeth

Lindsay Adams

Excellent
December 21, 2015 - 11:50 am
Member Since: October 27, 2014
Forum Posts: 32
sp_UserOfflineSmall Offline

HI Badeth,

to answer you previous post – yes I’ve done all cache clearing reindexing etc (I have a cron set up for the reindexing as per one of UE’s videos)

on to the next post – I had assumed that no parameter for resize would mean “do not resize” but I’ll try it and report back.

cheers

Lindsay

Lindsay Adams

Excellent
December 28, 2015 - 4:53 pm
Member Since: October 27, 2014
Forum Posts: 32
sp_UserOfflineSmall Offline

H

Badeth Aradillos said

Hi Lindsay,

This line below expects at least one parameter

public function resize($width, $height = null)

While this code does not have any parameters:

img src=”helper(‘catalog/image’)->init($_product, ‘small_image’)->resize(); ?>

So by adding, say 100 to it, would make it work:
img src=”helper(‘catalog/image’)->init($_product, ‘small_image’)->resize(100); ?>

(and make the width 100 pixels)

Please try getting those missing parameters added and let us know if they’re working fine.

Cheers,
Badeth

I Badeth – finally had a moment to look at this – adding the “100” as a parameter worked (created the same error with another file – “list.phtml” rather than “home-list.phtml” It makes no difference to the look of the site.

thanks for your help

cheers

Lindsay

 

Why Should You Join UnderstandingE?

 
  • Access to over 500 step-by-step video tutorials
  • +20 video courses available
  • Magento, M2E Pro, Magmi, eBay, Amazon & Design all covered
  • Everything is in 100% Plain English
  • Learn how to build your own multi-channel software for eBay & Amazon
  • Access to the community forums, meet fellow business owners like yourself

Join Now with 2 Clicks

 

Join now for less that £1 per day you can gain access to over 400 step-by-step video tutorials & learn how to build your very own multi-channel software.

 

Forum Timezone: Europe/London

Most Users Ever Online: 1012

Currently Online:
39 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Jim @ Moogento: 688

Steve Froggatt: 514

Badeth - UE: 513

Jimbob: 453

Paul Cartwright: 414

Forum Stats:

Groups: 6

Forums: 37

Topics: 5221

Posts: 27483

Administrators: Matthew Ogborne: 4565, Dave Furness: 4606