Skip to content

Commit

Permalink
Fixes theme header logo and icon upload
Browse files Browse the repository at this point in the history
  • Loading branch information
wiardvanrij committed Oct 26, 2018
1 parent eb27ac2 commit ba69bfe
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<collapsible>true</collapsible>
<label translate="true">HTML Head</label>
</settings>
<field name="head_shortcut_icon" formElement="fileUploader">
<field name="head_shortcut_icon" formElement="imageUploader">
<settings>
<notice translate="true">Not all browsers support all these formats!</notice>
<label translate="true">Favicon Icon</label>
Expand Down Expand Up @@ -151,7 +151,7 @@
<collapsible>true</collapsible>
<label translate="true">Header</label>
</settings>
<field name="header_logo_src" formElement="fileUploader">
<field name="header_logo_src" formElement="imageUploader">
<settings>
<label translate="true">Logo Image</label>
<componentType>imageUploader</componentType>
Expand Down

24 comments on commit ba69bfe

@lamellama
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@TheFrakes
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no such directory as app/code/Magento/Theme/view/adminhtml/ui_component/ ?

@amarnik
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for me it was ./vendor/magento/module-theme/view/adminhtml/ui_component/design_config_form.xml
but same change fixes logo and favicon upload

@fraguo
Copy link

@fraguo fraguo commented on ba69bfe Jan 16, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello everyone. i'm on the same issue. i'm on the admin store trying to change the store favicone but nothing is uploaded. As proposed, I changed the formElement value from fileUploader to imageUploader in design_config_form.xml which was in "www\magento\vendor\magento\module-theme\view\adminhtml\ui_component", then i run "php magento cache:flush" so that changes goes on (not running this command makes nothing change), unfortunately getting an error "

There has been an error processing your request
Exception printing is disabled by default for security reasons.

Error log record number: 1245880889150

"

I had to reverse those steps to get this previous error disapeare. i'm running Magento on localhost, i set the dev mode and reproduce the error, here what i got, (adding the inspector that shows "GET http://www.luma.com/favicon.ico 404 (Not Found)")

1 exception(s):
Exception #0 (Magento\Framework\Exception\LocalizedException): The "componentType" configuration parameter is required for the "header_logo_src" component.

Exception #0 (Magento\Framework\Exception\LocalizedException): The "componentType" configuration parameter is required for the "header_logo_src" component.
#0 C:\wamp64\www\magento\vendor\magento\framework\View\Element\UiComponentFactory.php(410): Magento\Framework\View\Element\UiComponentFactory->mergeMetadataItem(Array, Array, false)
#1 C:\wamp64\www\magento\vendor\magento\framework\View\Element\UiComponentFactory.php(410): Magento\Framework\View\Element\UiComponentFactory->mergeMetadataItem(Array, Array, false)
#2 C:\wamp64\www\magento\vendor\magento\framework\View\Element\UiComponentFactory.php(410): Magento\Framework\View\Element\UiComponentFactory->mergeMetadataItem(Array, Array, false)
#3 C:\wamp64\www\magento\vendor\magento\framework\View\Element\UiComponentFactory.php(319): Magento\Framework\View\Element\UiComponentFactory->mergeMetadataItem(Array, Array, false)
#4 C:\wamp64\www\magento\vendor\magento\framework\View\Element\UiComponentFactory.php(218): Magento\Framework\View\Element\UiComponentFactory->mergeMetadata('design_config_f...', Array, false)
#5 C:\wamp64\www\magento\vendor\magento\framework\View\Layout\Generator\UiComponent.php(140): Magento\Framework\View\Element\UiComponentFactory->create('design_config_f...', NULL, Array)
#6 C:\wamp64\www\magento\vendor\magento\framework\View\Layout\Generator\UiComponent.php(102): Magento\Framework\View\Layout\Generator\UiComponent->generateComponent(Object(Magento\Framework\View\Layout\Data\Structure), 'design_config_f...', Array, Object(Magento\Framework\View\Layout\Interceptor))
#7 C:\wamp64\www\magento\vendor\magento\framework\View\Layout\GeneratorPool.php(81): Magento\Framework\View\Layout\Generator\UiComponent->process(Object(Magento\Framework\View\Layout\Reader\Context), Object(Magento\Framework\View\Layout\Generator\Context))
#8 C:\wamp64\www\magento\vendor\magento\framework\View\Layout.php(343): Magento\Framework\View\Layout\GeneratorPool->process(Object(Magento\Framework\View\Layout\Reader\Context), Object(Magento\Framework\View\Layout\Generator\Context))
#9 C:\wamp64\www\magento\generated\code\Magento\Framework\View\Layout\Interceptor.php(89): Magento\Framework\View\Layout->generateElements()
#10 C:\wamp64\www\magento\vendor\magento\framework\View\Layout\Builder.php(129): Magento\Framework\View\Layout\Interceptor->generateElements()
#11 C:\wamp64\www\magento\vendor\magento\framework\View\Page\Builder.php(55): Magento\Framework\View\Layout\Builder->generateLayoutBlocks()
#12 C:\wamp64\www\magento\vendor\magento\framework\View\Layout\Builder.php(65): Magento\Framework\View\Page\Builder->generateLayoutBlocks()
#13 C:\wamp64\www\magento\vendor\magento\framework\View\Layout.php(253): Magento\Framework\View\Layout\Builder->build()
#14 C:\wamp64\www\magento\vendor\magento\framework\View\Layout.php(875): Magento\Framework\View\Layout->build()
#15 C:\wamp64\www\magento\generated\code\Magento\Framework\View\Layout\Interceptor.php(414): Magento\Framework\View\Layout->getBlock('menu')
#16 C:\wamp64\www\magento\vendor\magento\module-backend\Model\View\Result\Page.php(26): Magento\Framework\View\Layout\Interceptor->getBlock('menu')
#17 C:\wamp64\www\magento\generated\code\Magento\Backend\Model\View\Result\Page\Interceptor.php(24): Magento\Backend\Model\View\Result\Page->setActiveMenu('Magento_Theme::...')
#18 C:\wamp64\www\magento\vendor\magento\module-theme\Controller\Adminhtml\Design\Config\Edit.php(72): Magento\Backend\Model\View\Result\Page\Interceptor->setActiveMenu('Magento_Theme::...')
#19 C:\wamp64\www\magento\generated\code\Magento\Theme\Controller\Adminhtml\Design\Config\Edit\Interceptor.php(24): Magento\Theme\Controller\Adminhtml\Design\Config\Edit->execute()
#20 C:\wamp64\www\magento\vendor\magento\framework\App\Action\Action.php(108): Magento\Theme\Controller\Adminhtml\Design\Config\Edit\Interceptor->execute()
#21 C:\wamp64\www\magento\vendor\magento\module-backend\App\AbstractAction.php(231): Magento\Framework\App\Action\Action->dispatch(Object(Magento\Framework\App\Request\Http))
#22 C:\wamp64\www\magento\vendor\magento\framework\Interception\Interceptor.php(58): Magento\Backend\App\AbstractAction->dispatch(Object(Magento\Framework\App\Request\Http))
#23 C:\wamp64\www\magento\vendor\magento\framework\Interception\Interceptor.php(138): Magento\Theme\Controller\Adminhtml\Design\Config\Edit\Interceptor->___callParent('dispatch', Array)
#24 C:\wamp64\www\magento\vendor\magento\module-backend\App\Action\Plugin\Authentication.php(143): Magento\Theme\Controller\Adminhtml\Design\Config\Edit\Interceptor->Magento\Framework\Interception{closure}(Object(Magento\Framework\App\Request\Http))
#25 C:\wamp64\www\magento\vendor\magento\framework\Interception\Interceptor.php(135): Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch(Object(Magento\Theme\Controller\Adminhtml\Design\Config\Edit\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#26 C:\wamp64\www\magento\vendor\magento\framework\Interception\Interceptor.php(153): Magento\Theme\Controller\Adminhtml\Design\Config\Edit\Interceptor->Magento\Framework\Interception{closure}(Object(Magento\Framework\App\Request\Http))
#27 C:\wamp64\www\magento\generated\code\Magento\Theme\Controller\Adminhtml\Design\Config\Edit\Interceptor.php(39): Magento\Theme\Controller\Adminhtml\Design\Config\Edit\Interceptor->___callPlugins('dispatch', Array, NULL)
#28 C:\wamp64\www\magento\vendor\magento\framework\App\FrontController.php(159): Magento\Theme\Controller\Adminhtml\Design\Config\Edit\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#29 C:\wamp64\www\magento\vendor\magento\framework\App\FrontController.php(99): Magento\Framework\App\FrontController->processRequest(Object(Magento\Framework\App\Request\Http), Object(Magento\Theme\Controller\Adminhtml\Design\Config\Edit\Interceptor))
#30 C:\wamp64\www\magento\vendor\magento\framework\Interception\Interceptor.php(58): Magento\Framework\App\FrontController->dispatch(Object(Magento\Framework\App\Request\Http))
#31 C:\wamp64\www\magento\vendor\magento\framework\Interception\Interceptor.php(138): Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', Array)
#32 C:\wamp64\www\magento\vendor\magento\framework\Interception\Interceptor.php(153): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception{closure}(Object(Magento\Framework\App\Request\Http))
#33 C:\wamp64\www\magento\generated\code\Magento\Framework\App\FrontController\Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, Array)
#34 C:\wamp64\www\magento\vendor\magento\framework\App\Http.php(135): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#35 C:\wamp64\www\magento\generated\code\Magento\Framework\App\Http\Interceptor.php(24): Magento\Framework\App\Http->launch()
#36 C:\wamp64\www\magento\vendor\magento\framework\App\Bootstrap.php(258): Magento\Framework\App\Http\Interceptor->launch()
#37 C:\wamp64\www\magento\index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))
#38 {main}

thank you

@toddrobards
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This patch not working for me.
I have applied the patch as per Magento instructions here.
The file "design_config_form.xml" has changed to the above code which shows the patch worked.
I try to upload an image and get error: head_shortcut_icon does not contain field 'file'

@rauberdaniel
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@toddrobards All you need to do is change the two lines as mentioned above and run bin/magento setup:di:compile afterwards. Once you’ve done that, there should be an image upload field instead of a file upload field and it should work.

@toddrobards
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rauberdaniel I have changed the 2 lines as above, run bin/magento setup:di:complie, cleaned cache, the image upload field displays in the admin, then I select an image and save the page. The save comes up with red error at top of page "head_shortcut_icon does not contain field 'file'" and the image does not save.

@ArthurSCD
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Patch worked for me on 2.3.0, however it does not fix it for the transactional emails section. I didn't look very hard but didn't find where the transactional emails section is located.
image

@valikvali
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Patch worked for me on 2.3.0, however it does not fix it for the transactional emails section. I didn't look very hard but didn't find where the transactional emails section is located.

For email template

vendor/magento/module-email/view/adminhtml/ui_component/design_config_form.xml
replace
<field name="email_logo" formElement="fileUploader">
by
<field name="email_logo" formElement="imageUploader">

@techzilla
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@valikvali can you create a patch for that one also?

@R-K-Shrivastaw
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, I just installed the Magento 2.3.0 on my linux server. Using the Apche 2.4
I an not able to change the logo & Favicon images. As I went through the above suggestions. I changed the following:
<field name="head_shortcut_icon" formElement="fileUploader"> <field name="head_shortcut_icon" formElement="imageUploader">
<field name="header_logo_src" formElement="fileUploader"> <field name="header_logo_src" formElement="imageUploader">
After run command : php bin/magento setup:static content deploy -f
I got an error: Error log record number: 241687929861

I am not able to find any working solution for it. If anyone knows please help me.

@tkymuk
Copy link

@tkymuk tkymuk commented on ba69bfe Feb 6, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So Ive followed the steps to trying to get this fixed but i am presented with the following error

head_shortcut_icon does not contain field 'file'

Is this a buggy fix and when is 2.3.1 going to be released?

@tkymuk
Copy link

@tkymuk tkymuk commented on ba69bfe Feb 6, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ifact, anything im putting into fields in content configuration tab isnt updating even after flushing the cache.

@tkymuk
Copy link

@tkymuk tkymuk commented on ba69bfe Feb 6, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reverted the changes back to 'fileUploader' and every other entry field is now working again. Seems this fix to fix the bug is buggy itself.

@toddrobards
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tkymuk I'm pretty sure this fix is not a fix at all as there's a few of us getting the same issue.
The admin page shows image upload icon instead of file, but as soon as an image is uploaded it goes to error as you stated.
Still not working for me.

@sosman1963
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it is fixed in version 2.3.1 (which is not available yet), I should think they could provide a working fix in version 2.3.0. I have done everything mentioned in this post and still no joy. Thanks.

@cyberfab007
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mind boggling you would publish a release where you can't upload a logo

@andy17612
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how can i upload for svg file? thank you @wiardvanrij

@nasouhmr
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks its worked for me ! my boss is happy now ! 👍

@junweipan
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works perfectly on me, and after changing the codes, I need to change the theme and change it back to the previous theme, and all done!

@Richardmaximun
Copy link

@Richardmaximun Richardmaximun commented on ba69bfe May 15, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi guys!!

Are you sure the bugs were fixed? I am very sorry to inform you that with the new 2.3.1 package, on try to set the header logo, favicon, and email logo, show the same error and do not save operation:

header_logo_scr / email_logo / head_shortcut_icon does not contain field 'file'

I checked both files:

vendor/magento/module-email/view/adminhtml/ui_component/design_config_form.xml
vendor/magento/module-theme/view/adminhtml/ui_component/design_config_form.xml

Replacement fileUploader by imageUploader are applied but the error occurs anyway. Any help?

magento_ver
email_logo_error
favicon_error
header_error

@blissbhavar
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Every One, I have same issue in Magento 2.3.1.
@Richardmaximun did you find any solution?

@Richardmaximun
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Every One, I have same issue in Magento 2.3.1.
@Richardmaximun did you find any solution?

I have not a solution. Only insert the record directly into the database

@AndyJAllen
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I upgraded to 2.3.2 using composer and now can't use the insert/upload image function. When it loads the popup with the folder tree on the left; it displays error "A technical problem with the server created an error. Try again to continue what you were doing. If the problem persists, try again later." It also says no files found in each folder. When I try to upload an image despite the error; it says "File validation failed."

Please sign in to comment.