Skip to content

Inheriting from a class that doesn't exist #33334

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

Closed
Qikerz opened this issue Jun 24, 2021 · 13 comments · Fixed by #33449
Closed

Inheriting from a class that doesn't exist #33334

Qikerz opened this issue Jun 24, 2021 · 13 comments · Fixed by #33449
Assignees
Labels
Component: Pricing Fixed in 2.4.x The issue has been fixed in 2.4-develop branch Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Progress: done Reported on 2.4.x Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch

Comments

@Qikerz
Copy link

Qikerz commented Jun 24, 2021

https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Bundle/Pricing/Price/ConfiguredPrice.php#L151

Preconditions:
Install Magento 2.4-develop

Steps to reproduce :

  1. Open file magento2/app/code/Magento/Bundle/Pricing/Price/ConfiguredPrice.php
  2. Check line number 151
  3. It has a function call getPrice(BundleDiscountPrice::PRICE_CODE), with reference of BundleDiscountPrice class

Expected Result;
The class BundleDiscountPrice must be declare.

Actual Result:
This class is not defined

@m2-assistant
Copy link

m2-assistant bot commented Jun 24, 2021

Hi @Qikerz. 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 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


⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 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.

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

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

@m2-assistant
Copy link

m2-assistant bot commented Jun 24, 2021

Hi @engcom-Hotel. 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.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.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. Add label Issue: Confirmed once verification is complete.

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

@engcom-Hotel
Copy link
Contributor

Hi @Qikerz ,

We have checked this issue in Magento 2.4-develop branch. As per the stated file i.e.https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Bundle/Pricing/Price/ConfiguredPrice.php#L151, has a function call of getPrice which requires a string type of argument and it is passing BundleDiscountPrice::PRICE_CODE as an arguement.

It seems that, the class BundleDiscountPrice is not defined. Are you talking about the same issue?

@engcom-Hotel engcom-Hotel added the Issue: needs update Additional information is require, waiting for response label Jun 24, 2021
@Qikerz
Copy link
Author

Qikerz commented Jun 24, 2021

Hi @engcom-Hotel,

Yes that's right.

Also, there is no calculateDiscount function that takes a float argument $configuredOptionsAmount.

@engcom-Hotel
Copy link
Contributor

Hi @Qikerz ,

Based on the comments, I am confirming this issue.

@engcom-Hotel engcom-Hotel added Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch and removed Issue: needs update Additional information is require, waiting for response labels Jun 24, 2021
@m2-community-project m2-community-project bot added Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed and removed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels Jun 24, 2021
@magento-engcom-team
Copy link
Contributor

✅ Confirmed by @engcom-Hotel
Thank you for verifying the issue. Based on the provided information internal tickets MC-42711 were created

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

@engcom-Hotel engcom-Hotel added Reported on 2.4.x Indicates original Magento version for the Issue report. Component: Pricing labels Jun 29, 2021
@gabrieldagama gabrieldagama added the Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. label Jun 29, 2021
@monteshot
Copy link
Contributor

@magento I’m working on it

@monteshot
Copy link
Contributor

@magento I am working on this

@m2-assistant
Copy link

m2-assistant bot commented Jul 9, 2021

Hi @monteshot! 👋
Thank you for collaboration. Only members of Community Contributors Team are allowed to be assigned to the issue. Please use @magento add to contributors team command to join Contributors team.

@monteshot
Copy link
Contributor

@magento add to contributors team

@m2-assistant
Copy link

m2-assistant bot commented Jul 9, 2021

Hi @monteshot! 👋
Thank you for joining. Please accept team invitation 👉 here 👈 and add your comment one more time.

@monteshot
Copy link
Contributor

@magento I am working on this

monteshot added a commit to monteshot/magento2 that referenced this issue Jul 9, 2021
- Changed PRICE_CODE constant from non-exist class to $this class
monteshot added a commit to monteshot/magento2 that referenced this issue Jul 9, 2021
- calculateDiscount method must be point as FinalPrice to its class but in ConfiguredPrice.php this method not exist. Also in FinalPrice invokes the \Magento\Bundle\Pricing\Price\DiscountCalculator::calculateDiscount
- added unit test for method getValue
monteshot added a commit to monteshot/magento2 that referenced this issue Jul 12, 2021
- Removed unnecessary nesting in if statements according to the interface
monteshot added a commit to monteshot/magento2 that referenced this issue Jul 12, 2021
- Removed unnecessary properties from test class
monteshot added a commit to monteshot/magento2 that referenced this issue Jul 12, 2021
- Update the unit test for getter in case non-existing the item
monteshot added a commit to monteshot/magento2 that referenced this issue Jul 12, 2021
- Made changes backwards compatible.
monteshot added a commit to monteshot/magento2 that referenced this issue Jul 12, 2021
- Renamed Test class according to the recommendations.
monteshot added a commit to monteshot/magento2 that referenced this issue Jul 12, 2021
- Renamed Test class according to the recommendations.
monteshot added a commit to monteshot/magento2 that referenced this issue Jul 13, 2021
- Clarified comment for main test method
monteshot added a commit to monteshot/magento2 that referenced this issue Jul 13, 2021
- Adjusted code style for the unit test
- Replaced FQPN using import
monteshot added a commit to monteshot/magento2 that referenced this issue Jul 14, 2021
- Adjusted code style for configuredPriceSelection propery in the target code
- Added mock suffice to last property in unit test
- Added decimals after point in unit test
- Transferred setting up some mocks to the specific test case
monteshot added a commit to monteshot/magento2 that referenced this issue Jul 18, 2021
- Added space between
$discountCalculator and $configuredPriceSelection properties
- Updated PHPdoc in constructor
@sidolov sidolov added the Fixed in 2.4.x The issue has been fixed in 2.4-develop branch label Sep 23, 2021
@sidolov sidolov closed this as completed Sep 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Pricing Fixed in 2.4.x The issue has been fixed in 2.4-develop branch Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Progress: done Reported on 2.4.x Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch
Projects
Archived in project
6 participants