Skip to content

Custom attribute - File not allowing uploads #11252

@stevenlavine

Description

@stevenlavine

Preconditions

  1. Magento 2.1.9
  2. PHP 7.0.2
  3. MySQL 5.7

Steps to reproduce

  1. Create a customer file upload attribute
  2. View the customer information in the CMS
  3. upload a file - in my case a PDF

Expected result

  1. the uploaded file appears in the customer form

Actual result

  1. Popup appears stating something went wrong with saving the file
  2. In the apache error log the following appears

[2017-10-05 14:37:15] main.CRITICAL: Exception: Notice: Undefined index: path in /var/www/vhosts/Rosita/public/vendor/magento/module-customer/Model/FileUploader.php on line 113 in /var/www/vhosts/Rosita/public/vendor/magento/framework/App/ErrorHandler.php:61
Stack trace:
#0 /var/www/vhosts/Rosita/public/vendor/magento/module-customer/Model/FileUploader.php(113): Magento\Framework\App\ErrorHandler->handler(8, 'Undefined index...', '/var/www/vhosts...', 113, Array)
#1 /var/www/vhosts/Rosita/public/vendor/magento/module-customer/Controller/Adminhtml/File/Customer/Upload.php(85): Magento\Customer\Model\FileUploader->upload()
#2 /var/www/vhosts/Rosita/public/vendor/magento/framework/App/Action/Action.php(102): Magento\Customer\Controller\Adminhtml\File\Customer\Upload->execute()
#3 /var/www/vhosts/Rosita/public/vendor/magento/module-backend/App/AbstractAction.php(226): Magento\Framework\App\Action\Action->dispatch(Object(Magento\Framework\App\Request\Http))
#4 /var/www/vhosts/Rosita/public/vendor/magento/framework/Interception/Interceptor.php(74): Magento\Backend\App\AbstractAction->dispatch(Object(Magento\Framework\App\Request\Http))
#5 /var/www/vhosts/Rosita/public/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Customer\Controller\Adminhtml\File\Customer\Upload\Interceptor->___callParent('dispatch', Array)
#6 /var/www/vhosts/Rosita/public/vendor/magento/framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\Custome...', 'dispatch', Object(Magento\Customer\Controller\Adminhtml\File\Customer\Upload\Interceptor), Array, 'adminAuthentica...')
#7 /var/www/vhosts/Rosita/public/vendor/magento/module-backend/App/Action/Plugin/Authentication.php(143): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain{closure}(Object(Magento\Framework\App\Request\Http))
#8 /var/www/vhosts/Rosita/public/vendor/magento/framework/Interception/Chain/Chain.php(67): Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch(Object(Magento\Customer\Controller\Adminhtml\File\Customer\Upload\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#9 /var/www/vhosts/Rosita/public/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\Custome...', 'dispatch', Object(Magento\Customer\Controller\Adminhtml\File\Customer\Upload\Interceptor), Array, 'adminMassaction...')
#10 /var/www/vhosts/Rosita/public/vendor/magento/module-backend/App/Action/Plugin/MassactionKey.php(33): Magento\Customer\Controller\Adminhtml\File\Customer\Upload\Interceptor->Magento\Framework\Interception{closure}(Object(Magento\Framework\App\Request\Http))
#11 /var/www/vhosts/Rosita/public/vendor/magento/framework/Interception/Interceptor.php(142): Magento\Backend\App\Action\Plugin\MassactionKey->aroundDispatch(Object(Magento\Customer\Controller\Adminhtml\File\Customer\Upload\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#12 /var/www/vhosts/Rosita/public/var/generation/Magento/Customer/Controller/Adminhtml/File/Customer/Upload/Interceptor.php(26): Magento\Customer\Controller\Adminhtml\File\Customer\Upload\Interceptor->___callPlugins('dispatch', Array, Array)
#13 /var/www/vhosts/Rosita/public/vendor/magento/framework/App/FrontController.php(55): Magento\Customer\Controller\Adminhtml\File\Customer\Upload\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#14 /var/www/vhosts/Rosita/public/vendor/magento/framework/Interception/Interceptor.php(74): Magento\Framework\App\FrontController->dispatch(Object(Magento\Framework\App\Request\Http))
#15 /var/www/vhosts/Rosita/public/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', Array)
#16 /var/www/vhosts/Rosita/public/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor), Array, 'install')
#17 /var/www/vhosts/Rosita/public/vendor/magento/framework/Module/Plugin/DbStatusValidator.php(69): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception{closure}(Object(Magento\Framework\App\Request\Http))
#18 /var/www/vhosts/Rosita/public/vendor/magento/framework/Interception/Interceptor.php(142): Magento\Framework\Module\Plugin\DbStatusValidator->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#19 /var/www/vhosts/Rosita/public/var/generation/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, Array)
#20 /var/www/vhosts/Rosita/public/vendor/magento/framework/App/Http.php(135): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#21 /var/www/vhosts/Rosita/public/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch()
#22 /var/www/vhosts/Rosita/public/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#23 {main} [] []

In vendor/magento/module-customer/Model/FileProcessor.php line 199 there is unset($result['path']);
This is required by the upload function in vendor/magento/module-customer/Model/FileUploader.php

commenting out line 199 results in the file appearing in the customer form, however clicking the link results in a 404 error

Metadata

Metadata

Labels

Fixed in 2.2.xThe issue has been fixed in 2.2 release lineFixed in 2.3.xThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedReproduced on 2.2.xThe issue has been reproduced on latest 2.2 release

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions