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

Extending quote item with extension attributes - problem with load/save of attributes #21634

Closed
bartoszkubicki opened this issue Mar 7, 2019 · 3 comments
Labels
Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed

Comments

@bartoszkubicki
Copy link

bartoszkubicki commented Mar 7, 2019

Summary (*)

Recently, I was trying to extend quote item with extension attributes. I needed it inside cart and checkout. So there are actually two ways for loading and persisting extension attributes along extended model.

  • First is creating plugins on repository of entity which has these new attributes.
    For CartItemRepository this maybe would work for webapi - inside cart, checkout quote items are loaded in other ways - sometimes from qoute - by items collection, sometimes by directly loading model. It turns out that CartItemRepository is not very useful in frontend. Here comes also other grave problem - service contracts vs ,methods loading/returing/requiring concret implementations - many cases for quote and quote item.
  • Second way is adding handles to ExtensionPool, but it requires resource model using EntityManager, which is is not recommended . Despite of this for qoute item it is imposible, beacause, crud operations are performed in 'old-fashioned' way.

Finally, to perform crud operations on cart and checkout, with main logic in subtotals I ended up with plugins for three classes and override 5 methods - quote items are not loaded in any consistent way.

Examples (*)

Hard to provide - generally module doesn't seem to follow general guidelines from Magento.

Proposed solution

Clean up crud operations for quote and quote item, so service contract are used more widely on frontend, so we are not relying on implementations, but on contracts.

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Mar 7, 2019
@magento-engcom-team
Copy link
Contributor

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

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

  • yes
  • no

@ghost ghost self-assigned this Mar 11, 2019
@magento-engcom-team
Copy link
Contributor

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

  • Next steps are available in case you are a member of Community Maintainers.

  • 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
Copy link

ghost commented Mar 11, 2019

Hi @bartoszkubicki thank you for you report, It will be processed faster if you move this to https://github.com/magento/community-features

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed
Projects
None yet
Development

No branches or pull requests

2 participants