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

Missing xForm for cartItem Media #6488

Open
janus-reith opened this issue Jun 24, 2020 · 0 comments
Open

Missing xForm for cartItem Media #6488

janus-reith opened this issue Jun 24, 2020 · 0 comments
Labels
bug For issues that describe a defect or regression in the released software needs triage For issues that are awaiting triage by the core development team

Comments

@janus-reith
Copy link
Collaborator

Issue Description

There currently is no functionality to resolve cart item images, therefore these are not available in a cart query.

Background

Until v3.5.0 this xform was part of the cart: https://github.com/reactioncommerce/reaction/blob/v3.5.0/src/core-services/cart/xforms/xformCartItems.js

When @aldeed refactored that logic in da6502d that cart xform would only call registered functions of type xformCartItems while the actual logic was moved to the files plugin where such a function was registered.

So in v3.6.0 we had:
The xform on the cart: https://github.com/reactioncommerce/reaction/blob/v3.6.0/src/core-services/cart/xforms/xformCartItems.js
The actuall functionality here: https://github.com/reactioncommerce/reaction/blob/v3.6.0/src/core-services/files/util/xformItemsAddImageUrls.js

It seems like this got lost when things were moved to separate modules.
api-plugin-carts still contains that same call context.getFunctionsOfType("xformCartItems") but the files plugin doesn't register such a function anymore: https://github.com/reactioncommerce/api-plugin-files/blob/8ed90d8901b91940266979906286a09d24aa35b5/src/index.js#L34:L36

Looking at the other functions in v3.6.0 I wonder what else might be afffected, as there were 3 other functions aswell and only startup is left now:
https://github.com/reactioncommerce/reaction/blob/19cd5a6007bd53d73f753d8cd8fd9e941562c849/src/core-services/files/index.js#L36:L42

Steps to Reproduce

  1. Add item to cart
  2. CartItem has no image, imageUrls returns null.

Possible Solution

Register a function of type xformCartItems that provides the images.

Versions

v1.0.0 - trunk

@janus-reith janus-reith added bug For issues that describe a defect or regression in the released software needs triage For issues that are awaiting triage by the core development team labels Jun 24, 2020
@delagroove delagroove removed the needs triage For issues that are awaiting triage by the core development team label Sep 23, 2021
@zenweasel zenweasel transferred this issue from reactioncommerce/api-plugin-files Sep 21, 2022
@zenweasel zenweasel added the needs triage For issues that are awaiting triage by the core development team label Nov 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug For issues that describe a defect or regression in the released software needs triage For issues that are awaiting triage by the core development team
Projects
Current Work
  
Icebox
Development

No branches or pull requests

3 participants