eurodollar Posted July 10, 2013 Share Posted July 10, 2013 (edited) Jak w tytule. Prestashop najnowsza.. Moduł: Banner manager / multiple advertising (Menadżer bannerów i reklam) Dokładnie wyskakuje: [PrestaShop] Fatal error in module bannermanager: Call to undefined function checkImage() Jakieś pomysły dlaczego? Edited July 10, 2013 by eurodollar (see edit history) Link to comment Share on other sites More sharing options...
eurodollar Posted July 10, 2013 Author Share Posted July 10, 2013 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> </div> <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> </div> Widzicie tu taka opcje? Link to comment Share on other sites More sharing options...
vekia Posted July 10, 2013 Share Posted July 10, 2013 nie, mowa tutaj najprawdopodobniej o pliku php modułu tam zwykle się używa funkcji php - w plikach .tpl nie jest to wskazane (a nawet niemożliwe w nowym smarty) Link to comment Share on other sites More sharing options...
eurodollar Posted July 10, 2013 Author Share Posted July 10, 2013 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.')); } else $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"? Link to comment Share on other sites More sharing options...
vekia Posted July 10, 2013 Share Posted July 10, 2013 nei wiem co to za funkcja, nie ma innych plików php w kodzie które dołączane są za pośrednictwem np. include albo require_once ? Link to comment Share on other sites More sharing options...
JJson Posted July 22, 2013 Share Posted July 22, 2013 (edited) Change this line: if ($error = checkImage($_FILES['banner_image'], $this->maxImageSize)) Into: 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 July 22, 2013 by JJson (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted July 22, 2013 Share Posted July 22, 2013 proszę pisać po polsku, jesteśmy w polskiej sekcji na forum dzięki Link to comment Share on other sites More sharing options...
JJson Posted July 23, 2013 Share Posted July 23, 2013 (edited) Jasne, z rozpędu napisałem po angielsku PS w wyrażeniach "po Polsku" i "Polskiej" nie używamy dużych liter dzięki Edited July 23, 2013 by JJson (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted July 23, 2013 Share Posted July 23, 2013 mea culpa, kajam się i tarzam w popiele, błędy bez zbędnej zwłoki poprawiłem. po PS nie stawiamy kropki Link to comment Share on other sites More sharing options...
JJson Posted July 23, 2013 Share Posted July 23, 2013 (edited) Teraz jesteśmy piękni i gładcy, haha a problem rozwiązany? Edited July 23, 2013 by JJson (see edit history) 1 Link to comment Share on other sites More sharing options...
Recommended Posts