Saya hanya menguji Magento 1.9.2 dengan Php 7. Semua tampak berfungsi, tetapi tiba-tiba saya mencoba mengunggah gambar untuk produk. Saya mendapat kesalahan seperti di bawah ini:
Fatal error</b>: Uncaught Error: Function name must be a string in /home/admin/domains/store.com/public_html/dev/lib/Varien/File/Uploader.php:259
Stack trace:
#0 /home/admin/domains/store.com/public_html/dev/lib/Varien/File/Uploader.php(180): Varien_File_Uploader->_validateFile()
#1 /home/admin/domains/store.com/public_html/dev/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/GalleryController.php(46): Varien_File_Uploader->save('/home/admin/dom...')
#2 /home/admin/domains/store.com/public_html/dev/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Adminhtml_Catalog_Product_GalleryController->uploadAction()
#3 /home/admin/domains/store.com/public_html/dev/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('upload')
#4 /home/admin/domains/store.com/public_html/dev/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller in <b>/home/admin/domains/store.com/public_html/dev/lib/Varien/File/Uploader.php
Adakah yang tahu cara memperbaikinya?
Fungsi terpengaruh di upload.php pada baris sekitar 259
protected function _validateFile()
{
if ($this->_fileExists === false) {
return;
}
//is file extension allowed
if (!$this->checkAllowedExtension($this->getFileExtension())) {
throw new Exception('Disallowed file type.');
}
//run validate callbacks
foreach ($this->_validateCallbacks as $params) {
if (is_object($params['object']) && method_exists($params['object'], $params['method'])) {
$params['object']->$params['method']($this->_file['tmp_name']);
}
}
}