Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backward-incompatible change between 2.2.7 and 2.2.8 #22238

Closed
yutv opened this issue Apr 9, 2019 · 7 comments
Closed

Backward-incompatible change between 2.2.7 and 2.2.8 #22238

yutv opened this issue Apr 9, 2019 · 7 comments
Assignees
Labels
Component: Catalog Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line good first issue Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Progress: PR Created Indicates that Pull Request has been created to fix issue Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release

Comments

@yutv
Copy link

yutv commented Apr 9, 2019

Preconditions (*)

  1. Magento 2.2.7 and Magento 2.2.8
  2. PHP 7.1.10

Steps to reproduce (*)

  1. Create a custom module in Magento 2.2.7 with the following class:
    app/code/Vendor/Module/Block/Product/View/Options/Type/Swatch.php

     <?php
    
     namespace Vendor\Module\Block\Product\View\Options\Type;
    
     use Magento\Catalog\Block\Product\View\Options\Type\Select;
    
     class Swatch extends Select
     {
         public function getValuesHtml()
         {
             $html = parent:getValuesHtml();
             // custom logic goes here
             return $html;
         }
     }
    
  2. Check that this class doesn't cause PHP Fatal Error in Magento 2.2.7

  3. Upgrade to Magento 2.2.8

Expected result (*)

  1. No fatal error in custom module
  2. Method declaration in Magento classes MUST NOT change between patch versions (e.g. 2.2.7 and 2.2.8)

Actual result (*)

  1. Fatal error in custom module:

     Fatal error:  Declaration of Vendor\Module\Block\Product\View\Options\Type\Swatch::getValuesHtml() 
     must be compatible with Magento\Catalog\Block\Product\View\Options\Type\Select::getValuesHtml(): string 
     in app/code/Vendor/Module/Block/Product/View/Options/Type/Swatch.php on line 9
    

Backward-incompatible change

The issue caused by backward-incompatible commit between Magento 2.2.7 and 2.2.8 made by @rleshchenko.

The declaration of the getValuesHtml method was changed from:

public function getValuesHtml()

to:

public function getValuesHtml(): string

As result any class which extends this method in old declaration becomes incompatible with the new one and throws fatal error.

Note: Issue is still exists in the 2.2-develop branch: https://github.com/magento/magento2/blob/2.2-develop/app/code/Magento/Catalog/Block/Product/View/Options/Type/Select.php#L62

@m2-assistant
Copy link

m2-assistant bot commented Apr 9, 2019

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

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

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-engcom-team give me 2.3-develop instance - upcoming 2.3.x release

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

@yutv do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Apr 9, 2019
@ghost ghost self-assigned this Apr 9, 2019
@m2-assistant
Copy link

m2-assistant bot commented Apr 9, 2019

Hi @engcom-backlog-nazar. 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: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento-engcom-team give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • 6. Add label Issue: Confirmed once verification is complete.

  • 7. Make sure that automatic system confirms that report has been added to the backlog.

@ghost ghost added Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Fixed in 2.3.x The issue has been fixed in 2.3 release line Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels Apr 9, 2019
@magento-engcom-team
Copy link
Contributor

@engcom-backlog-nazar Thank you for verifying the issue.

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

  • Add "Component: " label(s) to this ticket based on verification result. If uncertain, you may follow the best guess

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

@magento-engcom-team magento-engcom-team removed the Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed label Apr 10, 2019
@ghost ghost removed their assignment Apr 10, 2019
@ghost ghost added the good first issue label Apr 10, 2019
@VitaliyBoyko VitaliyBoyko self-assigned this Apr 10, 2019
@m2-assistant
Copy link

m2-assistant bot commented Apr 10, 2019

Hi @VitaliyBoyko. 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: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento-engcom-team give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Verify that the issue is reproducible on 2.2-develop branch.
    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

@VitaliyBoyko VitaliyBoyko added the Progress: PR Created Indicates that Pull Request has been created to fix issue label Apr 10, 2019
@rogyar rogyar added Component: Catalog Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels Apr 10, 2019
@magento-engcom-team
Copy link
Contributor

✅ Confirmed by @rogyar
Thank you for verifying the issue. Based on the provided information internal tickets MAGETWO-99129 were created

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

@magento-engcom-team magento-engcom-team added Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Fixed in 2.2.x The issue has been fixed in 2.2 release line labels Apr 10, 2019
@magento-engcom-team
Copy link
Contributor

Hi @yutv. Thank you for your report.
The issue has been fixed in #22267 by @VitaliyBoyko in 2.2-develop branch
Related commit(s):

The fix will be available with the upcoming 2.2.9 release.

magento-engcom-team added a commit that referenced this issue Apr 17, 2019
…m the options… #22267

 - Merge Pull Request #22267 from VitaliyBoyko/magento2:magento-2.2-#22238-remove-backward-incompatible-change
 - Merged commits:
   1. 179bedf
@keyurk-emipro
Copy link
Contributor

This backward-incompatibility reproduced again in between 2.3.1 and 2.3.2 but can not found on 2.3-dev branch, Is there anyone know when this resolved from 2.3?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Catalog Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line good first issue Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Progress: PR Created Indicates that Pull Request has been created to fix issue Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release
Projects
None yet
Development

No branches or pull requests

5 participants