magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.56k stars 9.32k forks source link

Logo is always 170 pixels wide, regardless of actual size #29721

Closed gwharton closed 5 months ago

gwharton commented 4 years ago

Preconditions (*)

  1. 2.4-develop

Steps to reproduce (*)

  1. Login to Admin
  2. Content -> Configuration -> Global -> Edit -> Header
  3. Upload 800x300 example logo image (attached to issue)
  4. Enter 800 in Logo Attribute Width
  5. Enter 300 in Logo Attribute Height
  6. Save Configuration
  7. Clear cache
  8. Go to frontend and inspect logo dimensions

Expected result (*)

  1. Logo is 800 pixels wide

Actual result (*)

  1. Logo is 170 pixels wide

image


Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

The cause is this

https://github.com/magento/magento2/blob/8b7d949bf1cb67d7b98379fb30b6721ec7b92b37/app/design/frontend/Magento/blank/Magento_Theme/layout/default.xml#L8-L16

And was introduced here. https://github.com/magento/magento2/pull/27497

800x300 example logo

m2-assistant[bot] commented 4 years ago

Hi @gwharton. Thank you for your report. To help us process this issue please make sure that you provided the following information:

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, please, review the Magento Contributor Assistant documentation.

Please, add a comment to assign the issue: @magento I am working on this


:clock10: You can find the schedule on the Magento Community Calendar page.

:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

:movie_camera: You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

m2-assistant[bot] commented 4 years ago

Hi @ajijshekh123. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

ajijshekh123 commented 4 years ago

@magento give me 2.4-develop instance

magento-engcom-team commented 4 years ago

Hi @ajijshekh123. Thank you for your request. I'm working on Magento 2.4-develop instance for you

magento-engcom-team commented 4 years ago

Hi @ajijshekh123, here is your Magento instance. Admin access: https://i-29721-2-4-develop.instances.magento-community.engineering/admin_2352 Login: 58aa3b1b Password: 509815ad9f08 Instance will be terminated in up to 3 hours.

ajijshekh123 commented 4 years ago

Hello @gwharton, I thought this is not an issue but this is a Magento feature. As per your steps to be reproduced, actual result and expected result. I have reproduced on Magento 2.4 Instance. PFA: Admin: image

Front end: image

Thanks.

magento-engcom-team commented 4 years ago

@ajijshekh123 Thank you for verifying the issue.

Unfortunately, not enough information was provided to acknowledge ticket. Please consider adding the following:

Once all required information is added, please add label "Issue: Confirmed" again. Thanks!

magento-engcom-team commented 4 years ago

:white_check_mark: Confirmed by @ajijshekh123 Thank you for verifying the issue. Based on the provided information internal tickets MC-36982 were created

Issue Available: @ajijshekh123, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

konarshankar07 commented 4 years ago

@magento I'm working on this

klein0r commented 4 years ago

The reason is, that Magento_Theme/layout/default.xml provides a default of 170 (and the block doesn't read the database config if the value is already present in the data storage). So I've created a workaround by using my own themes default.xml to override that value with my correct value.

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="logo">
            <arguments>
                <argument name="logo_width" xsi:type="number">100</argument>
                <argument name="logo_height" xsi:type="number">100</argument>
            </arguments>
        </referenceBlock>
    </body>
</page>
konarshankar07 commented 4 years ago

Hello @klein0r .. True.. But if we changed from the xml layout then what's the point of having the theme configuration in the backend? The preference would be if the value from the theme configuration is empty then it should take the value from the layout otherwise it should be taken from the theme configuration.

klein0r commented 4 years ago

@konarshankar07 I've said that this is a workaround for the issue until it is fixed. Or what is your recommendation for the current situation?

konarshankar07 commented 4 years ago

@klein0r .. I agree with you but I have submitted the fix which will sort this issue. If you want to get more information then you check out my PR https://github.com/magento/magento2/pull/29746

klein0r commented 4 years ago

I've seen that. But I've decided to create a default.xml for my shop, which is much easier to maintain than an additional patch file.

magentoexpert commented 3 years ago

This is not a fix for Magento 2.4.1 installed with composer. The new folder structure is completely different which includes /pub The folder structure /app/design/frontend/Magento/ referred to above is empty and obsolete

denistrator commented 2 years ago

Easy workaround

<referenceBlock name="logo">
    <arguments>
        <argument name="logo_width" xsi:type="null"/>
    </arguments>
</referenceBlock>
Poovarasan-06 commented 1 year ago

@magento give me 2.4-develop instance

magento-deployment-service[bot] commented 1 year ago

Hi @Poovarasan-06. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 1 year ago

Hi @Poovarasan-06, here is your Magento Instance: https://567ec6c2acfe082eeb71761b7163972e.instances-prod.magento-community.engineering Admin access: https://567ec6c2acfe082eeb71761b7163972e.instances-prod.magento-community.engineering/admin_0078 Login: f830acab Password: 33238e24c566

Poovarasan-06 commented 1 year ago

@magento give me 2.4-develop instance

magento-deployment-service[bot] commented 1 year ago

Hi @Poovarasan-06. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 1 year ago

Hi @Poovarasan-06, here is your Magento Instance: https://567ec6c2acfe082eeb71761b7163972e.instances-prod.magento-community.engineering Admin access: https://567ec6c2acfe082eeb71761b7163972e.instances-prod.magento-community.engineering/admin_ea6e Login: 0786335f Password: 7929f33891ac

Poovarasan-06 commented 1 year ago

@gwharton Hey, this issue is not reproducible in both testing instance and with my local setup.

isevchris commented 12 months ago

This appears to still be an issue with Magento 2.4.4-p6 at least, if your theme inherits from Magento Blank.

Essentially the logo image size gets loaded in from the following XML file: _./vendor/magento/theme-frontend-blank/MagentoTheme/layout/default.xml

If you override that file in your theme directory (./app/design/frontend); and set the xsi:type to null you can force it to load in the values from the database: core_config_data -> design/header/logo_width (or height).

    <referenceBlock name="logo">
        <arguments>
            <argument name="logo_width" xsi:type="null"></argument>
            <argument name="logo_height" xsi:type="null"></argument>
        </arguments>
    </referenceBlock>
engcom-Bravo commented 5 months ago

Hi @gwharton,

Thanks for your reporting and collaboration.

we have verified the issue in Latest 2.4-develop instance and the issue is not reproducible.Kindly refer the screenshots.

Screenshot at May 27 15-11-32

Logo is 800 pixels wide

Hence We are closing this issue.

Thanks.