magento-2-banner-slider
magento-2-banner-slider copied to clipboard
Exception in edit banner settings without re-uploading same image
If you don't select a new banner to upload when editing existing banner, exception occurs:
1 exception(s): Exception #0 (Exception): The file was not uploaded.
Exception #0 (Exception): The file was not uploaded.
#1 Magento\MediaStorage\Model\File\Uploader->__construct() called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:111] #2 Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject() called at [vendor/magento/framework/ObjectManager/Factory/Compiled.php:108] #3 Magento\Framework\ObjectManager\Factory\Compiled->create() called at [vendor/magento/framework/ObjectManager/ObjectManager.php:56] #4 Magento\Framework\ObjectManager\ObjectManager->create() called at [generated/code/Magento/MediaStorage/Model/File/UploaderFactory.php:43] #5 Magento\MediaStorage\Model\File\UploaderFactory->create() called at [app/code/Mageplaza/Core/Helper/Media.php:108] #6 Mageplaza\Core\Helper\Media->uploadImage() called at [app/code/Mageplaza/BannerSlider/Controller/Adminhtml/Banner/Save.php:90] #7 Mageplaza\BannerSlider\Controller\Adminhtml\Banner\Save->execute() called at [vendor/magento/framework/App/Action/Action.php:107] #8 Magento\Framework\App\Action\Action->dispatch() called at [vendor/magento/module-backend/App/AbstractAction.php:235] #9 Magento\Backend\App\AbstractAction->dispatch() called at [vendor/magento/framework/Interception/Interceptor.php:58] #10 Mageplaza\BannerSlider\Controller\Adminhtml\Banner\Save\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138] #11 Mageplaza\BannerSlider\Controller\Adminhtml\Banner\Save\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/module-backend/App/Action/Plugin/Authentication.php:143] #12 Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch() called at [vendor/magento/framework/Interception/Interceptor.php:135] #13 Mageplaza\BannerSlider\Controller\Adminhtml\Banner\Save\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153] #14 Mageplaza\BannerSlider\Controller\Adminhtml\Banner\Save\Interceptor->___callPlugins() called at [generated/code/Mageplaza/BannerSlider/Controller/Adminhtml/Banner/Save/Interceptor.php:26] #15 Mageplaza\BannerSlider\Controller\Adminhtml\Banner\Save\Interceptor->dispatch() called at [vendor/magento/framework/App/FrontController.php:55] #16 Magento\Framework\App\FrontController->dispatch() called at [vendor/magento/framework/Interception/Interceptor.php:58] #17 Magento\Framework\App\FrontController\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138] #18 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153] #19 Magento\Framework\App\FrontController\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/App/FrontController/Interceptor.php:26] #20 Magento\Framework\App\FrontController\Interceptor->dispatch() called at [vendor/magento/framework/App/Http.php:136] #21 Magento\Framework\App\Http->launch() called at [vendor/magento/framework/App/Bootstrap.php:257] #22 Magento\Framework\App\Bootstrap->run() called at [index.php:39]
I get the sam exception when trying to create a banner of type advanced.
The problem seems to be mageplaza/module-core 1.4.4. After downgrading to 1.4.3 it works again
I can confirm the case. The exception I have is:
[2019-07-05 09:08:22] main.CRITICAL: Unable to serialize value. Error: Malformed UTF-8 characters, possibly incorrectly encoded {"exception":"[object] (InvalidArgumentException(code: 0): Unable to serialize value. Error: Malformed UTF-8 characters, possibly incorrectly encoded at /var/www/html/euroshop/vendor/magent o/framework/Serialize/Serializer/Json.php:26)"} []
After downgrading the core to 1.4.3 everything works.
Magento 2.3.2
PHP 7.2.19
Same exception in Magento 2.3.1. After downgrading the core to 1.4.3 everything works too. Thanks @dymitar
+1
Just replace uploadImage function at code/Mageplaza/Core/Helper/Media.php
current version (1.4.6): https://github.com/mageplaza/module-core/blob/85bfb6ef453471b2cef789dcf23525be8e7b881f/Helper/Media.php#L96
replate with (1.4.3): https://github.com/mageplaza/module-core/blob/881b4e59ea1684e5a3b22d618a2cb843d941ddaf/Helper/Media.php#L93
It works!
So, pull request then? ;)
It works for me!