Jump to content

Banner manager / multiple advertising Fatal error

Recommended Posts

Znalazłem coś takiego...


This is because the modules are trying to use a deprecated function.

To solve it you have to change in module the CheckImage function for ImageManager::validateUpload and when you done that, it's possible that appears another error with the imageResize funciton, you have to change the imageResize by ImageManager::resize also.


Zmienić w bannermanager_add.tpl ? Tak?


<input type="Radio" id="banner_block_id_left" value="1" name="banner_block_id" />

<label for="banner_block_id_left" class="t">{l s='Left' mod='bannermanager'}</label>

<br />

<input type="Radio" id="banner_block_id_right" value="2" name="banner_block_id" />

<label for="banner_block_id_right" class="t">{l s='Right' mod='bannermanager'}</label>

<br />

<input type="Radio" id="banner_block_id_home" value="3" name="banner_block_id" />

<label for="banner_block_id_home" class="t">{l s='Home' mod='bannermanager'}</label>


<br />

<label for="banner_image">{l s='Banner image' mod='bannermanager'}:</label>

<div class="margin-form">

<input type="file" name="banner_image" />

<p>{l s='Select an image from your computer' mod='bannermanager'}</p>



Widzicie tu taka opcje?

Share this post

Link to post
Share on other sites

Otworzyłem bannermanager.php


I tu widzę tylko jedno CheckImage



// Banners add submit

if (isset($_POST['addBannerSubmit'])){

$bnr['description'] = Tools::getValue('banner_description');

$bnr['image_link'] = Tools::getValue('banner_link');

$bnr['image_name'] = $_FILES['banner_image']['name'];

$bnr['block_id'] = Tools::getValue('banner_block_id');

$bnr['order'] = Tools::getValue('banner_order');

$bnr['blank'] = (Tools::getValue('banner_blank') ? '1' : '0');

$bnr['active'] = (Tools::getValue('banner_active') ? '1' : '0');

/* upload the image */

if (isset($_FILES['banner_image']) AND isset($_FILES['banner_image']['tmp_name']) AND !empty($_FILES['banner_image']['tmp_name']))


Configuration::set('PS_IMAGE_GENERATION_METHOD', 1);

$name = $_FILES['banner_image']['name'];

$ext = strtolower(substr($name, strrpos($name, ".") + 1));

$path = dirname(__FILE__) . '/banners/'. basename( $_FILES['banner_image']['name']);

if (!($ext == 'png' || $ext == 'gif' || $ext == 'jpg' || $ext == 'jpeg' || $ext == 'bmp'))

$errors .= $this->displayError($this->l('Incorrect file type.'));

if ($error = checkImage($_FILES['banner_image'], $this->maxImageSize))

$errors .= $this->displayError($error);

elseif (!move_uploaded_file($_FILES['banner_image']['tmp_name'], $path))

$errors .= $this->displayError($this->l('An error occurred during the image upload.'));


if (isset($errors) && $errors)

$errors .= $this->displayError($this->l('Error creating banner.'));

elseif (!$this->addBanner($bnr))

$errors .= $this->displayError($this->l('Error creating banner on database.'));



$errors .= $this->displayError($this->l('An error occurred during the banner creation.'));

$this->_html .= (isset($errors) && $errors != '') ? $errors : $this->displayConfirmation('Banner added successfully');




Gdzie to dokładnie nadpisać...


I co w sumie wpisać? ;) "ImageManager::validate"?

Share this post

Link to post
Share on other sites

  • 2 weeks later...

Change this line:

if ($error = checkImage($_FILES['banner_image'], $this->maxImageSize))



if ($error = ImageManager::validateUpload($_FILES['banner_image'], Tools::convertBytes($this->maxImageSize))


I guess that should fix the issue. Let me know if that worked :)



BTW. Hello everyone!

Edited by JJson (see edit history)

Share this post

Link to post
Share on other sites


  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More