magento-2-banner-slider icon indicating copy to clipboard operation
magento-2-banner-slider copied to clipboard

Exception in edit banner settings without re-uploading same image

Open djamps opened this issue 5 years ago • 8 comments

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]

djamps avatar May 30 '19 22:05 djamps

I get the sam exception when trying to create a banner of type advanced.

leabaertschi avatar Jun 12 '19 08:06 leabaertschi

The problem seems to be mageplaza/module-core 1.4.4. After downgrading to 1.4.3 it works again

leabaertschi avatar Jun 12 '19 09:06 leabaertschi

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

dymitar avatar Jul 05 '19 09:07 dymitar

Same exception in Magento 2.3.1. After downgrading the core to 1.4.3 everything works too. Thanks @dymitar

KeyShang avatar Aug 16 '19 09:08 KeyShang

+1

acjbizar avatar Aug 21 '19 10:08 acjbizar

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!

amaumiranda avatar Sep 03 '19 00:09 amaumiranda

So, pull request then? ;)

acjbizar avatar Sep 03 '19 10:09 acjbizar

It works for me!

ecommercegluk avatar Sep 27 '19 17:09 ecommercegluk